Browse Source

prorate total cost for gantt

pull/3/head
wahyu 1 year ago
parent
commit
88151c2f49
  1. 4
      app/Http/Controllers/ProjectController.php

4
app/Http/Controllers/ProjectController.php

@ -466,12 +466,16 @@ class ProjectController extends Controller
}
public function getInvoiceIntegration(Request $request) {
$ganttCount = VersionGantt::where('proyek_id', $request->id)->count();
$search = urlencode($request->search);
if(empty($search))
return response()->json(['status'=>'error', 'message'=>'Empty query string!'], 400);
$url = str_replace("SEARCH", $search, config('api.adw').'/project_cost?project_no=SEARCH');
$response = MasterFunctionsHelper::curlReq($url);
if (isset($request->gantt_id)) {
$response->data->total_cost = $response->data->total_cost / $ganttCount;
}
return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200);
}

Loading…
Cancel
Save