Browse Source

Fix project list

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

4
app/Http/Controllers/ProjectController.php

@ -245,7 +245,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 - $rootActivity->biaya_actual ?? 0;
$actualCost = $rootActivity->biaya_actual ?? 0;
$progress = $rootActivity->persentase_progress ?? 0;
@ -263,7 +263,7 @@ class ProjectController extends Controller
$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->plannedCost = $d->rencana_biaya;
$d->plannedCost = (int)$d->rencana_biaya;
$d->actualCost = $actualCost;
$d->lastActivity = $lastActivity ?? "-";
$d->costVariance = $costVariance;

Loading…
Cancel
Save