From 3c35ce0b1864c51053f7374ee16cf0641ba59bbf Mon Sep 17 00:00:00 2001 From: ibnu Date: Tue, 9 May 2023 00:38:13 +0700 Subject: [PATCH 1/3] update comment integrasi invoice --- app/Http/Controllers/ProjectController.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 4689c04..75ab404 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -389,15 +389,16 @@ class ProjectController extends Controller } public function getInvoiceIntegration(Request $request) { - $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'); + // $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); + // $response = MasterFunctionsHelper::curlReq($url); - return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200); + // return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200); + return response()->json(['status'=>'success', 'data'=> '', 'code'=>200], 200); } public function detail($id){ From abf4a5fda9e1c6d00e77df643add2d55a3845805 Mon Sep 17 00:00:00 2001 From: ibnu Date: Tue, 9 May 2023 00:44:23 +0700 Subject: [PATCH 2/3] update comment integrasi invoice --- app/Http/Controllers/ProjectController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 75ab404..4b5c5db 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -396,7 +396,6 @@ class ProjectController extends Controller // $response = MasterFunctionsHelper::curlReq($url); - // return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200); return response()->json(['status'=>'success', 'data'=> '', 'code'=>200], 200); } From 34c3bba63031bce83f800e54f64ef78bdf9a2c30 Mon Sep 17 00:00:00 2001 From: ibnu Date: Wed, 17 May 2023 17:27:39 +0700 Subject: [PATCH 3/3] fix status activity in report material --- app/Helpers/MasterFunctionsHelper.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index 86197d7..de07da8 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/app/Helpers/MasterFunctionsHelper.php @@ -213,8 +213,26 @@ class MasterFunctionsHelper { $dataTempReport [$w]['duration'] = $keyActualM->duration; $dataTempReport [$w]['persentase_progress'] = $keyActualM->persentase_progress; try { + // assign_material_to_activity + $checkStatusActivity = DB::table('assign_material_to_activity') + ->select('activity_id', 'status_activity') + ->where('activity_id', '=', $keyActualM->activity_id) + ->orderBy('status_activity', 'ASC') + ->first(); $dataTempReport [$w]['percentage'] = ($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; - $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; + // $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; + if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){ + if($checkStatusActivity->status_activity == 'done'){ + $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; + }else{ + $sumPercentageActual+=(($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning)*(95/100); + } + // }else if($checkStatusActivity->status_activity == 'done'){ + // $sumPercentageActual+=0; + }else{ + $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; + } + $totalACWP += $keyActualM->biaya_actual/$keyActualM->duration; } catch (\DivisionByZeroError $e) { return response()->json(['message' => $e->getMessage()]);