open-payroll
open-payroll copied to clipboard
Features
- [x] Multiple Earning and Deductions, based on organisation or employee
- [ ] Automated Payroll Calculation using Payroll Scheduler
- [ ] Each payroll will require at least a reviewer and an approver
- [ ] Customisable Payslip Design
- [ ] E-mail / Export the payslip to the employee
- [ ] Payroll Report for Administrator
- [ ] Payroll Report for Employee
- [x] Custom Earnings and Deductions
- [ ] Customisable earnings and deductions calculation process
Customisable earnings and deductions calculation process
For both earning and deduction by default will not need to use earning / deduction processor if the type of each earning / deduction did not exist - refer Line 50 and Line 60 in Payslip processor.
If we require to have separate calculation based on it's type - for example Leave Encashment (Earning), then you need to extend the \CleaniqueCoders\OpenPayroll\Processors\Earning\BaseEarningProcessor class, and implement the concrete implementation for getting the amount of Leave Encashment in calculate() method.
Below is an example of custom earning calculation.
<?php
namespace CleaniqueCoders\OpenPayroll\Processors\Earning;
class LeaveEncashmentProcessor extends BaseEarningProcessor
{
/**
* @todo Apply your logic here
* @return float Rate for the employee, if any.
*/
public function getRate()
{
// get the employee rate for leave encashment
}
/**
* @todo Apply your logic here
* @return int Days Entitled for Leave Encashment
*/
public function getEntitledLeaves()
{
// return amount of days entitled for leave encashement
}
public function calculate()
{
return $this->getEntitledLeaves() * $this->getRate();
}
}
To use this new processor, please ensured to add Leave Encashment as a new type of Earning.