Browse Source

Task #860q2d6rx fix bug

pull/3/head
Wahyu Ramadhan 2 years ago
parent
commit
a505b92e1e
  1. 4
      app/Http/Controllers/ProjectController.php

4
app/Http/Controllers/ProjectController.php

@ -231,7 +231,7 @@ class ProjectController extends Controller
$scheduleHealth = "on-track";
$rootActivity = Activity::whereNull('parent_id')->where('proyek_id', $d->id)->orderBy('version_gantt_id', 'desc')->first();
if($rootActivity){
$costVariance = $d->rencana_biaya - $rootActivity->biaya_actual;
$costVariance = (int)$d->rencana_biaya - (int)$rootActivity->biaya_actual;
$actualCost = $rootActivity->biaya_actual ?? 0;
$progress = $rootActivity->persentase_progress ?? 0;
@ -271,7 +271,7 @@ class ProjectController extends Controller
}
}
$totalPlannedCost = $data->sum('plannedCost');
$totalPlannedCost = array_sum(array_map('intval', array_column($data->toArray(), 'plannedCost')));
$totalActualCost = $data->sum('actualCost');
$manpowers = User::count();
$projectsOnDanger = Project::where('budget_health', 'danger')->count();

Loading…
Cancel
Save