|
|
|
@ -110,12 +110,15 @@ class HierarchyFtthController extends Controller
|
|
|
|
|
if($ftthIds){ |
|
|
|
|
foreach ($ftthIds as $ftthId) { |
|
|
|
|
$gantts = VersionGantt::where('hierarchy_ftth_id', $ftthId->hierarchy_ftth_id)->sum('progress'); |
|
|
|
|
$bobot_planning = VersionGantt::where('hierarchy_ftth_id', $ftthId->hierarchy_ftth_id)->sum('bobot'); |
|
|
|
|
$ganttCount = VersionGantt::where('hierarchy_ftth_id', $ftthId->hierarchy_ftth_id)->count(); |
|
|
|
|
|
|
|
|
|
$ftth = HierarchyFtth::find($ftthId->hierarchy_ftth_id); |
|
|
|
|
if($ftth){ |
|
|
|
|
$round = $gantts/$ganttCount; |
|
|
|
|
$round_bobot = $bobot_planning/$ganttCount; |
|
|
|
|
$ftth->progress = round($round, 2); |
|
|
|
|
$ftth->bobot_planning = round($round_bobot, 2); |
|
|
|
|
try { |
|
|
|
|
$ftth->save(); |
|
|
|
|
} catch (\Exception $e) { |
|
|
|
@ -189,6 +192,7 @@ class HierarchyFtthController extends Controller
|
|
|
|
|
foreach ($progress as $p) { |
|
|
|
|
if ($p->id == $gantt->id) { |
|
|
|
|
$gantt->progress = $p->persentase_progress; |
|
|
|
|
$gantt->bobot_planning = $p->bobot_planning ? $p->bobot_planning : 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -216,6 +220,7 @@ class HierarchyFtthController extends Controller
|
|
|
|
|
foreach ($progress as $p) { |
|
|
|
|
if ($p->id == $gantt->id) { |
|
|
|
|
$gantt->progress = $p->persentase_progress; |
|
|
|
|
$gantt->bobot_planning = $p->bobot_planning ? $p->bobot_planning : 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -228,7 +233,7 @@ class HierarchyFtthController extends Controller
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function ganttProgress($column, $value){ |
|
|
|
|
$progress = VersionGantt::select('m_version_gantt.id','m_activity.persentase_progress') |
|
|
|
|
$progress = VersionGantt::select('m_version_gantt.id','m_activity.persentase_progress', 'm_activity.bobot_planning') |
|
|
|
|
->join('m_activity', 'm_version_gantt.id', '=', 'm_activity.version_gantt_id') |
|
|
|
|
->where("m_version_gantt.".$column, $value) |
|
|
|
|
->where('m_activity.type_activity', "project") |
|
|
|
|