Browse Source

add getSCurveCarausell method

pull/3/head
wahyuun 1 year ago
parent
commit
8b8ee50e45
  1. 29
      app/Helpers/MasterFunctionsHelper.php

29
app/Helpers/MasterFunctionsHelper.php

@ -106,6 +106,35 @@ class MasterFunctionsHelper
} }
} }
} }
public static function getSCurveCarausell($request)
{
$allGantt = [];
if (!is_int($request->gantt_id) && !is_int($request->project_id) && !is_int($request->period)) {
if (isset($request->gantt_id)) {
$allGantt[] = $request->gantt_id;
} else {
$allGantt[] = MasterFunctionsHelper::getLatestGantt($request->project_id);
}
} else {
$allGantt[] = MasterFunctionsHelper::getLatestGantt($request->project_id);
}
foreach ($allGantt as $gantt) {
if (!isset($gantt['last_gantt_id'])) {
$ganttId = $gantt;
} else {
$ganttId = $gantt['last_gantt_id'];
}
$gantt = VersionGantt::find($ganttId)->toArray();
if (isset($gantt['calculation_type'])) {
if ($gantt['calculation_type'] == 'simple') {
// to do
return MasterFunctionsHelper::calculateProgressBasedOnSimple($gantt);
} else {
return MasterFunctionsHelper::calculateProgressBasedOnReportMaterial($gantt);
}
}
}
}
public function getLinearSCurve($request) public function getLinearSCurve($request)
{ {

Loading…
Cancel
Save