Browse Source

Add formatting

pull/3/head
Wahyu Ramadhan 1 year ago
parent
commit
7cf1cca8ec
  1. 27
      app/Helpers/MasterFunctionsHelper.php

27
app/Helpers/MasterFunctionsHelper.php

@ -9,9 +9,11 @@ use App\Models\HierarchyFtth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class MasterFunctionsHelper {
class MasterFunctionsHelper
{
public static function curlReq($url, $token = ""){
public static function curlReq($url, $token = "")
{
if (!$token)
$token = config('api.adw_token');
@ -34,7 +36,8 @@ class MasterFunctionsHelper {
return json_decode($output);
}
public function getLatestGantt($id){
public function getLatestGantt($id)
{
$maxGanttId = VersionGantt::where("proyek_id", $id)->max("id");
if (!$maxGanttId) {
$data = array(
@ -50,7 +53,8 @@ class MasterFunctionsHelper {
}
// dipake di dashboard project & bod
public function getSCurve($request){
public function getSCurve($request)
{
$allGantt = [];
if (!is_int($request)) {
$dataPayload = $request->all();
@ -83,7 +87,8 @@ class MasterFunctionsHelper {
}
}
public function getLinearSCurve($request){
public function getLinearSCurve($request)
{
$ftths = HierarchyFtth::where('project_id', $request->project_id)->get();
$ttlProgress = 0;
$ttlPlanning = 0;
@ -423,7 +428,8 @@ class MasterFunctionsHelper {
"percentagePlan" => $tempPercentagePlan,
"percentageReal" => $tempPercentageReal,
"data_details" => $arr_ActualM,
"budget_control" =>array("current_budget"=> $totalRencanaBudget,
"budget_control" => array(
"current_budget" => $totalRencanaBudget,
"acwp" => round($totalACWP, 0),
"bcwp" => round($totalBCWP, 0),
"rem_to_complete" => ($totalRencanaBudget - round($totalACWP, 0)),
@ -698,7 +704,8 @@ class MasterFunctionsHelper {
"percentagePlan" => $tempPercentagePlan,
"percentageReal" => $tempPercentageReal,
"data_details" => $arr_ActualM,
"budget_control" =>array("current_budget"=> $totalRencanaBudget,
"budget_control" => array(
"current_budget" => $totalRencanaBudget,
"acwp" => round($totalACWP, 0),
"bcwp" => round($totalBCWP, 0),
"rem_to_complete" => ($totalRencanaBudget - round($totalACWP, 0)),
@ -717,7 +724,8 @@ class MasterFunctionsHelper {
return $dataFinal;
}
public function calculateProgressBasedOnSimple($keyGantt){
public function calculateProgressBasedOnSimple($keyGantt)
{
DB::enableQueryLog();
$dataFinal = [];
@ -923,7 +931,8 @@ class MasterFunctionsHelper {
"percentagePlan" => $tempPercentagePlan,
"percentageReal" => $tempPercentageReal,
"data_details" => $arr_ActualM,
"budget_control" =>array("current_budget"=> $totalRencanaBudget,
"budget_control" => array(
"current_budget" => $totalRencanaBudget,
"acwp" => round($totalACWP, 0),
"bcwp" => round($totalBCWP, 0),
"rem_to_complete" => ($totalRencanaBudget - round($totalACWP, 0)),

Loading…
Cancel
Save