Salary Process Calculation Using RPA

#1
“If you are lucky enough to be someone’s employer, then you have moral obligation to make sure people do look forward to coming to work in the morning”.
-John Mackey
Any organization is defined by their values and employee.
Employees are the greatest asset of any organization. So Employee must make sure that their employees are paid to what they deserve.
Payment mistakes can happen faster than you think. For a moment think about the employees for whom monthly salary is the only source of income. Imagine what if the salary is not paid accurately or there is a delay in releasing salary. Such irregularities can take a toll on the morale of the employees and ultimately effect the business productivity.
If we use Robotic Process Automation(RPA) for this we can achieve this without human error and also RPA bots are pretty fast when compare to Human and can do the work within no time and also return high ROI.

Payroll process is not so easy and it involves a lot of steps.
1.Collecting employee information
2. Calculate deduction
3.Caculate increment

In this article we will see how can we perform the entire salary processing using RPA.

We will perform this using data present in excel file and using RPA to process the salary.
Consider we have an excel file with 3 sheets.
1.Employee Details
2.Leaves
3.Increment

Employee Details sheet:
View attachment 1598515256216.png


Leaves Sheet:
View attachment 1598515282898.png


Increment Sheet:
View attachment 1598515307855.png


Read the excel sheets and store it in DataTable:
We will start UiPath Studio and drag flowchart is the working panel.
Drag one sequence and attach it with flowchart. Inside this sequence we will read data from the excel file and store it in dataTable.
E.g. DT1,DT2 and DT3 respectively.
Drag 3 readRange activity under work workbook and assign each sheet of the excel with it

Calculate the deduction from the deduction sheet and add corresponding value to the employee Sheet :
Drag one more sequence and name it as calculate deduction and add annotation to it.
Drag one for each row activity and assign it to DT1
Drag one assign activity and assign it the value of empID ‘here empID is variable of String type
E.g. EmpID = row(“Emp ID”).toString
Drag one more for each row activity and assign it to DT2
Drag one IF activity and check for condition
leavesID(“Emp ID”).ToString = empId ‘here leavesID is used in place of row

Inside Then block of IF activity drag one Assign activity
Increment the leaves count for every empID that matches
E.g. leavesCount = leavesCount +1 ‘here leaves count is a variable of Int32 type

Outside Leaves for each activity
Drag one more assign activity and assign it he values of calculated deduction
Formula for calculating deduction:
(BaseSalary/No of days in month) * No of leaves
calculatedLeaves = cint((cint(Id(“Base Salary”))/31)*leavesValue) ‘here calculatedLeaves is a variable of Int32 type

We will calculate one more variable RowCount which will write the calculatedLeaves to the assigned row.
To be on safer side we will also check the rows in which we are writing the value does not exceed the row present in the sheet.
For this we will drag one more If activity and check
Rowcount <EmpDT.Rows.Count
In Then block of the IF activity we write the calculatedLeaves to the dedicated column
EmpDT.Rows(Rowcount)(4) = calculatedLeaves ‘ 4 is the column number in which we are writing

Drag 2 more assign Activity
Increment rowCount value and
Initialize the leavesCount to 0
Drag one write range activity outside for each row and write the DT1 to it

Over all workflow
View attachment 1598515390484.png


After executing the workflow

View attachment 1598515432402.png


Calculate the increment from the increment sheet and add corresponding value to the employee Sheet :
Drag one more sequence and name it as calculate increment and add annotation to it.
Drag one for each row activity and assign it to DT1
Drag one assign activity and assign it the value of empID ‘here empID is variable of String type
E.g. EmpID = row(“Emp ID”).toString

Drag one more for each row activity and assign it to DT3
Drag one IF activity and check for condition
incrementID(“Emp ID”).ToString = empId ‘here incrementID is used in place of row
Inside Then Block IF Activity
Drag one assign activity
incrementAmount = cint(IncreID(1))+incrementAmount ‘here incrementAmount is a variable

We will calculate one more variable RowCount which will write the incrementAmount to the assigned row.
To be on safer side we will also check the rows in which we are writing the value does not exceed the row present in the sheet.
For this we will drag one more IF activity and check
Rowcount <EmpDT.Rows.Count
In Then block of the IF activity we write the incrementAmount to the dedicated column
EmpDT.Rows(Rowcount)(5)= incrementAmount ‘ 5 is the column number in which we are writing

Drag 2 more assign Activity
Increment rowCount value and
Initialize the leavesCount to 0
Drag one write range activity outside for each row and write the DT1 to it.

Overall workflow
View attachment 1598515473348.png


Output after executing the workflow:

View attachment 1598515694950.png


Calculate the Calculate the netSalary and update it in the respective column:
Drag one more sequence and name it as calculate increment and add annotation to it.
Drag one for each row activity and assign it to DT1
Drag two assign activity and assign it the value of netSalary ‘here netSalary is variable of int32 type
netSalary = cint(cint(row(“Base Salary”))+cint(row(“Leave Deductions”)))
EmpDT.Rows(Rowcount)(6) = netSalary ‘6 is column number and rowCount is int32 type

Drag one write range activity and assign DT1 to it

Over all workflow
View attachment 1598515763820.png


After executing the workflow the output is

View attachment 1598515793942.png


The Overall workflow is
View attachment 1598515818361.png


If we run the above workflow we can calculate the netSalary of the employee within few seconds.
This is how RPA can be use to calculate and process the salary and can be emailed as per required.
We will also update all the details in the database using UiPath.
Which we will see in our next article.
For any query please leave a comment here.

Happy Automation :)
 
Top