Browse Source

Fix actual progress calculation

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

3
app/Helpers/MasterFunctionsHelper.php

@ -212,6 +212,7 @@ class MasterFunctionsHelper {
->where('activity_id', '=', $keyActualM->activity_id) ->where('activity_id', '=', $keyActualM->activity_id)
->groupBy('activity_id') ->groupBy('activity_id')
->first(); ->first();
$reportCount = DB::table('report_activity_material')->where('activity_id', '=', $keyActualM->activity_id)->count();
$dataTempReport [$w]['activity_id'] = $keyActualM->activity_id; $dataTempReport [$w]['activity_id'] = $keyActualM->activity_id;
$dataTempReport [$w]['qty'] = $keyActualM->qty; $dataTempReport [$w]['qty'] = $keyActualM->qty;
$dataTempReport [$w]['report_date'] = $keyActualM->report_date; $dataTempReport [$w]['report_date'] = $keyActualM->report_date;
@ -231,7 +232,7 @@ class MasterFunctionsHelper {
// $sumPercentageActual+=($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'){ if($checkStatusActivity->status_activity == 'done'){
$sumPercentageActual+=$keyActualM->bobot_planning; $sumPercentageActual+=$keyActualM->bobot_planning/$reportCount;
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; // $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual;
}else{ }else{
if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){ if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){

Loading…
Cancel
Save