Browse Source

Disable integration

pull/3/head
Wahyu Ramadhan 2 years ago
parent
commit
0ce506a2aa
  1. 6
      app/Console/Commands/syncHumanResourceIntegration.php
  2. 20
      app/Http/Controllers/DashboardBoDController.php
  3. 10
      app/Http/Controllers/ProjectController.php
  4. 2
      app/Http/Controllers/RequestMaterialController.php
  5. 2
      app/Http/Controllers/UserToProyekController.php

6
app/Console/Commands/syncHumanResourceIntegration.php

@ -39,9 +39,9 @@ class syncHumanResourceIntegration extends Command
*/ */
public function handle() public function handle()
{ {
$url = config('api.adw').'/employees?page=1'; // $url = config('api.adw').'/employees?page=1';
echo "Requesting to " . $url; // echo "Requesting to " . $url;
$response = MasterFunctionsHelper::curlReq($url); $response = null;
if(!$response) if(!$response)
return; return;

20
app/Http/Controllers/DashboardBoDController.php

@ -37,17 +37,17 @@ class DashboardBoDController extends Controller
} }
private function getInvoiceIntegration($search) { private function getInvoiceIntegration($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');
$token = config('api.adw_token'); // $token = config('api.adw_token');
$response = $this->curlReq($url, $token); // $response = $this->curlReq($url, $token);
//
if(@$response->data->project_no == "") // if(@$response->data->project_no == "")
// return null;
//
return null; return null;
return $response;
} }
// to do // to do

10
app/Http/Controllers/ProjectController.php

@ -389,12 +389,12 @@ class ProjectController extends Controller
} }
public function getInvoiceIntegration(Request $request) { public function getInvoiceIntegration(Request $request) {
$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 = null;
return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200); return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200);

2
app/Http/Controllers/RequestMaterialController.php

@ -170,7 +170,7 @@ class RequestMaterialController extends Controller
} }
public function getMaterialIntegration(Request $request) { public function getMaterialIntegration(Request $request) {
$search = urlencode($request->name); $search = null;
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').'/stock_master?name=SEARCH'); $url = str_replace("SEARCH", $search, config('api.adw').'/stock_master?name=SEARCH');

2
app/Http/Controllers/UserToProyekController.php

@ -185,7 +185,7 @@ class UserToProyekController extends Controller
} }
public function getEmployeeIntegration(Request $request) { public function getEmployeeIntegration(Request $request) {
$search = urlencode($request->name); $search = null;
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').'/employees?emp_name=SEARCH'); $url = str_replace("SEARCH", $search, config('api.adw').'/employees?emp_name=SEARCH');

Loading…
Cancel
Save