Long Service Payment
Step 1 Terminate the employee in the system
Step 2 Customize user field
Go to [Settings] > [Configuration management] > [Customize user field], add a new field, it can be LSP/SP.
Step 3 Dictionary
In [Settings] > [Configuration management] > [Data Dictionary] create new dictionary "LSP/SP" which having two items (LSP & SP). Then, back to the [Customize user field] select the new created dictionary and those data will be shown in the [Staff Information].
Step 4 Create a new pay item - Long Service Payment
Formula- Long Service Payment
var vEntryDay = GetEmployeeInfo('entryDate');
var vLastDay = GetEmployeeInfo('lastWorkingDate');
var vServiceYear = round((DateDiff(DAY,vEntryDay,vLastDay) + 1) / 365,2,) ;
var vLastMonthSalary = PayItemMthlySome('ADWIncomeCurrentMonth',1,1);
var vAvg12Salary = PayitemMthlyTotal ('ADWIncomeCurrentMonth', 12, 0) / 12;
var vType = GetEmployeeInfo('LSP/SP');
var vBaseSalary = 0;
if(vServiceYear >= 5 && vAvg12Salary >= vLastMonthSalary && vType != 'SP' ){
if ( vAvg12Salary >= 22500 ) {
vBaseSalary = 22500
}
else {
vBaseSalary = vAvg12Salary
}
}else if(vServiceYear >= 5 && vAvg12Salary < vLastMonthSalary && vType != 'SP'){
if ( vLastMonthSalary >= 22500 ) {
vBaseSalary = 22500
}
else {
vBaseSalary = vLastMonthSalary
}
}else{
vBaseSalary = 0;
}
value = vBaseSalary / 3 * 2 * vServiceYear
Payment in Lieu of Notice
Step 1 Customize user field
Go to [Settings] > [Configuration management] > [Customize user field], add two new fields: [Notice Type](text) & [Short Notice Last Date](date)
Step 2 Dictionary
In [Data Dictionary] create new dictionary "Notice Type" which having two items (ER & EE). Back to [Customize user field], add the "Notice Type" dictionary to the new-customize user field "Notice Type", which those data will be shown in the [Staff Information].
Step 3 Create new pay item
In [Payroll] > [Settings] > [Pay Items] create two pay items: for the employer, it should be income; for the employee, it should be deduction.
Formula- payment in lieu of notice
1. Employer
var a = GetEmployeeInfo('ShortNoticeLastDate')
var b = GetEmployeeInfo('lastWorkingDate')
var c = DateDiff(DAY,b ,a ,)
var d = GetEmployeeInfo('NoticeType')
if ( d == 'ER' ) {
value = AverageDailyRate * c
}
else {
value = 0
}
2. Employee
var a = GetEmployeeInfo('ShortNoticeLastDate')
var b = GetEmployeeInfo('lastWorkingDate')
var c = DateDiff(DAY,b ,a ,)
var d = GetEmployeeInfo('NoticeType')
if ( d == 'EE' ) {
value = AverageDailyRate * c
}
else {
value = 0
}