HRMates uses calculators to build customer specific logic. Some examples are Attendance Late minutes calculator, Payroll component Calculator, Condition Calculator for Approval Process.

Calulator is evaluated against Reference Employee and Reference Date. How the employee and date are mapped are mentioned in help of calculator entry box. For example {employment.Location} will be replaced by Name of Location of Reference Employee on Reference Date.

Calculators are editable only for trained individuals, others can view the calculator logic and ask support team to make any changes required.

Calculators are SQL Expressions Tutorial

Condition expression should evaluate to true or false. Numeric expression should evaluate to a number

Expressions use variables, which are selected from Calculator Variable dropdown. You can search for variables by typing any part of name.

You can use following functions in the calculator

Date Time https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html
Number https://dev.mysql.com/doc/refman/8.0/en/non-typed-operators.html
Logical https://dev.mysql.com/doc/refman/8.0/en/logical-operators.html
Rounddown(hours, minutes) Round down hours in slab of minutes, e.g Rounddown(1.6,30) = 1.5, Rounddown(1.5,30) = 1.5

Checking Calculation

Value of variables used in the calculator can be seen with icon

Calculator Examples

Module Name Description Calculator Calculation View
Attendance Total Intime Calculator

If Holiday then Time between InTime and OutTime

else intersection of Shift Time and InTime

case when Holiday<>0
then
Round(Greatest((TIMESTAMPDIFF(second,{attendance.InTime},{attendance.OutTime}))/3600,0),2)
else
Round(Greatest((TIMESTAMPDIFF(second,Greatest({attendance.ShiftStartTime},{attendance.InTime}),least({attendance.ShiftEndTime},{attendance.OutTime})))/3600,0),2)
end
Salary Leave Encashment
Prorate Basic by Leave Encashment days {days.Leave Encashment Days} * {ctc.Basic} / 30 6.00 * 6832.00 / 30
Salary Notice Pay Recovery Prorate Basic by Shortfall  days {FullAndFinal.ShortfallDays} * {ctc.Basic} / 30  

Calculator with Variable Selection