Back

Attendance Flags, Variables, and Salary Components Guide

Attendance and payroll variables in the system enable you to automate payroll adjustments for special cases, whether they apply to a single employee or a group of employees.

For example, through these variables, you can deduct a percentage you set from an employee’s salary if they are late by 10 minutes to their shift, and deduct a different amount if they are late by 20 minutes, without having to manually adjust salary deductions and entitlements.

In this guide, we will explore a set of the most important variables and their uses.

You can also reach out to our support team if you need assistance or would like to learn how to customize and apply these variables to serve your business needs.

Attendance Rules

Number of Attendance Rule Occurrences — attendance flag count

{{$attendance_sheet_flag_17.total_count}}

Here, the number 17 represents the attendance rule ID. This is an automatically generated sequential number assigned to each attendance rule you create in the system.

Note that the identifier number you see on your account will most likely differ from the example shown (17).

The system displays the number of times a specific attendance rule was triggered within the defined time period in the attendance log.

Example:
If the attendance rule states that:

The employee’s Attendance Day Sign-In time must be < 8

And the formula is:

1

Then, if an employee has 10 days where they signed in earlier than 8:00 AM, the number of occurrences of this attendance rule in the attendance log will be “10.”

Total Duration Calculated for Attendance Rule Occurrences — attendance flag amount

{{$attendance_sheet_flag_17.total_value}}

Here, the number 17 represents the attendance rule ID. This is an automatically generated sequential number assigned to each attendance rule you create in the system.

Note that the identifier number you see in your account will most likely differ from the example shown (17).

The system displays the total calculated value (hours/minutes) based on the fulfillment of a specific attendance condition.

Example:

If the attendance condition requires that:
The employee’s Attendance Day Actual Working Hours < 8

And the employee has 8 days where their actual working hours were less than 8,

Then the calculation formula used would be:

Attendance Day Expected Working Hours – Attendance Day Actual Working Hours

The attendance log will therefore show the total number of hours calculated as the difference between the employee’s expected working hours for the shift and their actual working hours, for all the days where the condition was met during the logged period.

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

Hours Format:

The standard format for calculating date and time.

Example:
11/11/2024 – 10 AM

Timestamp Format:

A timestamp is a special format for storing date and time accurately. It is represented as a sequence of numbers and characters. It is used to compare the date/time of multiple events in the system, such as when an employee profile was created or when a contract was modified.

Attendance Day Sign-In (Hours):

{{$attendance_day.sign_in__hours}}

The system processes employee sign-in times in 24-hour format.

Example:
If the employee’s sign-in time is 9:00 AM, the system records it as “9.”

Attendance Day Sign-In (Timestamp):

{{$attendance_day.sign_in__timestamp}}

The system processes employee sign-in times in timestamp format.

Example:
If the sign-in date and time are 8 September 2024, at 10:20 AM, it is converted into the following timestamp: 1725780000.

Attendance Day Sign-Out (Hours):

{{$attendance_day.sign_out__hours}}

The system processes employee sign-out times in 24-hour format.

Example: If the employee’s sign-out time is 5:00 PM, it is recorded as “17.”

Attendance Day Sign-Out (Timestamp)

{{$attendance_day.sign_out__timestamp}}

The system processes employee sign-out times in timestamp format.

Example:
If the sign-out date and time is 8 September 2024, at 5:00 PM, it is converted into the following timestamp: 1725804000.

Attendance Day On-Duty (Hours)

{{$attendance_day.on_duty__hours}}

The system processes the shift start time in 24-hour format.

Example:
If the shift start time is 9:00 AM, it is recorded as “9.”

Attendance Day On-Duty (Timestamp)

{{$attendance_day.on_duty__timestamp}}

The system processes the shift start time in timestamp format.

Example:
If the shift start date and time is 8 September 2024, at 10:20 AM, it is converted into the following timestamp: 1725780000.

Attendance Day Off-Duty (Hours)

{{$attendance_day.off_duty__hours}}

The system processes the shift end time in 24-hour format.

Example:
If the shift end time is 5:00 PM, it is recorded as “17.”

Attendance Day Off-Duty (Timestamp)

{{$attendance_day.off_duty__timestamp}}

The system processes the shift end time in timestamp format.

Example:
If the shift end date and time is 8 September 2024 at 5:00 PM, it will be converted into the following timestamp: 1725804000.

Attendance Day Start of Sign-In (Hours)

{{$attendance_day.beginning_in__timestamp}}

The system processes the beginning of the employee’s sign-in period in 24-hour format.

Example:
If the beginning of the sign-in period is 7:00 AM, the system records it as “7.”

Attendance Day Start of Sign-In (Timestamp)

{{$attendance_day.beginning_in__timestamp}}

The system processes the beginning of the sign-in period in timestamp format.

Example:
If the start date and time of sign-in is 8 September 2024 at 7:00 AM, it is converted into the following timestamp: 1725768000.

Attendance Day Start of Sign-Out (Hours)

{{$attendance_day.beginning_out__hours}}

The system processes the beginning of the sign-out period in 24-hour format.

Example:
If the beginning of the sign-out period is 7:00 AM, the system records it as “7.”

Attendance Day Start of Sign-Out (Timestamp)

{{$attendance_day.beginning_out__timestamp}}

The system processes the beginning of the sign-out period in timestamp format.

Example:
If the start date and time of sign-out is 8 September 2024 at 5:00 PM, it is converted into the following timestamp: 1725804000.

Attendance Day End of Sign-In (Hours)

{{$attendance_day.ending_in__hours}}

The system processes the end of the sign-in period in 24-hour format.

Example:
If the end of the sign-in period is 5:30 PM, the system records it as “17.5.”

Attendance Day End of Sign-Out (Hours)

{{$attendance_day.ending_out__hours}}

The system processes the end of the sign-out period in 24-hour format.

Example:
If the end of the sign-out period is 7:00 PM, the system records it as “19.

Attendance Day End of Sign-Out (Timestamp)

{{$attendance_day.ending_out__timestamp}}

The system processes the end of the sign-out period in timestamp format.

Example:
If the end date and time of sign-out is 8 September 2024 at 5:00 PM, it is converted into the following timestamp: 1725804000.

Attendance Sheet Expected Working Hours

{{$attendance_sheet.expected_working_hours}}

The system calculates the total expected working hours for the employee, recorded in hours format.

Example:
The total expected working hours for an employee during September are 100 hours.

Attendance Sheet Actual Working Hours

{{$attendance_sheet.actual_working_hours}}

The system calculates the total actual working hours completed by the employee, shown in the attendance logs, recorded in hours format.

Example:
The total actual working hours completed by the employee during September are 90 hours out of 100 expected hours.

Shift Type

{{$shift.type}}

This variable is used only in attendance rule conditions or salary item conditions, not in the calculation formula (result of the condition). It checks whether the shift type is basic or advanced.

When the defined shift type in the condition matches the employee’s assigned shift (via attendance rules or via their contract), the calculation formula (result) is applied.

Example:
Condition:
Shift Type == Basic

Formula:

Basic (Component) Amount * .5

Shift Type-Key

{{$shift.type__key}}

This variable is used only in attendance rule conditions or salary item conditions, not in the calculation formula. It checks whether the shift type is basic or advanced.

When the defined shift type in the condition matches the employee’s assigned shift, the formula is applied.

Example:

Condition:
Shift Type (key) == standard

Formula:
Basic (Component) Amount * .5

Shift Name

{{$shift.name}}

This variable is used to check the name of the shift. It can be used in attendance rule or salary item conditions, but not in the calculation formula.

Example:

Shift Name == Morning Shift

Leave policy status

{{$leave_policy.status}}

This variable is used only in attendance rule or salary item conditions, not in the calculation formula. It checks whether the leave policy status is active or inactive.

When the defined status in the condition matches the employee’s assigned leave policy (through shift or contract), the formula is applied.

Example:

Condition:
Leave Policy Status == Active

Formula:
Basic (Component) Amount * .5

Leave policy status-key

{{$leave_policy.status__key}}

This variable is used only in attendance rule or salary item conditions, not in the calculation formula. It checks whether the leave policy is active or inactive.

When the defined status in the condition matches the employee’s assigned leave policy, the formula is applied.

Example:

Condition:
Leave Policy Status (key) == 1
or
Leave Policy Status (key) == 0

Formula:
Basic (Component) Amount * .5

Note:

This variable interacts with the database. Here, 1 = active policy and 0 = inactive policy.

Leave Policy Name

{{$leave_policy.name}}

This variable is used to check the name of the leave policy. It can be used in attendance rules or salary item conditions, but not in calculation formulas.

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

Attendance Day Status

{{$attendance_day.status}}

This variable is used only in attendance rule or salary item conditions, not in the calculation formula. It checks whether the attendance day status is present/absent / on leave.

When the defined status matches the employee’s attendance status, the formula is applied.

Example:

Condition:
Attendance Day Status == Absent

Formula:
Basic (Component) Amount * .5

Attendance Day Status key

{{$attendance_day.status__key}}

This variable is used only in attendance rule or salary item conditions, not in the calculation formula. It checks whether the attendance day status is present/absent / on leave.

And when the specified attendance condition in the rule matches the attendance status of the employee’s workday, whether assigned through the shift (if the condition is part of the attendance rules) or through the employee’s contract (if the condition is part of the salary item) the calculation formula (condition result) is applied.

Example:
Condition:

Attendance Day Status (key) == absent

Formula:
Basic (Component) Amount * 0.5

  • Note:
    This variable interacts with the system database. Therefore, statuses must be written exactly as in the database: present/absent / on leave, all in lowercase.

Attendance Day Calculation Type

{{$attendance_day.calculation_type}}

This variable is used only in attendance rule or salary item conditions, not in the calculation formula. It checks whether the attendance calculation type is manual or automatic.

And when the specified attendance account type in the condition matches the employee’s attendance account type, whether assigned through the shift (if the condition is part of the attendance rules) or through the employee’s contract (if the condition is part of the salary item) the calculation formula (condition result) is applied.

  • The attendance account type is assigned for each day individually, even in the attendance log exported for a time period such as a month.

Example:
Condition:
Attendance Day Calculation Type == Manual

Formula:
Basic (Component) Amount * 0.5

Attendance Day Calculation Type Key

{{$attendance_day.calculation_type__key}}

This variable is used only in attendance rule or salary item conditions, not in the calculation formula. It checks whether the attendance calculation type is manual or automatic.

And when the attendance account type specified in the condition matches the employee’s daily attendance account type, whether assigned through the shift (if the condition is part of the attendance rules) or through the employee’s contract (if the condition is part of the salary item) the calculation formula (condition result) is applied.

  • Each day has its own calculation type, even if the attendance sheet covers a longer period.

Example:
Condition:

Attendance Day Calculation Type Key == manual

Formula:

Basic (Component) Amount * 0.5

Note:
This differs from the previous variable as it interacts with the system database. Therefore, you must write the values exactly as in the database: manual/automatic, all in lowercase.

Attendance Day Attendance Delay

{{$attendance_day.attendance_delay}}

The system calculates the duration of delay after the scheduled shift start time.

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

Formula:
1

Attendance Day Early Leave

{{$attendance_day.early_leave}}

The system calculates the duration of leaving earlier than the scheduled shift end time.

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

Formula:
1

Total Leaves Taken

{{$attendance_sheet_leave_4.total_leave_taken}}

The number 4 represents the leave type ID. It is an automatically generated sequential number assigned to each leave type created in the system.

Note that the identifier number in your system may differ from the example (4).

The system calculates the total leaves taken during the current attendance sheet period for a specific leave type.

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

Formula:
Basic (Component) Amount * 0.10

Attendance Day Leave Count

{{$attendance_day.leave_count}}

The system calculates the number of leave days deducted from the leave balance for a leave day or period.
For example, one leave day may equal two days deducted, or partial attendance may result in only half a day being deducted.
If the system’s calculated deduction meets the condition, the “attendance flag” is triggered.

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

Formula:
1

Total Leaves Taken

{{$attendance_sheet_leave_4.total_leave_taken}}

The number 4 represents the leave type ID. It is an automatically generated sequential number assigned to each leave type created in the system.

Note that the identifier number in your system may differ from the example (4).

The system calculates the total leaves taken during the current attendance sheet period for a specific leave type.

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

Formula:
Basic (Component) Amount * 0.10

Total Leaves Taken Before

{{$attendance_sheet_leave_4.total_leave_taken_before}}

The number 4 represents the leave type ID. It is a system-generated sequential number assigned automatically to each leave type you create in the system.

Note that the ID number that appears on your system may differ from the ID number shown in the example (4).

The system calculates the total leaves taken before the current attendance sheet period for the specified leave type. If the condition is met, the formula is applied.

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

Formula:
Basic (Component) Amount * 0.10

Total Leaves After

{{$attendance_sheet_leave_4.total_leave_after}}

The number 4 represents the leave type ID. It is an automatically generated sequential number that the system assigns to each leave type you create.

Please note that the ID number displayed in your system may differ from the one shown in the example (4).

The system calculates the total leaves taken during the current attendance sheet period plus those taken before it, for the specified leave type.

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

Formula:
Basic (Component) Amount * 0.10

Leaves Credit Before

{{$attendance_sheet_leave_4.leaves_credit_before}}

The number 4 represents the leave type ID. It is an automatically generated sequential number assigned to each new leave type you add to the system.

Please note that the ID number displayed in your account may differ from the one used in the example (4).

The system calculates the total available leave balance for the employee from each leave type before accounting for the leaves recorded in the current attendance log (the one intended for payroll processing to apply the salary component).

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

Formula:
Basic (Component) Amount * 0.10

Leaves Credit After

{{$attendance_sheet_leave_4.leaves_credit_after}}

The number 4 represents the leave type ID. It is an auto-generated, sequential number assigned to each leave type you create in the system.

Note that the ID number displayed in your system will most likely differ from the ID number shown in this example (4).

The system calculates the total leave balance available for the employee from each leave type after accounting for the leaves recorded in the current attendance log (for which the payroll is being generated to apply the salary item).

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

Formula:
Basic (Component) Amount * 0.10