Re: Salary calculation

Something like that.

You need to decide. Do you need seconds in your program. If not, everything can be simplified a bit.

If you need seconds, you need to work on saving time in the database and displaying it in the form fields. The format in the database and in the form fields must be strictly (00:00:00).

Post's attachments

Attachment icon Temps de travail rep.rar 11.63 kb, 35 downloads since 2025-09-09 

27 (edited by Destiny 2025-09-09 15:09:12)

Re: Salary calculation

Thanks, Moineau, I understand now. I actually tried adding a field with the month column, but I must have done something wrong because the result wasn't satisfactory. The seconds aren't necessary. Thanks!

Destiny

Re: Salary calculation

The archive contains two examples with and without seconds.
If you do not bring everything to the same format, with or without seconds, different time formats are written to the database (00:00 and 00:00:00), which leads to different display later. There just needs to be order. )


For printing in the report, the error with the total time has been fixed.
Added display in the table if the time is 00:00:00.

Post's attachments

Attachment icon Temps de travail time mod.rar 24.1 kb, 41 downloads since 2025-09-09 

Re: Salary calculation

Hello Sparrow, yes, indeed the difference is clear, thank you.

Destiny

30 (edited by sparrow 2025-09-11 20:03:15)

Re: Salary calculation

Hi Destiny


Something like that. Everything is slightly changed.
The data for the 8th month as an example is saved in the program.
If there are any mistakes, write. If I find them myself, I will correct them and write.

Post's attachments

Attachment icon Temps de travail new mod.rar 119.81 kb, 41 downloads since 2025-09-11 

31 (edited by Destiny 2025-09-12 07:05:16)

Re: Salary calculation

Hello Moineau, this version is very good. I tested it and didn't find any operational errors. I like the layout of the month and year buttons.
For the "AM and PM" time fields, I would like to use the ENTER key to move to the next field because using the mouse is less convenient.
I added an "Absences" column as a reminder, as it's important to be able to justify your absence that day, as well as some all-in-one functions (screenshots) such as saving to PDF format.
Thank you for this example, which I really appreciate.

Post's attachments

Attachment icon Horaires de travail.jpg 262.32 kb, 17 downloads since 2025-09-12 

Destiny

Re: Salary calculation

Hi Destiny, Sparrow,
To use 'enter', perhaps add something like this to your script

procedure FormHT_OnKeyPress (Sender: TObject; var Key: Char);  //** set FormHT 'keypreview' to 'true'
begin
  if key = #13 then formht.SetFocusNextControl;
end;

You can also use the 'tab' key without any additional code.
Derek.

33 (edited by sparrow 2025-09-12 13:52:36)

Re: Salary calculation

Hi Derek
Derek, thanks for the tip. Useful tip.


Improved exit from editing mode by Cancel button and Exit program button.
Added reason for absence.
Added output to PDF.
Added month, year in report.
Corrected report.
Added switching by Enter between editing fields (Edit1, Edit2, Edit3, Edit4, Bsave). When focus falls on Bsave, the next press on Enter will cause Enter to be pressed and the record to be saved. To activate Cancel, instead of Bsave button, right arrow and Enter.
Fixed minor bugs. New ones may have been added.

Post's attachments

Attachment icon Temps de travail new mod1.rar 120.94 kb, 36 downloads since 2025-09-12 

34 (edited by Destiny 2025-09-12 14:19:04)

Re: Salary calculation

It's pretty detailed like that too. Since there's already a printer for the current document, it would be nice to make the PDF button save directly to a folder to keep track of, like pay slips.

Destiny

Re: Salary calculation

By pressing the PDF button the file is saved in the "Pay Slips" directory. By pressing the Print button - preview and printing.

Post's attachments

Attachment icon Temps de travail new mod2.rar 124.51 kb, 47 downloads since 2025-09-12 

Re: Salary calculation

This is absolutely fantastic, a very good program. I think it's complete now and will be useful to quite a few people. It gives me ideas for finishing mine.
Well done and thank you, Moineau.

Destiny

Re: Salary calculation

Adding overtime hours

Post's attachments

Attachment icon hrs.png 105.17 kb, 17 downloads since 2025-09-13 

Destiny