Back

Attendance Variables

Daftra helps in accurately tracking employees’ attendance through dedicated attendance variables. These variables, such as sign-in, sign-out, shifts, and leave types, ensure accurate working hours and absence recording. 

 

This helps streamline payroll processing, track productivity, and maintain compliance with company policies, all while reducing manual errors and saving time.

 

This guide introduces you to Daftra HR variables and their usage. Please contact our technical support team if you need assistance or would like to learn how to customize and direct these variables to meet your business needs.

Attendance Flags

Any attendance flag count:

It will display the occurrence of the flag within a specific attendance sheet period.

For Example: If the attendance condition requires that the ‘Attendance Day Sign-In’ time for the employee is < 8,
and the formula is: 1

If the employee has 8 days when they signed in earlier than 8 AM, then the number of times the attendance flag will appear in the attendance records will be ‘8’.

Any attendance flag amount:

 The system will display formula calculations for a specific attendance flag.

For example: If the attendance condition requires that the ‘Attendance Day Actual Working Hours’ for the employee is < 8,
and the employee has 8 days where their actual working hours were less than 8 hours,

the formula used will be: ‘Attendance Day Expected Working Hours – Attendance Day Actual Working Hours.’

This will show in the attendance record the total number of hours calculated as the difference between the expected working hours for the employee’s shift and the actual working hours for the employee, for each day that meets the condition during the calculated period.

Attendance Flags

What is the difference between calculating time and date in hours or using timestamp format?

Hour Format: This is the standard way to calculate time and date.
For example:
11/11/2024 – 10 AM

Timestamp Format: The timestamp is a special format for storing date and time accurately, consisting of a sequence of numbers and characters. It is used to compare the date/time of multiple events in the system, such as the time a staff profile is created or the date a contract is modified.

Attendance Day Sign-In (Timestamp):

The system will evaluate the sign-in for the attendance day using a timestamp format.

For Example: If the sign-in date and time is 9/8/2024, 10:20:00 AM, the corresponding timestamp for this date and time will be 1725780000.

Attendance Day Sign-In (Hours):

The system will evaluate the sign-in time for the attendance day using a 24-hour format.

For Example: If the sign-in time is 9:00 AM, the sign-in hour will be recorded as 9.

Attendance Day Sign-Out (Timestamp):

The system will evaluate the sign-out for the attendance day using a timestamp format.

For example: if the sign-out date and time is 9/8/2024, 5:00:00 PM, the corresponding timestamp for this date and time will be 1725804000.

Attendance Day Sign-Out (Hours):

The system will evaluate the sign-out time for the attendance day using a 24-hour format.

For example: if the sign-out time is 5:00:00 PM, the sign-out hour will be recorded as 17.

Attendance Day On-Duty (Hours):

 The system will evaluate the shift on-duty time for the attendance day using a 24-hour format.

For example: if the on-duty time is 9:00 AM, the on-duty time will be recorded as 9.

Attendance Day On-Duty (Timestamp):

 The system will evaluate the shift on duty for the attendance day using a timestamp format.

For Example: if the on-duty date and time is 9/8/2024, 10:20:00 AM, the corresponding timestamp for this date and time will be 1725780000.

Attendance Day Off-Duty (Hours):

 The system will evaluate the shift off-duty time for the attendance day using a 24-hour format.

For Example: if the duty time is 5:00:00 PM, the off-duty will be recorded as 17.

Attendance Day Off-Duty (Timestamp):

The system will evaluate the shift off duty for the attendance day using a timestamp format.

For Example: if the start of sign-in date and time is 9/8/2024, 07:00:00 AM, the corresponding timestamp for this date and time will be 1725768000.

Attendance Day Start of Sign-In (Hours):

The system will evaluate the start of sign-in time for the attendance day using a 24-hour format.

For Example: if the start of sign-in time is 7:00 AM, the start of sign-in hour will be recorded as 7.

Attendance Day Start of Sign-out (Timestamp):

The system will evaluate the start of sign-out for the attendance day using a timestamp format.

For Example: if the sign-in start date and time is 9/8/2024, 5:00:00 PM, the corresponding timestamp for this date and time will be 1725804000.

Attendance Day Start of Sign-out (Hours):

The system will evaluate the start of sign-out time for the attendance day using a 24-hour format.

 

For example: if the start sign-out time is 5:00:00 PM, the start of the sign-out hour will be recorded as 17.

Attendance Day End of Sign-In (Hours):

The system will evaluate the end of sign-in time for the attendance day using a 24-hour format.

 

For example: if the end sign-in time is 5:30:00 PM, the end of the sign-out hour will be recorded as 17.5.

Attendance Day End of Sign-In (Timestamp):

 The system will evaluate the end of sign-in for the attendance day using a timestamp format.

Example: if the end of sign-in date and time is 9/8/2024, 10:20:00 AM, the corresponding timestamp for this date and time will be 1725780000.

Attendance Day End of Sign-out (Hours):

The system will evaluate the end of sign-out time for the attendance day using a 24-hour format.

Example: if the end of sign-out time is 7:00:00 PM, the end of sign-out hour will be recorded as 19.

Attendance Day End of Sign-out (Timestamp):

The system will evaluate the end of sign-out for the attendance day using a timestamp format.

 

Example: if the end of sign-out date and time is 9/8/2024, 5:00:00 PM, the corresponding timestamp for this date and time will be 1725804000.

Attendance Sheet Expected Working Hours:

 The system will calculate the expected working hours for the attendance sheet in hours format.

For example: the expected working hours for an employee in September is 100 hours.

Attendance Sheet Actual Working Hours:

The system will calculate the actual working hours for the attendance sheet in hours format.

Example: the actual working hours for an employee in September is 90 hours out of 100 expected working hours.

Shift Type:

This placeholder will be used in the condition of any flag or component, not the formula itself, as we have two types for each shift: “Standard” or “Advanced.”

For example, the user can write the condition:Shift Type” == “Standard“. The formula will be Basic (Amount) * 0.5. As a result, for this component, all employees with a “Standard” shift type will have their basic salary component multiplied by 0.5 in a new component, provided this component is included in the employee’s contract or payslip.

Shift Type (Key):

This placeholder will be used in the condition of any flag or component, not the formula itself, as we have two types for each shift: “Standard” or “Advanced.”

For example, the user can write the following condition:Shift Type” == “standard“. The formula will be Basic(Amount) * 0.5. As a result, for this component, all employees with a “standard” shift type will have their basic salary component multiplied by 0.5. Note that the shift type will be written in lowercase, for example, “standard,” not “Standard”.

Shift Name:

The placeholder will display the shift name and will be used in the conditions of flags and components, not in formulas.

Example:Shift Name” == “Morning Shift“.

Leave Policy Status:

  • This variable is used only in the condition of the attendance rule or salary item, not in the calculation formula. It refers to the current condition or state of the leave policy, such as whether it is Active or Inactive.

When the status of the leave policy in the condition matches the status of the leave policy assigned to the employee through their shift (if the condition is part of the attendance rules) or through their contract (if the condition is part of the salary item), the calculation formula (the result of the condition) is applied.

Example: Condition: ”Leave Policy Status” == ”Active”

Formula: Basic (Component) Amount * 0.5

Leave Policy Name:

 A label or description for the leave policy. It can be used in the attendance rules or salary components conditions, but it is not used in calculation formulas.

 

Example: ”Leave Policy Name” == ”General Company Leave Policy”

(Leave Type) Total Leaves Taken:

This represents the total number of leaves an employee has taken under a specific leave type (e.g., vacation, sick leave).

Example: Condition: Sick Leave Total Leaves Taken >= 2

Formula: Basic (Component) Amount * 0.10

(Leave Type) Total Leaves Taken Before:

This shows the number of leaves taken before a specific time for the type of leave you specify in the condition.

Example: Condition: Sick Leave Total Leaves Taken Before >= 2

Formula: Basic (Component) Amount * 0.10

(Leave Type) Total Leaves After:

This shows the number of leaves taken after a specific event or time.

Example: Condition: Sick Leave Total Leaves After >= 2

Formula: Basic (Component) Amount * 0.10

(Leave Type) Leaves Credit Before:

The system calculates the total available leave balance for the employee from each type of leave before accounting for the current attendance record leave.

Example: Condition: Sick Leave Leaves Credit Before <= 28

Formula: Basic (Component) Amount * 0.10

(Leave Type) Leaves Credit After:

The system calculates the total available leave balance for the employee from each type of leave after accounting for the current attendance record leave.

Example: Condition: Sick Leave Leaves Credit After <= 28

Formula: Basic (Component) Amount * 0.10

Attendance Day Status:

  • This variable is used only in the condition of the attendance rule or salary components, not in the formula (the result of the condition). It checks whether the attendance day status is: Present, Absent, or On Leave.

When the specified attendance day status in the condition matches the employee’s attendance day status assigned by their shift (if the condition is part of the attendance rules) or by their contract (if the condition is part of the salary component), the calculation formula (the result of the condition) is applied.

Example: Condition: ‘Attendance Day Status’ == ‘Absent’ 

Formula: Basic (Component) Amount * .5

Attendance Day Status (Key):

  • This variable is used only in the condition of the attendance rule or salary item, not in the calculation formula (the result of the condition). It checks whether the attendance day status is: present, absent, or on leave. 

When the specified attendance status in the condition matches the employee’s attendance day status assigned by their shift (if the condition is part of the attendance rules) or by their contract (if the condition is part of the salary item), the calculation formula (the result of the condition) is applied.

Example: Condition: ‘Shift Type(key)’ == ‘absent’

Formula: Basic (Component) Amount * 0.5

Note: This condition differs from the previous one as it interacts with the system’s database, so the attendance type variable should match the database format as: present/absent/on leave, with all letters written in lowercase English.

Attendance Day Calculation Type:

  • This variable is used only in the condition of the attendance rule or salary component, not in the calculation formula (the result of the condition). It checks whether the attendance calculation type is manual or automatic. 

When the specified attendance calculation type in the condition matches the attendance calculation type assigned to the employee by their shift (if the condition is part of the attendance rules) or by their contract (if the condition is part of the salary components), the calculation formula (the result of the condition) is applied. The attendance calculation type is determined for each day individually, even in an attendance record generated for a while, such as a month.

Example: Condition: ‘Attendance Day Calculation Type’ == ‘Manual’

Formula: Basic (Component) Amount * 0.5

Attendance Day Calculation Type (Key):

  • This variable is used only in the condition of the attendance rule or salary components, not in the calculation formula (the result of the condition). It checks whether the attendance calculation type is manual or automatic. 

When the specified attendance calculation type in the condition matches the daily attendance calculation type assigned to the employee by their shift (if the condition is part of the attendance rules) or by their contract (if the condition is part of the salary components), the calculation formula (the result of the condition) is applied. The attendance calculation type is determined for each day individually, even in an attendance record generated for a while, such as a month.

Example: Condition: ‘Attendance Day Calculation Type Key’ == ‘manual’

Formula: Basic (Component) Amount * 0.5

Note: This condition differs from the previous one as it interacts with the system’s database. Therefore, the attendance calculation type variable should be written as it appears in the database: manual/automatic, with all letters in lowercase English.

Attendance Day Early Leave:

 This indicates if an employee leaves work earlier than the scheduled end time.

Example (Attendance Rule): Condition: Attendance Day Early Leave >= 30

Formula: 1

Attendance Day Attendance Delay:

How late an employee was when signing in for work compared to their scheduled time.

Example (Attendance Rule): Condition: Attendance Day Attendance Delay >= 30

Formula: 1

Attendance Day Leave Count:

  • The system calculates the number of leave days deducted from the leave balance for a day of leave. One day of leave may equal two days, or the employee’s attendance may be partial, in which case a day of leave is counted as only half a day from the leave balance. 

The condition is validated, and the ‘Attendance Flag‘ is displayed if the system’s total calculation of the days deducted from the leave balance in the attendance record meets the attendance condition.

Example (Attendance Rule): Condition: Attendance Day Leave Count >= 2

Formula: 1