-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
241 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
- { joinDate: 'date:17-03-2017', employeeStatus: 'p', contract: 'ref:contract#emp1', company: 'ref:company#ssi', department: 'ref:department#itmis', jobLevel: 'ref:job_level#stf', jobTitle: 'ref:job_title#stfit', code: 'MIS000001', fullName: 'Muhamad Surya Iksanudin', gender: 'm', , regionOfBirth: 'ref:region#dki', cityOfBirth: 'ref:city#jakut', dateOfBirth: 'date:01-01-1987', identityNumber: '331012321', identityType: 'k', maritalStatus: 'm', email: 'admin@ssi.com', taxGroup: 'k2', haveOvertimeBenefit: true } | ||
- { joinDate: 'date:17-03-2017', employeeStatus: 'p', contract: 'ref:contract#emp1', company: 'ref:company#ssi', department: 'ref:department#itmis', jobLevel: 'ref:job_level#stf', jobTitle: 'ref:job_title#stfit', code: 'MIS000001', fullName: 'Muhamad Surya Iksanudin', gender: 'm', , regionOfBirth: 'ref:region#dki', cityOfBirth: 'ref:city#jakut', dateOfBirth: 'date:01-01-1987', identityNumber: '331012321', identityType: 'k', maritalStatus: 'm', email: 'admin@ssi.com', taxGroup: 'k2', haveOvertimeBenefit: true, riskRatio: 'vlr' } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace KejawenLab\Application\SemartHris\Component\Employee; | ||
|
||
/** | ||
* @author Muhamad Surya Iksanudin <surya.iksanudin@kejawenlab.com> | ||
*/ | ||
class RiskRatio | ||
{ | ||
const RISK_VERY_HIGH = 'vhr'; | ||
const RISK_HIGH = 'hr'; | ||
const RISK_NORMAL = 'nr'; | ||
const RISK_LOW = 'lr'; | ||
const RISK_VERY_LOW = 'vlr'; | ||
|
||
const RISK_VERY_HIGH_VALUE = 0.0174; | ||
const RISK_HIGH_VALUE = 0.0127; | ||
const RISK_NORMAL_VALUE = 0.0089; | ||
const RISK_LOW_VALUE = 0.0054; | ||
const RISK_VERY_LOW_VALUE = 0.0024; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace KejawenLab\Application\SemartHris\Component\Employee\Service; | ||
|
||
use KejawenLab\Application\SemartHris\Component\Employee\RiskRatio; | ||
|
||
/** | ||
* @author Muhamad Surya Iksanudin <surya.iksanudin@kejawenlab.com> | ||
*/ | ||
class RiskRatioConverter | ||
{ | ||
/** | ||
* @param string $riskRatioCode | ||
* | ||
* @return float | ||
*/ | ||
public static function getValue(string $riskRatioCode): float | ||
{ | ||
$map = [ | ||
RiskRatio::RISK_VERY_LOW => RiskRatio::RISK_VERY_LOW_VALUE, | ||
RiskRatio::RISK_LOW => RiskRatio::RISK_LOW_VALUE, | ||
RiskRatio::RISK_NORMAL => RiskRatio::RISK_NORMAL_VALUE, | ||
RiskRatio::RISK_HIGH => RiskRatio::RISK_HIGH_VALUE, | ||
RiskRatio::RISK_VERY_HIGH => RiskRatio::RISK_VERY_HIGH_VALUE, | ||
]; | ||
|
||
if (!in_array($riskRatioCode, $map)) { | ||
return RiskRatio::RISK_VERY_LOW_VALUE; | ||
} | ||
|
||
return $map[$riskRatioCode]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace KejawenLab\Application\SemartHris\Component\Salary\Processor; | ||
|
||
use KejawenLab\Application\SemartHris\Component\Employee\Model\EmployeeInterface; | ||
use KejawenLab\Application\SemartHris\Component\Employee\Service\RiskRatioConverter; | ||
use KejawenLab\Application\SemartHris\Component\Salary\Model\PayrollInterface; | ||
|
||
/** | ||
* @author Muhamad Surya Iksanudin <surya.iksanudin@kejawenlab.com> | ||
*/ | ||
class BpjsProcessor implements SalaryProcessorInterface | ||
{ | ||
/** | ||
* @param PayrollInterface $payroll | ||
* @param EmployeeInterface $employee | ||
* @param \DateTimeInterface $date | ||
* @param float $fixedSalary | ||
* | ||
* @return float | ||
*/ | ||
public function process(PayrollInterface $payroll, EmployeeInterface $employee, \DateTimeInterface $date, float $fixedSalary): float | ||
{ | ||
$riskRatioValue = RiskRatioConverter::getValue($employee->getRiskRatio()); | ||
|
||
return $fixedSalary; | ||
} | ||
|
||
/** | ||
* @param float $riskRatioValue | ||
* @param float $fixedSalary | ||
*/ | ||
private function processJkk(float $riskRatioValue, float $fixedSalary): void | ||
{ | ||
} | ||
|
||
/** | ||
* @param float $riskRatioValue | ||
* @param float $fixedSalary | ||
*/ | ||
private function processJkm(float $riskRatioValue, float $fixedSalary): void | ||
{ | ||
} | ||
|
||
/** | ||
* @param float $riskRatioValue | ||
* @param float $fixedSalary | ||
*/ | ||
private function processJp(float $riskRatioValue, float $fixedSalary): void | ||
{ | ||
} | ||
|
||
/** | ||
* @param float $riskRatioValue | ||
* @param float $fixedSalary | ||
*/ | ||
private function processJht(float $riskRatioValue, float $fixedSalary): void | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace KejawenLab\Application\SemartHris\Component\Salary\Processor; | ||
|
||
use KejawenLab\Application\SemartHris\Component\Employee\Model\EmployeeInterface; | ||
use KejawenLab\Application\SemartHris\Component\Salary\Model\PayrollInterface; | ||
|
||
/** | ||
* @author Muhamad Surya Iksanudin <surya.iksanudin@kejawenlab.com> | ||
*/ | ||
class OvertimeProcessor implements SalaryProcessorInterface | ||
{ | ||
/** | ||
* @param PayrollInterface $payroll | ||
* @param EmployeeInterface $employee | ||
* @param \DateTimeInterface $date | ||
* @param float $fixedSalary | ||
* | ||
* @return float | ||
*/ | ||
public function process(PayrollInterface $payroll, EmployeeInterface $employee, \DateTimeInterface $date, float $fixedSalary): float | ||
{ | ||
return $fixedSalary; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Component/Salary/Processor/SalaryProcessorInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace KejawenLab\Application\SemartHris\Component\Salary\Processor; | ||
|
||
use KejawenLab\Application\SemartHris\Component\Employee\Model\EmployeeInterface; | ||
use KejawenLab\Application\SemartHris\Component\Salary\Model\PayrollInterface; | ||
|
||
/** | ||
* @author Muhamad Surya Iksanudin <surya.iksanudin@kejawenlab.com> | ||
*/ | ||
interface SalaryProcessorInterface | ||
{ | ||
/** | ||
* @param PayrollInterface $payroll | ||
* @param EmployeeInterface $employee | ||
* @param \DateTimeInterface $date | ||
* @param float $fixedSalary | ||
* | ||
* @return float | ||
*/ | ||
public function process(PayrollInterface $payroll, EmployeeInterface $employee, \DateTimeInterface $date, float $fixedSalary): float; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.