I am working on App that tracks the presence and absence of staff and correspondingly deducts the pay if they have exceeded the number of fixed leaves.
While I have created the employee profiles, I am unable to add a date segment for the employer to mark the employee as absent. I want the employer to be able to select a single date or in bulk if it was a longer week. How can I do this?
Hey, welcome to the forum.
Ultimately you describe 2 cases:
-
Absence on a particular day
-
Absence over a long period of time - from date A to date B
So you need 1 and/or 2 date columns in your absence documentation.
Have you already familiarized yourself with the basics?
For example:
Data & layout
Forms
Relations
If not, take a look here:
1 Like
You’ll want to create a form that writes to an attendance (absent) log. Record the employee (email or id), start date time and end date time (could be same date). In the log table, use the Date Difference tab to determine number of hours/days in that range.
Create a multiple relation column in your employees table that relates their email/id to the email/id column in the log.
If you’re trying to roll up the number of hours in the current year, then you’ll want to add a math column in the employee table that gets the year of the now date (year(now)) and a similar math column in the log table (referencing the start datetime). This assumes that the employee leave bank is January → December.
Then, add a query column through the relation that matches the now year to the start date year to only reference log entries from this year.
Finally, add a rollup column (through the query) that sums the hours/days from the date difference column. Subtract this number from the employee leave bank value (presumedly located in the employee table) to get the remaining balance.
3 Likes