|
@@ -144,6 +144,31 @@ class GluSalaryCalculationService
|
|
|
return stripos((string)$jtbh, 'SG') !== false;
|
|
return stripos((string)$jtbh, 'SG') !== false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 判断是否皮壳机台(机台编号含 PK)
|
|
|
|
|
+ * @param string $jtbh
|
|
|
|
|
+ * @return bool
|
|
|
|
|
+ */
|
|
|
|
|
+ protected function isShellMachine($jtbh)
|
|
|
|
|
+ {
|
|
|
|
|
+ return stripos((string)$jtbh, 'PK') !== false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 皮壳机机长工资系数
|
|
|
|
|
+ * @param float $wage
|
|
|
|
|
+ * @param string $jtbh
|
|
|
|
|
+ * @param int $slotIndex 班组序号,1 为机长
|
|
|
|
|
+ * @return float
|
|
|
|
|
+ */
|
|
|
|
|
+ protected function applyShellCaptainWageBonus($wage, $jtbh, $slotIndex)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ((int)$slotIndex === 1 && $this->isShellMachine($jtbh)) {
|
|
|
|
|
+ return floatval(number_format((float)$wage * 1.1, 2, '.', ''));
|
|
|
|
|
+ }
|
|
|
|
|
+ return $wage;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 员工编号是否参与工资计算(仅纯数字编号)
|
|
* 员工编号是否参与工资计算(仅纯数字编号)
|
|
|
* @param mixed $bh
|
|
* @param mixed $bh
|
|
@@ -165,6 +190,7 @@ class GluSalaryCalculationService
|
|
|
{
|
|
{
|
|
|
$wageList = [];
|
|
$wageList = [];
|
|
|
$salary = (float)$report['产量'] * (float)$report['price'];
|
|
$salary = (float)$report['产量'] * (float)$report['price'];
|
|
|
|
|
+ $jtbh = $report['sczl_jtbh'] ?? '';
|
|
|
|
|
|
|
|
for ($i = 1; $i <= 30; $i++) {
|
|
for ($i = 1; $i <= 30; $i++) {
|
|
|
$bh = trim($classResult['bh' . $i] ?? '');
|
|
$bh = trim($classResult['bh' . $i] ?? '');
|
|
@@ -172,11 +198,14 @@ class GluSalaryCalculationService
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $wage = floatval(number_format($salary * (float)$classResult['rate' . $i], 2, '.', ''));
|
|
|
|
|
+ $wage = $this->applyShellCaptainWageBonus($wage, $jtbh, $i);
|
|
|
|
|
+
|
|
|
$wageList[] = [
|
|
$wageList[] = [
|
|
|
'bh' => $bh,
|
|
'bh' => $bh,
|
|
|
'name' => $classResult['员工姓名' . $i] ?? '',
|
|
'name' => $classResult['员工姓名' . $i] ?? '',
|
|
|
'rate' => $classResult['rate' . $i] ?? '',
|
|
'rate' => $classResult['rate' . $i] ?? '',
|
|
|
- 'wage' => floatval(number_format($salary * (float)$classResult['rate' . $i], 2, '.', '')),
|
|
|
|
|
|
|
+ 'wage' => $wage,
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -192,6 +221,7 @@ class GluSalaryCalculationService
|
|
|
protected function calculateManualPieceWages(array $report, array $classResult)
|
|
protected function calculateManualPieceWages(array $report, array $classResult)
|
|
|
{
|
|
{
|
|
|
$employees = [];
|
|
$employees = [];
|
|
|
|
|
+ $jtbh = $report['sczl_jtbh'] ?? '';
|
|
|
for ($i = 1; $i <= 30; $i++) {
|
|
for ($i = 1; $i <= 30; $i++) {
|
|
|
$bh = trim($classResult['bh' . $i] ?? '');
|
|
$bh = trim($classResult['bh' . $i] ?? '');
|
|
|
if (!$this->isValidEmployeeBh($bh)) {
|
|
if (!$this->isValidEmployeeBh($bh)) {
|
|
@@ -201,6 +231,7 @@ class GluSalaryCalculationService
|
|
|
'bh' => $bh,
|
|
'bh' => $bh,
|
|
|
'name' => $classResult['员工姓名' . $i] ?? '',
|
|
'name' => $classResult['员工姓名' . $i] ?? '',
|
|
|
'rate' => $classResult['rate' . $i] ?? '',
|
|
'rate' => $classResult['rate' . $i] ?? '',
|
|
|
|
|
+ 'slot' => $i,
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -251,11 +282,13 @@ class GluSalaryCalculationService
|
|
|
? max(0, ($totalOutput - $dailyQuota * $totalCount) * $unitPrice / $totalCount)
|
|
? max(0, ($totalOutput - $dailyQuota * $totalCount) * $unitPrice / $totalCount)
|
|
|
: 0;
|
|
: 0;
|
|
|
foreach ($employees as $employee) {
|
|
foreach ($employees as $employee) {
|
|
|
|
|
+ $wage = floatval(number_format($overPerPerson, 2, '.', ''));
|
|
|
|
|
+ $wage = $this->applyShellCaptainWageBonus($wage, $jtbh, $employee['slot']);
|
|
|
$wageList[] = [
|
|
$wageList[] = [
|
|
|
'bh' => $employee['bh'],
|
|
'bh' => $employee['bh'],
|
|
|
'name' => $employee['name'],
|
|
'name' => $employee['name'],
|
|
|
'rate' => $employee['rate'],
|
|
'rate' => $employee['rate'],
|
|
|
- 'wage' => floatval(number_format($overPerPerson, 2, '.', '')),
|
|
|
|
|
|
|
+ 'wage' => $wage,
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
return $wageList;
|
|
return $wageList;
|
|
@@ -284,7 +317,11 @@ class GluSalaryCalculationService
|
|
|
'bh' => $employee['bh'],
|
|
'bh' => $employee['bh'],
|
|
|
'name' => $employee['name'],
|
|
'name' => $employee['name'],
|
|
|
'rate' => $employee['rate'],
|
|
'rate' => $employee['rate'],
|
|
|
- 'wage' => floatval(number_format($wage, 2, '.', '')),
|
|
|
|
|
|
|
+ 'wage' => $this->applyShellCaptainWageBonus(
|
|
|
|
|
+ floatval(number_format($wage, 2, '.', '')),
|
|
|
|
|
+ $jtbh,
|
|
|
|
|
+ $employee['slot']
|
|
|
|
|
+ ),
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|