Skip to main content
All CollectionsPayrollAdvanced Settings
How to value the data of schedule and attendance in payroll calculation formula setting?
How to value the data of schedule and attendance in payroll calculation formula setting?

Some companies pay the same employee different salaries for different shifts, so how does Workstem manage to pay such employees?

Workstem CS avatar
Written by Workstem CS
Updated over a week ago

Workstem provides several functions to value schedule time, which is used to calculate salaries. The system provides the following functions:

CountRosterByDay(type)

GetRosterByTime(StartTime ,Endtime)

GetRosterByLocation(location1, location2)

GetRosterByProject(project1, project, project,……)

The following is a detailed description of the function:

Step 1

[Payroll] > [Settings] > [Pay Items] > [Settings].

Step 2

Click [Settings], go to [Pay Items], find the corresponding item that needs to set the formula, click [Formula], or add new item to formula setup step, and go to [Pay Items] formula setting interface.

Step 3

1. Count days by shift type, and click "Functions" to find

CountRosterByDay(type). Then view the relevant description and example of this function.

Note: [Parameter description]

Type: When the value is Working, the number of working days within the payroll period is returned; When the value is rest, return the number of scheduled Rest days; When it is SH, return the number of statutory holidays on schedule; When the value is empty, the number of days on schedule is returned;

Example:
// Return the number of working days within the payroll period

CountRosterByDay('Working');

// Return the number of scheduled Rest days

CountRosterByDay('Rest');

// Return the number of statutory holidays on schedule

CountRosterByDay('SH')

// Return the number of days on schedule

CountRosterByDay()

2. Based on the attendance period corresponding to the current salary period, return the employee's schedule time, and click "Functions" to find GetRosterByTime(StartTime, Endtime). Then view the relevant description and example for this function.

Note: [Parameter description]

StartTime: Start time

EndTime: End time

Example:

GetrosterByTime('09:00', '17:00')

2024-07-01—2024-07-01 Roster 09:00 —12:00 180 min

2024-07-02—2024-07-02 Roster 14:00 —18:00 180 min

2024-07-03—2024-07-03 Roster 17:00 —20:00 0 min

A total of 360 min is returned.

3. Based on the attendance period corresponding to the current salary period, return the schedule time of designated locations, and click "Functions" to find GetRosterByLocation(location1, location2). Then view the relevant description and example of this function.

Note: [Parameter description]

Location: The name of office clock-in/out place. If more than one location exists, separate them sequentially by commas.

Example:

GetrosterByLocation(' Shanghai, Shenzhen, Changsha ')

2024-07-01—2024-07-01 Roster 09:00 —12:00 location:Shanghai

2024-07-02—2024-07-02 Roster 14:00 —18:00 location:Shenzhen

2024-07-03—2024-07-03 Roster 17:00 —20:00 location:Changsha

A total of 420 min is returned.

4. Based on the attendance period corresponding to the current salary period, return the schedule time of designated projects, and click "Functions" to find GetRosterByProject(project1, project, project,……). Then view the relevant description and example of this function.

Note: [Parameter description]

Project: The name of schedule project, If more than one location exists, separate them sequentially by commas.

Example:

GetRosterByProject('Dance, Bike, Fight')

2024-07-01 — 2024-07-01 Roster 09:00 — 12:00 Location: Dance

2024-07-02 — 2024-07-02 Roster 14:00 — 18:00 Location: Bike

2024-07-03 — 2024-07-03 Roster 17:00 — 20:00 Location: Fight

A total of 180 min is returned.

Did this answer your question?