|
|
@@ -359,14 +359,14 @@ class StatisticCommonService extends Service
|
|
|
"total_depreciation" => $total_depreciation,
|
|
|
];
|
|
|
$device_total_depreciation['total_hours'][$key] = round($total_min/60,2)*100;
|
|
|
- $device_total_depreciation['total_depreciation'][$key] = $total_depreciation*100;
|
|
|
+ $device_total_depreciation['total_depreciation'][$key] = $total_depreciation;
|
|
|
}
|
|
|
|
|
|
|
|
|
// B. 计算工资分摊:(项目工时 / 月总工时) * 月工资
|
|
|
if ($total_min > 0) {
|
|
|
- $ratio = round($item['total_work'] / $total_min, 3);
|
|
|
- $allocated_salary = round($ratio * $total_depreciation, 2);
|
|
|
+ $ratio = round((round($item['total_work']/60,2) / round($total_min/60,2)), 4);
|
|
|
+ $allocated_salary = round($ratio * $total_depreciation);
|
|
|
} else {
|
|
|
$ratio = 0;
|
|
|
$allocated_salary = 0;
|
|
|
@@ -404,18 +404,22 @@ class StatisticCommonService extends Service
|
|
|
if( !isset($sum[$k][$key])) $sum[$k][$key] = 0;
|
|
|
if (--$count[$k][$key] > 0) {
|
|
|
if($v['type'] == "hour") $current_hours = round($item[$v['key']] / 60, 2);
|
|
|
- elseif($v['type'] == "money") $current_hours = round($item[$v['key']] / 100, 2);
|
|
|
+ elseif($v['type'] == "money") {
|
|
|
+ $current_hours = round($item[$v['key']] / 100, 2);
|
|
|
+ }
|
|
|
else $current_hours = $item[$v['key']];
|
|
|
+
|
|
|
if($v['type'] == "100b") {
|
|
|
$sum[$k][$key] -= $current_hours ;
|
|
|
$item[$v['value']] = $current_hours/100;
|
|
|
}
|
|
|
else{
|
|
|
- $sum[$k][$key] -= $current_hours * 100;
|
|
|
+ $sum[$k][$key] -= ($current_hours * 100);
|
|
|
$item[$v['value']] = $current_hours;
|
|
|
}
|
|
|
} else {
|
|
|
if($v['type'] == "day") $item[$v['value']] = $sum[$k][$key];
|
|
|
+ if($v['type'] == "ratio") $item[$v['value']] =round($sum[$k][$key] / 100, 4);
|
|
|
else $item[$v['value']] = round($sum[$k][$key] / 100, 2);
|
|
|
}
|
|
|
|