|
|
@ -245,7 +245,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 - $rootActivity->biaya_actual ?? 0; |
|
|
|
$actualCost = $rootActivity->biaya_actual ?? 0; |
|
|
|
$actualCost = $rootActivity->biaya_actual ?? 0; |
|
|
|
$progress = $rootActivity->persentase_progress ?? 0; |
|
|
|
$progress = $rootActivity->persentase_progress ?? 0; |
|
|
|
|
|
|
|
|
|
|
@ -263,7 +263,7 @@ class ProjectController extends Controller |
|
|
|
$lastActivity = date("d/m/Y", strtotime($rootActivity->end_date)); |
|
|
|
$lastActivity = date("d/m/Y", strtotime($rootActivity->end_date)); |
|
|
|
} |
|
|
|
} |
|
|
|
$d->plannedInterval = date("d/m/Y", strtotime($d->mulai_proyek)) . " - " . date("d/m/Y", strtotime($d->akhir_proyek)); |
|
|
|
$d->plannedInterval = date("d/m/Y", strtotime($d->mulai_proyek)) . " - " . date("d/m/Y", strtotime($d->akhir_proyek)); |
|
|
|
$d->plannedCost = $d->rencana_biaya; |
|
|
|
$d->plannedCost = (int)$d->rencana_biaya; |
|
|
|
$d->actualCost = $actualCost; |
|
|
|
$d->actualCost = $actualCost; |
|
|
|
$d->lastActivity = $lastActivity ?? "-"; |
|
|
|
$d->lastActivity = $lastActivity ?? "-"; |
|
|
|
$d->costVariance = $costVariance; |
|
|
|
$d->costVariance = $costVariance; |
|
|
|