|
|
@ -231,7 +231,7 @@ class ProjectController extends Controller |
|
|
|
$scheduleHealth = "on-track"; |
|
|
|
$scheduleHealth = "on-track"; |
|
|
|
$rootActivity = Activity::whereNull('parent_id')->where('proyek_id', $d->id)->orderBy('version_gantt_id', 'desc')->first(); |
|
|
|
$rootActivity = Activity::whereNull('parent_id')->where('proyek_id', $d->id)->orderBy('version_gantt_id', 'desc')->first(); |
|
|
|
if($rootActivity){ |
|
|
|
if($rootActivity){ |
|
|
|
$costVariance = $d->rencana_biaya - $rootActivity->biaya_actual; |
|
|
|
$costVariance = (int)$d->rencana_biaya - (int)$rootActivity->biaya_actual; |
|
|
|
$actualCost = $rootActivity->biaya_actual ?? 0; |
|
|
|
$actualCost = $rootActivity->biaya_actual ?? 0; |
|
|
|
$progress = $rootActivity->persentase_progress ?? 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'); |
|
|
|
$totalActualCost = $data->sum('actualCost'); |
|
|
|
$manpowers = User::count(); |
|
|
|
$manpowers = User::count(); |
|
|
|
$projectsOnDanger = Project::where('budget_health', 'danger')->count(); |
|
|
|
$projectsOnDanger = Project::where('budget_health', 'danger')->count(); |
|
|
|