Browse Source

Fix set baseline

pull/3/head
Wahyu Ramadhan 1 year ago
parent
commit
4293e375b7
  1. 7
      app/Http/Controllers/ProjectController.php

7
app/Http/Controllers/ProjectController.php

@ -393,14 +393,9 @@ class ProjectController extends Controller
public function setBaseline($gantt_id)
{
$activities = Activity::where("version_gantt_id", $gantt_id)->orderBy('id')->get();
$activities = Activity::where("version_gantt_id", $gantt_id)->get();
foreach ($activities as $activity) {
$successor = Link::where('t_activity_id', $activity->id)->first();
if ($successor) {
$predecessor = Activity::find($successor->s_activity_id);
$activity->start_date = $predecessor->end_date;
}
$activity->update([
"planned_start"=>$activity->start_date,
"planned_end"=>$activity->end_date,

Loading…
Cancel
Save