Browse Source

Merge branch 'staging' of https://git.oslog.id/ordo/adw-backend into dev-wahyu

pull/3/head
Wahyu Ramadhan 2 years ago
parent
commit
6443afe3af
  1. 35
      app/Helpers/MasterFunctionsHelper.php

35
app/Helpers/MasterFunctionsHelper.php

@ -223,17 +223,27 @@ class MasterFunctionsHelper {
->first();
$dataTempReport [$w]['percentage'] = ($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning;
// $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning;
if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){
// if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){
if($checkStatusActivity->status_activity == 'done'){
$sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning;
$sumPercentageActual+=$keyActualM->bobot_planning;
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual;
}else{
if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){
$sumPercentageActual+=(($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning)*(95/100);
}
// }else if($checkStatusActivity->status_activity == 'done'){
// $sumPercentageActual+=0;
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual;
}else{
$sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning;
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual;
}
}
// }else {
// if($checkStatusActivity->status_activity == 'done'){
// $sumPercentageActual+=($keyActualM->qty/$keyActualM->qty)*$keyActualM->bobot_planning;
// }else{
// $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning;
// }
// }
$totalACWP += $keyActualM->biaya_actual/$keyActualM->duration;
} catch (\DivisionByZeroError $e) {
@ -254,12 +264,19 @@ class MasterFunctionsHelper {
$tempTtlPercentPlan+= $sumPercentagePlan;
$tempTtlPercentActual+= $sumPercentageActual;
if($tempTtlPercentPlan >= 100 || $tempTtlPercentActual >= 100){
if($tempTtlPercentActual >= 100)
$tempTtlPercentActual = 100;
// if($tempTtlPercentPlan >= 100 || $tempTtlPercentActual >= $keyGantt['progress'];){
// if($tempTtlPercentActual >= 100)
// $tempTtlPercentActual = 100;
// if($tempTtlPercentPlan >= 100)
// $tempTtlPercentPlan = 100;
if($tempTtlPercentActual >= $keyGantt['progress'])
$tempTtlPercentActual = $keyGantt['progress'];
if($tempTtlPercentPlan >= 100)
$tempTtlPercentPlan = 100;
}
// $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual
// }
$currentACWP += $totalACWP;
$currentBCWP += $totalBCWP;

Loading…
Cancel
Save