Payroll
In this article you will learn how to add transactions to payroll in Unimicro Platform. Before we get started, you should read Getting started.
Create transactions on new Payroll
How to create Payroll
Here we have an example for creating a payroll for April, with payout date on 25th of April.
Endpoint : [ POST : api/biz/payrollrun
]
Request:
{
"PayDate": "2020-04-25",
"FromDate": "2020-04-01T00:00:00.000Z",
"ToDate": "2020-04-30T00:00:00.000Z",
"Description": "April",
"taxdrawfactor": 1,
"FreeText": "this is ur monthly salary ",
"HolidayPayDeduction": true,
"ID": 0
}
Adding transactions On Payroll
Then we can create a SalaryTransaction object and add that into PayrollRun as a transaction list
as you can see in the example bellow
❗ Important : _createguid is mandatory field. As best practice you can use GUID.
transaction :
{
"ID" :" 0",
"PayrollRunID" :"10",
"EmployeeID" :"<EmployeeID>",
"WageTypeNumber" :"<WageTypeNumber>",
"Amount" :"",
"Rate" :"",
"Text" :"",
"FromDate": "2020-04-01T00:00:00Z",
"ToDate": "2020-04-30T00:00:00Z",
"Account" :"",
"DimensionsID" :"",
"EmploymentID" :"",
"EmployeeNumber" :"",
"Dimensions" :"",
"_createguid" :"NEW_GUID"
}
Payroll object with transaction :
{
"ID": "",
"FromDate ": "",
"ToDate ": "",
"PayDate ": "",
"transactions ": [
{
"ID": " 0",
"PayrollRunID": "10",
"EmployeeID": "<EmployeeID>",
"WageTypeNumber": "<WageTypeNumber>",
"Amount": "",
"Rate": "",
"Text": "",
"FromDate": "2020-04-01T00:00:00Z",
"ToDate": "2020-04-30T00:00:00Z",
"Account": "",
"DimensionsID": "",
"EmploymentID": "",
"EmployeeNumber": "",
"Dimensions": "",
"_createguid": "NEW_GUID"
}
],
"Description ": "",
"StatusCode ": "payRoll.StatusCode"
}
Endpoint : [ POST : [api/biz/payrollrun/{payroll-id}]
]
How to calculate rate on Salary Transaction:
Calculation on rate is based on three values
- Initial rate value
- wage type (GetRateFrom, RateFactor)
- Hour rate
Hour rate can be retrieved from Employment ,
So the calculation looks like this:
if (wageType.GetRateFrom == 2 (Timelønn)) and wageType.RateFactor > 0
Rate = (((wageType.RateFactor / 100)) * hourRate)
Else
Rate = wageType.Rate
Create transactions on existing Payroll
SalaryTransactions can only be added to existing Payrolls, if the status is Created Process is otherwise the same as explained in the above topics
Payroll statuses :
Created = 0,
Calculated = 1,
Approved = 2,
Remitted = 3,
Paid = 4,
Recorded = 5
Some default values in Payroll
TaxDrawFactor usually have Standard as value, except in December when it’s “half taxes”.
Tax Draw Factors | Values |
---|---|
Standard | 1 |
Half | 2 |
None | 3 |
HolidayPayDeduction usually HolidayPayDeduction is set to false, except in June when companies do vacation payouts.