Browse Source

bugfix

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
dc816444d3
  1. 6
      app/Http/Controllers/DashboardBoDController.php

6
app/Http/Controllers/DashboardBoDController.php

@ -326,8 +326,8 @@ class DashboardBoDController extends Controller
if(!$alreadyHasReport) if(!$alreadyHasReport)
continue; continue;
/* $minDate = Activity::where('version_gantt_id', $keyGantt['last_gantt_id'])->min("planned_start"); */ $minDate = Activity::where('version_gantt_id', $keyGantt['last_gantt_id'])->min("start_date");
$minDate = Activity::where('version_gantt_id', $keyGantt['last_gantt_id'])->whereNull('parent_id')->pluck('start_date')->first(); /* $minDate = Activity::where('version_gantt_id', $keyGantt['last_gantt_id'])->whereNull('parent_id')->pluck('start_date')->first(); */
$begin = new \DateTime($minDate.' Monday'); $begin = new \DateTime($minDate.' Monday');
$maxDate = DB::table('assign_material_to_activity as ama') $maxDate = DB::table('assign_material_to_activity as ama')
@ -386,7 +386,7 @@ class DashboardBoDController extends Controller
->groupBy('activity_id') ->groupBy('activity_id')
->first(); ->first();
try { try {
$sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan ?? 0)*$keyActualM->bobot_planning; $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning;
} catch (\DivisionByZeroError $e) { } catch (\DivisionByZeroError $e) {
return response()->json(['message' => $e->getMessage()]); return response()->json(['message' => $e->getMessage()]);
} }

Loading…
Cancel
Save