Topic: Salary calculation
Hello everyone, is there a program to calculate working hours and salary?
I searched the forum but couldn't find anything.
My Visual Database → General → Salary calculation
Hello everyone, is there a program to calculate working hours and salary?
I searched the forum but couldn't find anything.
Salut Destiny,
What exactly do you want the program to do.
Can you provide more information - fields to be held, calculation to be performed etc?
Derek.
Hi Derek, I just wanted an example of calculating hours worked and income because I have it in Excel but I would have liked to do it in MVD.
I don't have an example at the moment; I need to think about how to implement it.
Hi,
Attached is a suggested approach but it's difficult to be specific without knowing
1. how you want to enter the 'time' (using a datetimepicker (as per the attachment), using 2 discrete fields for 'hours' and 'minutes' etc.
2. do your work hours go across days (ie someone who works during the night).
3. I haven't attempted to calculate salary because I don't know the rules (by the minute, by the hour, by partial hour etc).
But hopefully the attachment can give you some ideas.
Regards,
Derek.
Thanks Derek, I'll see what I can do.
Hello, I'm having trouble with the minutes I'd like to display in the TableGrid to get the total hours worked. Can someone take a look?
Hi Destiny, Derek
cfTotal
time(strftime('%s', Hmatin)+strftime('%s', hapm), 'unixepoch')Thanks sparrow, I would have liked a total at the bottom of the page to have all the hours worked for the month (addition of all the days at the bottom of the page).
Hi Destiny,
The thanks for this fix to the calculated field should go to Sparrow, not me - I wasn't even logged on! ![]()
Derek.
Mise a jour éffectuée
//Couleurs des colonnes
procedure FormHT_TableGrid1_OnChange (Sender: TObject);
begin
FormHT.TableGrid1.Columns[1].Header.Color := $00FFFFCC;
FormHT.TableGrid1.Columns[2].Header.Color := $00FFFFCC;
FormHT.TableGrid1.Columns[3].Header.Color := $00FFFFCC;
FormHT.TableGrid1.Columns[4].Header.Color := $00BBFFBB;
FormHT.TableGrid1.Columns[5].Header.Color := $00BBFFBB;
FormHT.TableGrid1.Columns[6].Header.Color := $00BBFFBB;
FormHT.TableGrid1.Columns[8].Header.Color := $004080FF;
FormHT.TableGrid1.Columns[8].Footer.Caption := SQLExecute('SELECT time(SUM(strftime("%s", Hmatin))+SUM(strftime("%s", hapm)), "unixepoch") FROM HeuresTravail');
end;Great, thanks sparrow, it's much better like that.
This is how it will be correct, otherwise the first zero gets lost and everything works incorrectly.
procedure On_Change (Sender: TObject);
begin
FormHT.Edit5.Text := FormatDateTime('hh:nn:ss', StrToTime(FormHT.Edit1.Text)-StrToTime(FormHT.Edit2.Text));
FormHT.Edit8.Text := FormatDateTime('hh:nn:ss', StrToTime(FormHT.Edit3.Text)-StrToTime(FormHT.Edit4.Text));
FormHT.Edit6.Text := FormatDateTime('hh:nn:ss', StrToTime(FormHT.Edit5.Text)+StrToTime(FormHT.Edit8.Text));
end;Thanks, I have another problem, when I click on 'New' to add hours I get an error.
Where is this button? And what is the error?
It's the green + button and I've taken a picture of the error.
The error tells you that the time format is incorrect (_0:__).
Let's check the entered value and return the user back to correct the value, with a hint.
Without the 'New' button it works but as soon as I put it back the error comes back.
Now there's a button.
Now it's working properly, thank you very much sparrow. I had a little trouble with his schedules.
Hi Destiny
Please update the query to calculate the footer in the table. My mistake.
FormHT.TableGrid1.Columns[8].Footer.Caption :=
SQLExecute('SELECT PRINTF("%02d:",SUM(STRFTIME("%s", "1970-01-01 "||TotalHeures))/3600)|| '+
'PRINTF("%02d:",((SUM(STRFTIME("%s", "1970-01-01 "||TotalHeures)))%3600)/60)|| '+
'PRINTF("%02d",(((SUM(STRFTIME("%s", "1970-01-01 "||TotalHeures)))%3600)%60)) FROM HeuresTravail');Great, I had a problem with the pause times and now you've just fixed it.
Thanks, sparrow.
Hello, I'm having trouble displaying the total hours for the month (in the 'hours per day' column) in the printable report; I think something is preventing it from being displayed.
I am attaching the report.
Hi,
For correct display you need to apply time formatting in the properties for this field in MasterData1.
Hello, sorry to bring this up again, but I'm having trouble displaying the monthly total in the report. I've looked into it, but it still shows the same thing.
My Visual Database → General → Salary calculation
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi