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