Compare commits

..

No commits in common. 'dac9bcb70ca374f0e5c681753c248ed01263eab5' and '4231e17648d616ef9d32ce29de67c42b95b9c0ce' have entirely different histories.

  1. 1
      .gitignore
  2. 920
      app/Helpers/MasterFunctionsHelper.php
  3. 1693
      app/Helpers/MasterFunctionsHelperOld.php
  4. 16
      app/Http/Controllers/ActivityController.php
  5. 50
      app/Http/Controllers/ActivityDokumenController.php
  6. 12
      app/Http/Controllers/Controller.php
  7. 125
      app/Http/Controllers/DashboardBoDController.php
  8. 4
      app/Http/Controllers/DivisiController.php
  9. 7
      app/Http/Controllers/FolderDocumentProyekController.php
  10. 69
      app/Http/Controllers/HumanResourceController.php
  11. 31
      app/Http/Controllers/ImageController.php
  12. 1
      app/Http/Controllers/ProductTransactionController.php
  13. 5
      app/Http/Controllers/ProjectCarausellController.php
  14. 59
      app/Http/Controllers/ProjectController.php
  15. 42
      app/Http/Controllers/ProjectDokumenController.php
  16. 1
      app/Http/Controllers/ProjectExpenditureController.php
  17. 1
      app/Http/Controllers/ProjectFinancialHealthController.php
  18. 1
      app/Http/Controllers/ProjectInvoiceController.php
  19. 2
      app/Http/Controllers/ProjectRoleController.php
  20. 1
      app/Http/Controllers/ProjectScheduleHealthController.php
  21. 7
      app/Http/Controllers/ReportActivityMaterialController.php
  22. 4
      app/Http/Controllers/RoleController.php
  23. 11
      app/Http/Controllers/UserToProyekController.php
  24. 8163
      composer.lock
  25. 50
      routes/web.php

1
.gitignore vendored

@ -12,4 +12,3 @@ bootstrap/backup
.config-prod.json .config-prod.json
activity_log.txt activity_log.txt
.swp .swp
composer.lock

920
app/Helpers/MasterFunctionsHelper.php

File diff suppressed because it is too large Load Diff

1693
app/Helpers/MasterFunctionsHelperOld.php

File diff suppressed because it is too large Load Diff

16
app/Http/Controllers/ActivityController.php

@ -635,37 +635,41 @@ class ActivityController extends Controller
$activity_id = (int)$id; $activity_id = (int)$id;
$data = Activity::query() $data = Activity::query()
->from('m_activity as ma') ->from('m_activity as ma')
->select('ma.id') ->select('mp.company_id')
->join('m_proyek as mp','ma.proyek_id','mp.id') ->join('m_proyek as mp','ma.proyek_id','mp.id')
->where('ma.id', $activity_id); ->where('ma.id', $activity_id);
$cloneQuery = clone $data;
if (!$data->exists()) { if (!$data->exists()) {
DB::rollBack(); DB::rollBack();
return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data not found!', 'code' => 404], 404); return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data not found!', 'code' => 404], 404);
} }
$this->deleteRelative($activity_id); $this->deleteRelative($activity_id, $cloneQuery->first()->company_id);
if (!$data->delete()) { if (!$data->delete()) {
DB::rollBack(); DB::rollBack();
return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data activity failed deleted!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data activity failed deleted!', 'code' => 500], 500);
} }
DB::rollBack(); DB::commit();
return response()->json(['status' => 'success', "action" => "deleted", 'message' => 'Data activity successfully deleted!', 'code' => 200], 200); return response()->json(['status' => 'success', "action" => "deleted", 'message' => 'Data activity successfully deleted!', 'code' => 200], 200);
} }
private function deleteRelative($activity_id) private function deleteRelative($activity_id, $company_id)
{ {
DB::transaction(function () use ($activity_id) { DB::transaction(function() use($activity_id, $company_id) {
UserToActivity::where('activity_id', $activity_id)->delete(); UserToActivity::where('activity_id', $activity_id)->delete();
AssignMaterial::where('activity_id', $activity_id)->delete(); AssignMaterial::where('activity_id', $activity_id)->delete();
$dataAd = ActivityDokumen::where("activity_id", $activity_id)->get(); $dataAd = ActivityDokumen::where("activity_id", $activity_id)->get();
$destinationPath = $this->setCustomeDirectoryUpload(); $company = Company::find($company_id);
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataAd as $ad) { foreach ($dataAd as $ad) {
if (file_exists($destinationPath['pathActivityDocument'] . $ad->file)) { if (file_exists($destinationPath['pathActivityDocument'] . $ad->file)) {
unlink($destinationPath['pathActivityDocument'] . $ad->file); unlink($destinationPath['pathActivityDocument'] . $ad->file);
} }
} }
ActivityDokumen::where("activity_id", $activity_id)->delete(); ActivityDokumen::where("activity_id", $activity_id)->delete();
}
}); });
} }

50
app/Http/Controllers/ActivityDokumenController.php

@ -8,13 +8,8 @@ use App\Models\ActivityDokumen;
class ActivityDokumenController extends Controller class ActivityDokumenController extends Controller
{ {
public $directories;
public function __construct() {
$this->directories = $this->setCustomeDirectoryUpload();
}
public function dokumenByActivityId($id) public function dokumenByActivityId($id){
{
if(empty($id) || !is_int((int)$id)) if(empty($id) || !is_int((int)$id))
return response()->json(['status'=>'failed','message'=>'activity id is required!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'activity id is required!','code'=>400], 400);
@ -22,7 +17,7 @@ class ActivityDokumenController extends Controller
return response()->json(['status'=>'success','data'=>$dataDokumen,'code'=>200], 200); return response()->json(['status'=>'success','data'=>$dataDokumen,'code'=>200], 200);
} }
public function delete($id) public function delete($id, $company_id)
{ {
if(empty($id) || !is_int((int)$id)) if(empty($id) || !is_int((int)$id))
return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400);
@ -32,9 +27,12 @@ class ActivityDokumenController extends Controller
if(!$document) { if(!$document) {
return response()->json(['status'=>'failed','message'=>'Data not found!','code'=> 404], 404); return response()->json(['status'=>'failed','message'=>'Data not found!','code'=> 404], 404);
} }
$destinationPath = $this->setCustomeDirectoryUpload(); $company = Company::find($company_id);
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
if(file_exists($destinationPath['pathActivityDocument'].$document->file)){ if(file_exists($destinationPath['pathActivityDocument'].$document->file)){
unlink($destinationPath['pathActivityDocument'].$document->file); unlink($destinationPath['pathActivityDocument'].$document->file);
}
} }
$document->delete(); $document->delete();
return response()->json(['status'=>'success','message'=>'Dokumen deleted successfully!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'Dokumen deleted successfully!','code'=>200], 200);
@ -42,22 +40,18 @@ class ActivityDokumenController extends Controller
public function uploadProjectDokumen(Request $request) public function uploadProjectDokumen(Request $request)
{ {
if(!$request->hasFile('dokumen')) {
return response()->json(['status'=>'failed','message'=>'file is required!','code'=>400], 400);
}
$activity_id = $request->activity_id; $activity_id = $request->activity_id;
$document = $request->file('dokumen'); $document = $request->file('dokumen');
$name = $document->getClientOriginalName(); $name = $document->getClientOriginalName();
$fileSize = $document->getSize(); $company = Company::find($request->company_id);
$maximumSizeFile = $fileSize > 15 * 1024 * 1024; // 15 MB if($company) {
if ($maximumSizeFile) { $destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
return response()->json(['status' => 'failed', 'message' => 'This file is too large. Allowed maximum size is 15MB', 'code' => 500], 500); $result = $document->move($destinationPath['pathActivityDocument'], $name);
}
$this->validate($request, [
'dokumen' => 'required|file|max:15360'
]);
if (!$request->hasFile('dokumen')) {
return response()->json(['status' => 'failed', 'message' => 'file is required!', 'code' => 400], 400);
} }
$result = $document->move($this->directories['pathActivityDocument'], $name); if(!$result || !$company) {
if (!$result) {
return response()->json(['status'=>'failed','message'=>'Upload failed!','code'=> 500], 500); return response()->json(['status'=>'failed','message'=>'Upload failed!','code'=> 500], 500);
} }
$data = [ $data = [
@ -66,15 +60,14 @@ class ActivityDokumenController extends Controller
'description' => $request->description 'description' => $request->description
]; ];
$result = ActivityDokumen::create($data); $result = ActivityDokumen::create($data);
if (!$result) { if(!$result || !$company) {
unlink($this->directories['pathActivityDocument'] . $name); unlink($destinationPath['pathActivityDocument'].$name);
return response()->json(['status'=>'failed','message'=>'Upload failed!','code'=> 500], 500); return response()->json(['status'=>'failed','message'=>'Upload failed!','code'=> 500], 500);
} }
return response()->json(['status'=>'success','message'=>'Upload success!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'Upload success!','code'=>200], 200);
} }
public function searchDocProject(Request $request) public function searchDocProject(Request $request){
{
$payload = $request->all(); $payload = $request->all();
$dataBuilder = $this->setUpPayload($payload, 'm_document_activity'); $dataBuilder = $this->setUpPayload($payload, 'm_document_activity');
@ -86,19 +79,22 @@ class ActivityDokumenController extends Controller
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
} }
public function downloadDokumen($id) public function downloadDokumen($id, $company_id)
{ {
if(empty($id) || !is_int((int)$id)) { if(empty($id) || !is_int((int)$id)) {
return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400);
} }
$document = ActivityDokumen::find($id); $document = ActivityDokumen::find($id);
if (!$document) { $company = Company::find($company_id);
if(!$document || !$company) {
return response()->json(['status'=>'failed','message'=>'Data not found!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'Data not found!','code'=>400], 400);
} }
$destinationPath = $this->setCustomeDirectoryUpload(); if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
if(file_exists($destinationPath['pathActivityDocument'].$document->file)) { if(file_exists($destinationPath['pathActivityDocument'].$document->file)) {
$pathToFile = $destinationPath['pathActivityDocument'].$document->file; $pathToFile = $destinationPath['pathActivityDocument'].$document->file;
return response()->download($pathToFile); return response()->download($pathToFile);
}
} }
return response()->json(['status'=>'failed','message'=>'Data not found!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'Data not found!','code'=>400], 400);
} }

12
app/Http/Controllers/Controller.php

@ -44,15 +44,17 @@ class Controller extends BaseController
$this->pathActivityDocument = config('assets.activity'); $this->pathActivityDocument = config('assets.activity');
} }
protected function setCustomeDirectoryUpload() protected function setCustomeDirectoryUpload($company_name)
{ {
$current_date = date('Y-m-d'); $current_date = date('Y-m-d');
[$year, $month] = explode('-', $current_date); [$year, $month] = explode('-', $current_date);
$yearMonth = $year.'-'.$month; $yearMonth = $year.'-'.$month;
$pathImage = 'assets/image/';
$pathDocument = 'assets/file/project/'; $pathImage = 'assets/' . $company_name .'/'. $yearMonth . '/image/';
$pathTmpImport = 'assets/file/tmpimport/'; $pathDocument = 'assets/' . $company_name .'/'. $yearMonth . '/file/project/';
$pathActivityDocument = 'assets/file/activity/'; $pathTmpImport = 'assets/' . $company_name .'/'. $yearMonth . '/file/tmpimport/';
$pathActivityDocument = 'assets/' . $company_name .'/'. $yearMonth . '/file/activity/';
return [ return [
'pathImage' => $pathImage, 'pathImage' => $pathImage,
'pathDocument' => $pathDocument, 'pathDocument' => $pathDocument,

125
app/Http/Controllers/DashboardBoDController.php

@ -28,23 +28,29 @@ class DashboardBoDController extends Controller
public function getCompanyCashFlow($all_project, $hierarchy, $role_name) public function getCompanyCashFlow($company_id, $all_project, $hierarchy, $role_name)
{ {
$totalExpenditure = $totalInvoice = $totalPaidInvoice = 0; $totalExpenditure = $totalInvoice = $totalPaidInvoice = 0;
$totalBudgets = null; $totalBudgets = null;
$role = urldecode($role_name); $role = urldecode($role_name);
if (!empty($all_project) || $role === "Super Admin") { if ($role === "Super Admin") {
$totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)')); $totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
} elseif (!empty($all_project)) {
$totalBudgets = Project::where('company_id', $company_id)
->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
} else { } else {
$totalBudgets = Project::where('created_by_id', $hierarchy) $totalBudgets = Project::where('created_by_id', $hierarchy)
->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)')); ->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
} }
$totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
$projects = null; $projects = null;
if (!empty($all_project) || $role === "Super Admin") { if ($role === "Super Admin") {
$projects = Project::get(); $projects = Project::get();
} elseif (!empty($all_project)) {
$projects = Project::where('company_id', $company_id)
->get();
} else { } else {
$projects = Project::where('created_by_id', $hierarchy) $projects = Project::where('created_by_id', $hierarchy)
->get(); ->get();
@ -79,11 +85,15 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailExpenditureColor($role_name) public function getDetailExpenditureColor($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectExpenditure::get(); $query = ProjectExpenditure::get();
} else {
$query = ProjectExpenditure::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
@ -110,11 +120,16 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailFinancialHealthColor($role_name) public function getDetailFinancialHealthColor($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectFinancialHealth::get(); $query = ProjectFinancialHealth::get();
} else {
$query = ProjectFinancialHealth::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
@ -137,11 +152,15 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailScheduleHealthColor($role_name) public function getDetailScheduleHealthColor($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectScheduleHealth::get(); $query = ProjectScheduleHealth::get();
} else {
$query = ProjectScheduleHealth::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
@ -164,11 +183,15 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailInvoiceColor($role_name) public function getDetailInvoiceColor($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectInvoice::get(); $query = ProjectInvoice::get();
} else {
$query = ProjectInvoice::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
if ($value['name'] === 'Invoiced') { if ($value['name'] === 'Invoiced') {
@ -187,12 +210,15 @@ class DashboardBoDController extends Controller
} }
// integrasi // integrasi
public function getInvoiceOutstanding($role_name, $all_project, $hierarchy) public function getInvoiceOutstanding($role_name, $company_id, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$projects = null; $projects = null;
if (!empty($all_project) || $role === 'Super Admin') { if ($role === 'Super Admin') {
$projects = Project::get(); $projects = Project::get();
} elseif (!empty($all_project)) {
$projects = Project::where('company_id', $company_id)
->get();
} else { } else {
$projects = Project::where('created_by_id', $hierarchy) $projects = Project::where('created_by_id', $hierarchy)
->get(); ->get();
@ -215,7 +241,7 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getTotalProjectPerScheduleHealth($role_name, $all_project, $hierarchy) public function getTotalProjectPerScheduleHealth($role_name, $company_id, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy); $replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy);
@ -227,8 +253,11 @@ class DashboardBoDController extends Controller
]; ];
$projects = null; $projects = null;
if ($all_project == 'true' || $role === 'Super Admin') { if ($role === 'Super Admin') {
$projects = Project::get(); $projects = Project::get();
} elseif ($all_project == 'true') {
$projects = Project::where('company_id', $company_id)
->get();
} else { } else {
$projects = Project::where('created_by_id', $replaceHierarchy) $projects = Project::where('created_by_id', $replaceHierarchy)
->get(); ->get();
@ -245,11 +274,18 @@ class DashboardBoDController extends Controller
} }
public function getTotalProjectScheduleHealthPerDivision($role_name) public function getTotalProjectScheduleHealthPerDivision($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$divisions = null;
if ($role === 'Super Admin') {
$divisions = Divisi::whereNull('parent') $divisions = Divisi::whereNull('parent')
->get(); ->get();
} else {
$divisions = Divisi::whereNull('parent')
->where('company_id', $company_id)
->get();
}
foreach ($divisions as $index => $division) { foreach ($divisions as $index => $division) {
$behindSchedule = $warning = $onSchedule = 0; $behindSchedule = $warning = $onSchedule = 0;
@ -275,7 +311,7 @@ class DashboardBoDController extends Controller
return response()->json(['data' => $divisions], 200); return response()->json(['data' => $divisions], 200);
} }
public function getTotalProjectPerBudgetHealth($role_name, $all_project, $hierarchy) public function getTotalProjectPerBudgetHealth($role_name, $company_id, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy); $replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy);
@ -288,6 +324,7 @@ class DashboardBoDController extends Controller
] ]
]; ];
$divisi = Divisi::query() $divisi = Divisi::query()
->where('company_id', $company_id)
->pluck('id'); ->pluck('id');
// arr overrun // arr overrun
@ -296,7 +333,7 @@ class DashboardBoDController extends Controller
->count(); ->count();
} elseif ($all_project == 'true') { } elseif ($all_project == 'true') {
$response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) $response['data']['overrun'] = Project::whereIn('divisi_id', $divisi)
->where([['budget_health', 'overrun']]) ->where([['budget_health', 'overrun'], ['company_id', $company_id]])
->count(); ->count();
} else { } else {
$response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) $response['data']['overrun'] = Project::whereIn('divisi_id', $divisi)
@ -309,7 +346,7 @@ class DashboardBoDController extends Controller
->count(); ->count();
} elseif ($all_project == 'true') { } elseif ($all_project == 'true') {
$response['data']['warning'] = Project::whereIn('divisi_id', $divisi) $response['data']['warning'] = Project::whereIn('divisi_id', $divisi)
->where([['budget_health', 'warning']]) ->where([['budget_health', 'warning'], ['company_id', $company_id]])
->count(); ->count();
} else { } else {
$response['data']['warning'] = Project::whereIn('divisi_id', $divisi) $response['data']['warning'] = Project::whereIn('divisi_id', $divisi)
@ -322,7 +359,7 @@ class DashboardBoDController extends Controller
->count(); ->count();
} elseif ($all_project == 'true') { } elseif ($all_project == 'true') {
$response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) $response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi)
->where([['budget_health', 'on-budget']]) ->where([['company_id', $company_id], ['budget_health', 'on-budget']])
->count(); ->count();
} else { } else {
$response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) $response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi)
@ -339,7 +376,7 @@ class DashboardBoDController extends Controller
} }
public function getTotalProjectBudgetHealthPerDivision($role_name) public function getTotalProjectBudgetHealthPerDivision($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$divisions = null; $divisions = null;
@ -352,6 +389,7 @@ class DashboardBoDController extends Controller
$divisions = Divisi::select('id', 'name') $divisions = Divisi::select('id', 'name')
->with('children') ->with('children')
->whereNull('parent') ->whereNull('parent')
->where('company_id', $company_id)
->get(); ->get();
} }
@ -376,15 +414,25 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getTotalProjectPerPhase($role_name, $all_project, $hierarchy) public function getTotalProjectPerPhase($role_name, $company_id, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$projectPhases = null;
if ($role === 'Super Admin') {
$projectPhases = ProjectPhase::orderBy('order')->get(); $projectPhases = ProjectPhase::orderBy('order')->get();
} else {
$projectPhases = ProjectPhase::where('company_id', $company_id)->orderBy('order')->get();
}
foreach ($projectPhases as $phase) { foreach ($projectPhases as $phase) {
if ($role === 'Super Admin' || $all_project) { if ($role === 'Super Admin') {
$phase->totalProject = Project::where('phase_id', $phase->id)
->count();
} elseif ($all_project) {
$phase->totalProject = Project::where('phase_id', $phase->id) $phase->totalProject = Project::where('phase_id', $phase->id)
->where('company_id', $company_id)
->count(); ->count();
} else { } else {
$phase->totalProject = Project::where('phase_id', $phase->id) $phase->totalProject = Project::where('phase_id', $phase->id)
@ -405,14 +453,25 @@ class DashboardBoDController extends Controller
->count(); ->count();
} }
public function getTotalProjectPerDivision($role_name) public function getTotalProjectPerDivision($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$divisions = null; $divisions = null;
if ($role === 'Super Admin') {
$divisions = Divisi::select('id', 'name', 'parent', 'color') $divisions = Divisi::select('id', 'name', 'parent', 'color')
->with('children') ->with('children')
->whereNull('parent') ->whereNull('parent')
->get(); ->get();
} else {
$divisions = Divisi::select('id', 'name', 'parent', 'color')
->with('children')
->whereNull('parent')
->where('company_id', $company_id)
->get();
}
// to do : count in more than 1 level child // to do : count in more than 1 level child
foreach ($divisions as $v) { foreach ($divisions as $v) {
@ -436,13 +495,22 @@ class DashboardBoDController extends Controller
->first(); ->first();
} }
public function getTotalProjectValuePerDivision($role_name) public function getTotalProjectValuePerDivision($role_name, $company_id)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
if ($role === 'Super Admin') {
$divisions = Divisi::select('id', 'name', 'color')
->with('children')
->whereNull('parent')
->get();
} else {
$divisions = Divisi::select('id', 'name', 'color') $divisions = Divisi::select('id', 'name', 'color')
->with('children') ->with('children')
->whereNull('parent') ->whereNull('parent')
->where('company_id', $company_id)
->get(); ->get();
}
foreach ($divisions as $v) { foreach ($divisions as $v) {
$v->total = $this->countTotalProjectValueInDivision($v->id); $v->total = $this->countTotalProjectValueInDivision($v->id);
@ -458,15 +526,18 @@ class DashboardBoDController extends Controller
} }
public function getDetailExpenditure($all_project, $hierarchy, $role_name) public function getDetailExpenditure($year = '%', $company_id, $all_project, $hierarchy)
{ {
// $year = $this->interpolateYear($year); $year = $this->interpolateYear($year);
$projects = null; $projects = null;
if ($all_project) { if ($all_project) {
$projects = Project::orderBy('id', 'desc') $projects = Project::where('mulai_proyek', 'like', $year)
->where('company_id', $company_id)
->orderBy('id', 'desc')
->get(); ->get();
} else { } else {
$projects = Project::where('created_by_id', $hierarchy) $projects = Project::where('mulai_proyek', 'like', $year)
->where('created_by_id', $hierarchy)
->orderBy('id', 'desc') ->orderBy('id', 'desc')
->get(); ->get();
} }
@ -491,7 +562,7 @@ class DashboardBoDController extends Controller
return response()->json([ return response()->json([
'data' => $projects, 'data' => $projects,
'total_manpowers' => User::count() 'total_manpowers' => User::where('company_id', $company_id)->count()
], 200); ], 200);
} }
} }

4
app/Http/Controllers/DivisiController.php

@ -22,7 +22,7 @@ class DivisiController extends Controller
public function add(Request $request) public function add(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [
'name' => 'string|required|unique:m_divisi,name,NULL,id', 'name' => 'string|required|unique:m_divisi,name,NULL,id,company_id,' . $request->input('company_id'),
'description' => 'nullable|string', 'description' => 'nullable|string',
'parent' => 'nullable|integer', 'parent' => 'nullable|integer',
'color' => 'nullable|string|max:10' 'color' => 'nullable|string|max:10'
@ -32,6 +32,7 @@ class DivisiController extends Controller
$data['created_by'] = $this->currentName; $data['created_by'] = $this->currentName;
$result = Divisi::create($data); $result = Divisi::create($data);
if (!$result) if (!$result)
return response()->json(['status' => 'failed', 'message' => 'Failed to add data', 'code' => 500]); return response()->json(['status' => 'failed', 'message' => 'Failed to add data', 'code' => 500]);
@ -85,6 +86,7 @@ class DivisiController extends Controller
{ {
$companyId = $request->input('columns.0.value'); $companyId = $request->input('columns.0.value');
$parentDivisi = Divisi::whereNull('parent') $parentDivisi = Divisi::whereNull('parent')
->where('company_id', $companyId)
->with('children') ->with('children')
->get(); ->get();
$divisions = []; $divisions = [];

7
app/Http/Controllers/FolderDocumentProyekController.php

@ -47,12 +47,13 @@ class FolderDocumentProyekController extends Controller
} }
} }
public function delete($id) public function delete($id, $company_id)
{ {
DB::beginTransaction(); DB::beginTransaction();
$data = FolderDocumentProyek::find($id); $data = FolderDocumentProyek::find($id);
if($data) { $company = Company::find($company_id);
$destinationPath = $this->setCustomeDirectoryUpload(); if($data && $company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
$dir = $destinationPath['pathDocument']; $dir = $destinationPath['pathDocument'];
$dataFile = DokumenProject::where([['type_dokumen', 'project-document-in-folder'],['ref_id', $data['id']]])->orderByRaw('id ASC')->get(); $dataFile = DokumenProject::where([['type_dokumen', 'project-document-in-folder'],['ref_id', $data['id']]])->orderByRaw('id ASC')->get();
if (is_dir($dir)) { if (is_dir($dir)) {

69
app/Http/Controllers/HumanResourceController.php

@ -22,6 +22,7 @@ class HumanResourceController extends Controller
'name' => 'required|string', 'name' => 'required|string',
'ktp_number' => 'required|string|unique:m_users,ktp_number', 'ktp_number' => 'required|string|unique:m_users,ktp_number',
'employee_type' => 'required|in:employee,subcon,freelance', 'employee_type' => 'required|in:employee,subcon,freelance',
'company_id' => 'required|integer',
'username' => 'string|unique:m_users,username', 'username' => 'string|unique:m_users,username',
'email' => 'string|unique:m_users,email' 'email' => 'string|unique:m_users,email'
], $messages); ], $messages);
@ -33,7 +34,32 @@ class HumanResourceController extends Controller
$data['password'] = md5($request->password); $data['password'] = md5($request->password);
} }
$transaction = ProductTransaction::query()
->where('company_id', (int) $request->company_id);
$cloneQueryTransaction = clone $transaction;
$countCreate = false;
$projectResult = HumanResource::query()
->selectRaw('count(*) as total_hr')
->where('company_id', (int) $request->company_id)
->first();
if($transaction->where([['type_paket','Basic'],['amount','!=',null]])->exists()) {
if($projectResult['total_hr'] < 50) {
$countCreate = true;
}
} elseif ($cloneQueryTransaction->where([['type_paket','Free'],['amount',0]])->exists()) {
if($projectResult['total_hr'] < 1) {
$countCreate = true;
}
} else {
$countCreate = true;
}
if($countCreate) {
$result = HumanResource::create($data); $result = HumanResource::create($data);
} else {
return response()->json(['status' => 'failed', 'message' => 'Limited to create human resource!', 'code' => 500], 500);
}
if ($result) { if ($result) {
return response()->json(['status' => 'success', 'message' => 'Human Resource Pool successfull created', 'code' => 200]); return response()->json(['status' => 'success', 'message' => 'Human Resource Pool successfull created', 'code' => 200]);
@ -50,6 +76,7 @@ class HumanResourceController extends Controller
'name' => 'required', 'name' => 'required',
'ktp_number' => 'required|string|unique:m_users,ktp_number', 'ktp_number' => 'required|string|unique:m_users,ktp_number',
'employee_type' => 'required', 'employee_type' => 'required',
'company_id' => 'required',
'username' => 'required', 'username' => 'required',
'email' => 'required|unique:m_users,email|email' 'email' => 'required|unique:m_users,email|email'
]); ]);
@ -94,13 +121,15 @@ class HumanResourceController extends Controller
'required' => 'Data tidak boleh kosong' 'required' => 'Data tidak boleh kosong'
]; ];
$this->validate($request, [ $request->validate($request, [
'name' => 'required|string', 'name' => 'required|string',
'ktp_number' => 'required|string|unique:m_users,ktp_number,'.$id . ',id', 'ktp_number' => 'required|string|unique:m_users,ktp_number,'.$id . ',id',
'employee_type' => 'required|in:employee,subcon,freelance', 'employee_type' => 'required|in:employee,subcon,freelance',
'company_id' => 'required|integer',
'username' => 'unique:m_users,username,'.$id . ',id', 'username' => 'unique:m_users,username,'.$id . ',id',
'email' => 'string|unique:m_users,email,'.$id . ',id' 'email' => 'string|unique:m_users,email,'.$id . ',id'
], $messages); ], $messages);
!$request->is_customer ? $this->validate($request,['role_id'=>'required', 'divisi_id'=>'required'], $messages) : ''; !$request->is_customer ? $this->validate($request,['role_id'=>'required', 'divisi_id'=>'required'], $messages) : '';
$request->password ? $this->validate($request,['password'=>'required|min:8']) : ''; $request->password ? $this->validate($request,['password'=>'required|min:8']) : '';
@ -115,12 +144,43 @@ class HumanResourceController extends Controller
return response()->json(['status' => 'failed', 'message' => 'Data Human Resource not found!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Data Human Resource not found!', 'code' => 400], 400);
} }
if($request->company_id && isset($request->password) && isset($request->username)) {
$transaction = ProductTransaction::query()
->where('company_id', $request->company_id);
$cloneQueryTransaction = clone $transaction;
$countCreate = false;
$projectResult = HumanResource::query()
->selectRaw('count(*) as total_hr')
->where([
['company_id', $request->company_id],
['username', '!=', null],
['password', '!=', null]
])
->first();
if($transaction->where([['type_paket','Basic'],['amount','!=',null]])->exists()) {
if($projectResult['total_hr'] < 10) {
$countCreate = true;
}
} elseif ($cloneQueryTransaction->where([['type_paket','Free'],['amount',0]])->exists()) {
if($projectResult['total_hr'] < 1) {
$countCreate = true;
}
} else {
$countCreate = true;
}
} else {
$countCreate = true;
}
if (isset($request->password) && $request->password != "") { if (isset($request->password) && $request->password != "") {
$data['password'] = md5($request->password); $data['password'] = md5($request->password);
} }
// $result = $humanresource->update($data); if ($countCreate) {
$result = true; $result = $humanresource->update($data);
} else {
return response()->json(['status' => 'failed', 'message' => 'Limited to create human resource!', 'code' => 500], 500);
}
if ($result) { if ($result) {
return response()->json(['status' => 'success', 'data' => $result, 'message' => 'Human Resource Pool successfully updated!', 'code' => 200], 200); return response()->json(['status' => 'success', 'data' => $result, 'message' => 'Human Resource Pool successfully updated!', 'code' => 200], 200);
@ -160,7 +220,7 @@ class HumanResourceController extends Controller
public function list() public function list()
{ {
$data = HumanResource::select('id', 'name', 'role_id')->get(); $data = HumanResource::select('id', 'name', 'role_id','company_id')->get();
$countData = $data->count(); $countData = $data->count();
if ($data) { if ($data) {
@ -292,5 +352,6 @@ class HumanResourceController extends Controller
} else { } else {
print_r(json_decode($response)); print_r(json_decode($response));
} }
} }
} }

31
app/Http/Controllers/ImageController.php

@ -124,6 +124,23 @@ class ImageController extends Controller
} }
} }
$totalSize += $sizeFile; $totalSize += $sizeFile;
$transaction = ProductTransaction::query()
->where('company_id', $company['id']);
$cloneQueryTransaction = clone $transaction;
$countCreate = false;
if($transaction->where([['type_paket','Basic'], ['amount','!=',null]])->exists()) {
$maximumSize = 500 * 1024 * 1024;
$countCreate = true;
} elseif ($cloneQueryTransaction->where([['type_paket','Free'], ['amount', 0]])->exists()) {
$maximumSize = 50 * 1024 * 1024;
$countCreate = true;
}
if($countCreate) {
if ($totalSize > $maximumSize) {
return response()->json(['status'=>'failed','message'=>'Limited storage maximum!','code'=> 500], 500);
}
}
} }
foreach ($dokumen as $file) { foreach ($dokumen as $file) {
$extension = $file->extension(); $extension = $file->extension();
@ -202,11 +219,12 @@ class ImageController extends Controller
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
} }
public function deleteByRef($id, $category) public function deleteByRef($id, $category, $company_id)
{ {
$data = Image::where("ref_id", (int)$id)->where("category", $category)->first(); $data = Image::where("ref_id", (int)$id)->where("category", $category)->first();
if($data){ $company = Company::find($company_id);
$destinationPath = $this->setCustomeDirectoryUpload(); if($data && $company){
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
unlink($destinationPath['pathImage'].$data->image); unlink($destinationPath['pathImage'].$data->image);
$delete = $data->delete(); $delete = $data->delete();
}else{ }else{
@ -222,15 +240,16 @@ class ImageController extends Controller
} }
} }
public function deleteByRefMultiple($id, $category) public function deleteByRefMultiple($id, $category, $company_id)
{ {
$successCount = 0; $successCount = 0;
$data = Image::where([ $data = Image::where([
["ref_id", intval($id)], ["ref_id", intval($id)],
["category", $category] ["category", $category]
])->get(); ])->get();
if($data->isNotEmpty()) { $company = Company::find($company_id);
$destinationPath = $this->setCustomeDirectoryUpload(); if($data->isNotEmpty() && $company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach($data as $img) { foreach($data as $img) {
unlink($destinationPath['pathImage'].$img->image); unlink($destinationPath['pathImage'].$img->image);
$delete = $img->delete(); $delete = $img->delete();

1
app/Http/Controllers/ProductTransactionController.php

@ -10,6 +10,7 @@ class ProductTransactionController extends Controller
public function add(Request $request) public function add(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [
'company_id' => 'required|integer',
'type_paket' => 'required|string', 'type_paket' => 'required|string',
'amount' => 'required', 'amount' => 'required',
'exp_ospro' => 'required' 'exp_ospro' => 'required'

5
app/Http/Controllers/ProjectCarausellController.php

@ -16,13 +16,16 @@ class ProjectCarausellController extends Controller
public function invoke(Request $request) public function invoke(Request $request)
{ {
// Master Data // Master Data
$company_id = $request->route('company_id');
$all_project = $request->route('all_project'); $all_project = $request->route('all_project');
$hierarchy = $request->route('hierarchy'); $hierarchy = $request->route('hierarchy');
$query = Project::query() $query = Project::query()
->select("id", "nama", "kode_sortname", "pm_id", "budget_health", "calculation_status", "mulai_proyek", "akhir_proyek", "rencana_biaya", "company", "scurve"); ->select("id", "nama", "kode_sortname", "pm_id", "budget_health", "calculation_status", "mulai_proyek", "akhir_proyek", "rencana_biaya", "company", "scurve");
if (!$all_project) { if ($all_project) {
$query->where('company_id', $company_id);
} else {
$query->where('created_by_id', $hierarchy); $query->where('created_by_id', $hierarchy);
} }

59
app/Http/Controllers/ProjectController.php

@ -60,6 +60,7 @@ class ProjectController extends Controller
'akhir_proyek' => 'required', 'akhir_proyek' => 'required',
'rencana_biaya' => 'required', 'rencana_biaya' => 'required',
'type_proyek_id' => 'required', 'type_proyek_id' => 'required',
'company_id' => 'required'
]); ]);
DB::beginTransaction(); DB::beginTransaction();
try { try {
@ -71,9 +72,29 @@ class ProjectController extends Controller
if (empty($data['phase_id'])) { if (empty($data['phase_id'])) {
$data['phase_id'] = 1; $data['phase_id'] = 1;
} }
$transaction = ProductTransaction::query()
->where('company_id', $request->company_id);
$cloneQueryTransaction = clone $transaction;
$result = Project::create($data); $countCreate = false;
$projectResult = Project::query()
->selectRaw('count(*) as total_project')
->where('company_id', $request->company_id)
->first();
if ($transaction->where([['type_paket', 'Basic'], ['amount', '!=', null]])->exists()) {
if ($projectResult['total_project'] < 10) {
$countCreate = true;
}
} elseif ($cloneQueryTransaction->where([['type_paket', 'Free'], ['amount', 0]])->exists()) {
if ($projectResult['total_project'] < 1) {
$countCreate = true;
}
} else {
$countCreate = true;
}
if ($countCreate) {
$result = Project::create($data);
if (!$result) { if (!$result) {
return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500);
} else { } else {
@ -82,6 +103,9 @@ class ProjectController extends Controller
DB::commit(); DB::commit();
return response()->json(['status' => 'success', 'message' => 'Data added!', 'data_result' => $dataResultInsert, 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Data added!', 'data_result' => $dataResultInsert, 'code' => 200], 200);
} }
} else {
return response()->json(['status' => 'failed', 'message' => 'Limited to create project!', 'code' => 500], 500);
}
} catch (\Throwable $th) { } catch (\Throwable $th) {
DB::rollBack(); DB::rollBack();
} }
@ -126,6 +150,7 @@ class ProjectController extends Controller
'phase_id', 'phase_id',
'calculation_status', 'calculation_status',
'md.name as divisi_name', 'md.name as divisi_name',
'm_proyek.company_id'
) )
->leftJoin('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id') ->leftJoin('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id')
->where('m_proyek.id', $id) ->where('m_proyek.id', $id)
@ -182,13 +207,15 @@ class ProjectController extends Controller
return true; return true;
} }
public function delete($id) public function delete($id, $company_id)
{ {
DB::beginTransaction(); DB::beginTransaction();
$data = Project::find($id); $data = Project::find($id);
$dateNow = Carbon::now();
if ($data) { if ($data) {
$this->deleteRelative($id); $this->deleteRelative($id, $company_id);
if ($data->delete()) { if ($data->delete()) {
// if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) {
DB::commit(); DB::commit();
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200);
} else { } else {
@ -201,9 +228,9 @@ class ProjectController extends Controller
} }
} }
private function deleteRelative($project_id) private function deleteRelative($project_id, $company_id)
{ {
DB::transaction(function () use ($project_id) { DB::transaction(function () use ($project_id, $company_id) {
UserToProyek::where('proyek_id', $project_id)->delete(); UserToProyek::where('proyek_id', $project_id)->delete();
UserToActivity::where('proyek_id', $project_id)->delete(); UserToActivity::where('proyek_id', $project_id)->delete();
AssignMaterial::where('proyek_id', $project_id)->delete(); AssignMaterial::where('proyek_id', $project_id)->delete();
@ -220,20 +247,22 @@ class ProjectController extends Controller
OfficeHours::where('proyek_id', $project_id)->delete(); OfficeHours::where('proyek_id', $project_id)->delete();
ReportK3::where('proyek_id', $project_id)->delete(); ReportK3::where('proyek_id', $project_id)->delete();
RequestMaterial::where('proyek_id', $project_id)->delete(); RequestMaterial::where('proyek_id', $project_id)->delete();
$this->deleteVersionGantt($project_id); $this->deleteVersionGantt($project_id, $company_id);
$this->deleteDokumenProject($project_id); $this->deleteDokumenProject($project_id, $company_id);
}, 5); }, 5);
} }
private function deleteVersionGantt($project_id) private function deleteVersionGantt($project_id, $company_id)
{ {
DB::transaction(function () use ($project_id) { DB::transaction(function () use ($project_id, $company_id) {
$dataVg = VersionGantt::where("proyek_id", $project_id)->pluck("id"); $dataVg = VersionGantt::where("proyek_id", $project_id)->pluck("id");
$vhIds = $dataVg->all(); $vhIds = $dataVg->all();
$activity = Activity::whereIn("version_gantt_id", $vhIds)->pluck('id'); $activity = Activity::whereIn("version_gantt_id", $vhIds)->pluck('id');
$activityIds = $activity->all(); $activityIds = $activity->all();
$dataRa = ReportActivity::whereIn("activity_id", $activityIds)->get(); $dataRa = ReportActivity::whereIn("activity_id", $activityIds)->get();
$destinationPath = $this->setCustomeDirectoryUpload(); $company = Company::find($company_id);
if ($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataRa as $ra) { foreach ($dataRa as $ra) {
$images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get(); $images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get();
foreach ($images as $image) { foreach ($images as $image) {
@ -249,6 +278,7 @@ class ProjectController extends Controller
unlink($destinationPath['pathActivityDocument'] . $ad->file); unlink($destinationPath['pathActivityDocument'] . $ad->file);
} }
} }
}
ActivityDokumen::whereIn("activity_id", $activityIds)->delete(); ActivityDokumen::whereIn("activity_id", $activityIds)->delete();
CommentActivity::whereIn("activity_id", $activityIds)->delete(); CommentActivity::whereIn("activity_id", $activityIds)->delete();
Holiday::where("proyek_id", $project_id)->delete(); Holiday::where("proyek_id", $project_id)->delete();
@ -260,16 +290,19 @@ class ProjectController extends Controller
}, 5); }, 5);
} }
private function deleteDokumenProject($project_id) private function deleteDokumenProject($project_id, $company_id)
{ {
DB::transaction(function () use ($project_id) { DB::transaction(function () use ($project_id, $company_id) {
$dataDokumen = DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->get(); $dataDokumen = DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->get();
$destinationPath = $this->setCustomeDirectoryUpload(); $company = Company::find($company_id);
if ($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataDokumen as $dokumen) { foreach ($dataDokumen as $dokumen) {
if (file_exists($destinationPath['pathDocument'] . $dokumen->file)) { if (file_exists($destinationPath['pathDocument'] . $dokumen->file)) {
unlink($destinationPath['pathDocument'] . $dokumen->file); unlink($destinationPath['pathDocument'] . $dokumen->file);
} }
} }
}
DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->delete(); DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->delete();
$dataFolder = FolderDocumentProyek::where('proyek_id', $project_id)->pluck("id"); $dataFolder = FolderDocumentProyek::where('proyek_id', $project_id)->pluck("id");
$ref_ids = $dataFolder->all(); $ref_ids = $dataFolder->all();

42
app/Http/Controllers/ProjectDokumenController.php

@ -9,8 +9,7 @@ use Illuminate\Support\Facades\DB;
class ProjectDokumenController extends Controller class ProjectDokumenController extends Controller
{ {
public function dokumenByProyekId($id) public function dokumenByProyekId($id){
{
if(empty($id) || !is_int((int)$id)) { if(empty($id) || !is_int((int)$id)) {
return response()->json(['status'=>'failed','message'=>'project id is required!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'project id is required!','code'=>400], 400);
} }
@ -23,7 +22,7 @@ class ProjectDokumenController extends Controller
return response()->json(['status'=>'success','data'=> $document ,'code'=>200], 200); return response()->json(['status'=>'success','data'=> $document ,'code'=>200], 200);
} }
public function delete($id) public function delete($id, $company_id)
{ {
if(empty($id) || !is_int((int)$id)) { if(empty($id) || !is_int((int)$id)) {
return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400);
@ -33,9 +32,12 @@ class ProjectDokumenController extends Controller
if(!$document){ if(!$document){
return response()->json(['status'=>'failed','message'=>'Data not found!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'Data not found!','code'=>400], 400);
} }
$destinationPath = $this->setCustomeDirectoryUpload(); $company = Company::find($company_id);
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
if(file_exists($destinationPath['pathDocument'].$document['file'])){ if(file_exists($destinationPath['pathDocument'].$document['file'])){
unlink($destinationPath['pathDocument'].$document['file']); unlink($destinationPath['pathDocument'].$document['file']);
}
} }
$document->delete(); $document->delete();
return response()->json(['status'=>'success','message'=>'Data deleted!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'Data deleted!','code'=>200], 200);
@ -53,8 +55,17 @@ class ProjectDokumenController extends Controller
$extension = pathinfo($originalFilename, PATHINFO_EXTENSION); $extension = pathinfo($originalFilename, PATHINFO_EXTENSION);
$filename = pathinfo($originalFilename, PATHINFO_FILENAME); $filename = pathinfo($originalFilename, PATHINFO_FILENAME);
$name = $filename . '_' . $timeNow->format('d-m-y-His') . '.' . $extension; $name = $filename . '_' . $timeNow->format('d-m-y-His') . '.' . $extension;
// Limited Storage
$destinationPath = $this->setCustomeDirectoryUpload(); $company = Company::whereId($request->company_id)->first();
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
$getLimitStorage = $this->setLimitsStorage($company, $document, $destinationPath['pathDocument'],$destinationPath);
}
if(isset($getLimitStorage)) {
if($getLimitStorage === false) {
DB::rollBack();
return response()->json(['status' => 'failed', 'message' => 'Limited storage maximum!', 'code' => 500], 500);
}
$data = [ $data = [
'ref_id' => (int)$ref_id, 'ref_id' => (int)$ref_id,
'file' => $name, 'file' => $name,
@ -62,6 +73,7 @@ class ProjectDokumenController extends Controller
]; ];
$result = DokumenProject::create($data); $result = DokumenProject::create($data);
if(!$document->move($destinationPath['pathDocument'], $name) && $result) { if(!$document->move($destinationPath['pathDocument'], $name) && $result) {
unlink($destinationPath['pathDocument'].$name); unlink($destinationPath['pathDocument'].$name);
DB::rollBack(); DB::rollBack();
@ -70,12 +82,14 @@ class ProjectDokumenController extends Controller
DB::commit(); DB::commit();
return response()->json(['status'=>'success','message'=>'Dokumen project berhasil diupload!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'Dokumen project berhasil diupload!','code'=>200], 200);
} }
DB::rollBack();
return response()->json(['status'=>'failed','message'=>'Dokumen project gagal diupload!','code'=> 500], 500);
}
DB::rollBack(); DB::rollBack();
return response()->json(['status'=>'failed','message'=>'File is required!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'File is required!','code'=>400], 400);
} }
public function searchDocProject(Request $request) public function searchDocProject(Request $request){
{
$payload = $request->all(); $payload = $request->all();
$dataBuilder = $this->setUpPayload($payload, 'document_project'); $dataBuilder = $this->setUpPayload($payload, 'document_project');
@ -87,25 +101,27 @@ class ProjectDokumenController extends Controller
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
} }
public function downloadDokumen($id) public function downloadDokumen($id, $company_id)
{ {
if(empty($id) || !is_int((int)$id)) { if(empty($id) || !is_int((int)$id)) {
return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400);
} }
$document = DokumenProject::find($id); $document = DokumenProject::find($id);
$company = Company::find($company_id);
if (!$document) { if(!$document || !$company) {
return response()->json(['status'=>'failed','message'=>'Data not found!','code'=> 404], 404); return response()->json(['status'=>'failed','message'=>'Data not found!','code'=> 404], 404);
} }
$destinationPath = $this->setCustomeDirectoryUpload(); $destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
$pathToFile = $destinationPath['pathDocument'].$document['file']; $pathToFile = $destinationPath['pathDocument'].$document['file'];
if(!file_exists($pathToFile)) { if(!file_exists($pathToFile)) {
return response()->json(['status'=>'failed','message'=>'Directory not found!','code'=> 404], 404); return response()->json(['status'=>'failed','message'=>'Directory not found!','code'=> 404], 404);
} }
if($company) {
$name = pathinfo($pathToFile, PATHINFO_FILENAME) . "." . pathinfo($pathToFile, PATHINFO_EXTENSION); $name = pathinfo($pathToFile, PATHINFO_FILENAME) . "." . pathinfo($pathToFile, PATHINFO_EXTENSION);
}
$headers = [ $headers = [
'Content-Disposition' => 'attachment; filename="'.$name.'"' 'Content-Disposition' => 'attachment; filename="'.$name.'"'
]; ];

1
app/Http/Controllers/ProjectExpenditureController.php

@ -16,6 +16,7 @@ class ProjectExpenditureController extends Controller
// Set Unique // Set Unique
$result = ProjectExpenditure::query() $result = ProjectExpenditure::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

1
app/Http/Controllers/ProjectFinancialHealthController.php

@ -16,6 +16,7 @@ class ProjectFinancialHealthController extends Controller
// Set Unique // Set Unique
$result = ProjectFinancialHealth::query() $result = ProjectFinancialHealth::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

1
app/Http/Controllers/ProjectInvoiceController.php

@ -16,6 +16,7 @@ class ProjectInvoiceController extends Controller
// Set Unique // Set Unique
$result = ProjectInvoice::query() $result = ProjectInvoice::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

2
app/Http/Controllers/ProjectRoleController.php

@ -12,6 +12,7 @@ class ProjectRoleController extends Controller
$this->validate($request, [ $this->validate($request, [
'name' => 'required', 'name' => 'required',
'description' => 'required', 'description' => 'required',
'company_id' => 'required'
]); ]);
$data = $request->all(); $data = $request->all();
@ -19,6 +20,7 @@ class ProjectRoleController extends Controller
$data['created_by'] = $this->currentName; $data['created_by'] = $this->currentName;
$result = ProjectRole::create($data); $result = ProjectRole::create($data);
if($result){ if($result){
return response()->json(['status'=>'success','message'=>'add data project role successfully!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'add data project role successfully!','code'=>200], 200);
}else{ }else{

1
app/Http/Controllers/ProjectScheduleHealthController.php

@ -16,6 +16,7 @@ class ProjectScheduleHealthController extends Controller
// Set Unique // Set Unique
$result = ProjectScheduleHealth::query() $result = ProjectScheduleHealth::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

7
app/Http/Controllers/ReportActivityMaterialController.php

@ -102,13 +102,14 @@ class ReportActivityMaterialController extends Controller
} }
} }
public function delete($id) public function delete($id, $company_id)
{ {
$data = ReportActivityMaterial::findOrFail($id); $data = ReportActivityMaterial::findOrFail($id);
$company = Company::find($company_id);
$image = Image::where([['ref_id', $id],['category','report_activity']])->first(); $image = Image::where([['ref_id', $id],['category','report_activity']])->first();
if($data && $image) { if($data && $company && $image) {
$destinationPath = $this->setCustomeDirectoryUpload(); $destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
unlink($destinationPath['pathImage'].$image['image']); unlink($destinationPath['pathImage'].$image['image']);
} }
if(!$data->delete()) { if(!$data->delete()) {

4
app/Http/Controllers/RoleController.php

@ -11,8 +11,9 @@ class RoleController extends Controller
public function add(Request $request) public function add(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [
'name' => 'string|required|unique:m_roles,name,NULL,id', 'name' => 'string|required|unique:m_roles,name,NULL,id,company_id,' . $request->input('company_id'),
'description' => 'required', 'description' => 'required',
'company_id' => 'required'
]); ]);
$data = $request->all(); $data = $request->all();
@ -23,6 +24,7 @@ class RoleController extends Controller
} }
$result = Role::create($data); $result = Role::create($data);
if (!$result) if (!$result)
return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500);

11
app/Http/Controllers/UserToProyekController.php

@ -113,7 +113,7 @@ class UserToProyekController extends Controller
} }
} }
public function delete($id) public function delete($id, $company_id)
{ {
$data = UserToProyek::find($id); $data = UserToProyek::find($id);
if ($data) { if ($data) {
@ -121,7 +121,7 @@ class UserToProyekController extends Controller
$proyekId = $data->proyek_id; $proyekId = $data->proyek_id;
$delete = $data->delete(); $delete = $data->delete();
if ($delete) { if ($delete) {
$this->deleteRelative($proyekId, $userId); $this->deleteRelative($proyekId, $userId, $company_id);
} }
} else { } else {
return response()->json(['status' => 'failed', 'message' => 'data assign hr to proyek not found!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'data assign hr to proyek not found!', 'code' => 400], 400);
@ -136,12 +136,14 @@ class UserToProyekController extends Controller
} }
} }
private function deleteRelative($proyekId, $userId) private function deleteRelative($proyekId, $userId, $company_id)
{ {
$uta = UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->get(); $uta = UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->get();
foreach ($uta as $value) { foreach ($uta as $value) {
$dataRa = ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->get(); $dataRa = ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->get();
$destinationPath = $this->setCustomeDirectoryUpload(); $company = Company::find($company_id);
if ($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataRa as $ra) { foreach ($dataRa as $ra) {
$images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get(); $images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get();
foreach ($images as $image) { foreach ($images as $image) {
@ -153,6 +155,7 @@ class UserToProyekController extends Controller
} }
ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->delete(); ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->delete();
} }
}
UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->delete(); UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->delete();
} }

8163
composer.lock generated

File diff suppressed because it is too large Load Diff

50
routes/web.php

@ -42,20 +42,20 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->group(['middleware' => ['auth', 'cors']], function () use ($router) { $router->group(['middleware' => ['auth', 'cors']], function () use ($router) {
$router->get('/dashboard/get-company-cashflow/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure $router->get('/dashboard/get-company-cashflow/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure
$router->get('/dashboard/get-invoice-outstanding/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getInvoiceOutstanding'); // project invoice vs cash in $router->get('/dashboard/get-invoice-outstanding/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getInvoiceOutstanding'); // project invoice vs cash in
$router->get('/dashboard/get-total-project-per-schedule-health/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerScheduleHealth'); $router->get('/dashboard/get-total-project-per-schedule-health/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerScheduleHealth');
$router->get('/dashboard/get-total-project-per-budget-health/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerBudgetHealth'); $router->get('/dashboard/get-total-project-per-budget-health/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerBudgetHealth');
$router->get('/dashboard/get-total-project-schedule-health-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision'); $router->get('/dashboard/get-total-project-schedule-health-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision');
$router->get('/dashboard/get-total-project-budget-health-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision'); $router->get('/dashboard/get-total-project-budget-health-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision');
$router->get('/dashboard/get-total-project-per-phase/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerPhase'); $router->get('/dashboard/get-total-project-per-phase/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerPhase');
$router->get('/dashboard/get-total-project-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerDivision'); $router->get('/dashboard/get-total-project-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerDivision');
$router->get('/dashboard/get-total-project-value-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectValuePerDivision'); $router->get('/dashboard/get-total-project-value-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectValuePerDivision');
$router->get('/dashboard/get-detail-expenditure/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getDetailExpenditure'); $router->get('/dashboard/get-detail-expenditure/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getDetailExpenditure');
$router->get('/dashboard/get-detail-expenditure-color/{role_name}', 'DashboardBoDController@getDetailExpenditureColor'); $router->get('/dashboard/get-detail-expenditure-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailExpenditureColor');
$router->get('/dashboard/get-detail-financial-health-color/{role_name}', 'DashboardBoDController@getDetailFinancialHealthColor'); $router->get('/dashboard/get-detail-financial-health-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailFinancialHealthColor');
$router->get('/dashboard/get-detail-schedule-health-color/{role_name}', 'DashboardBoDController@getDetailScheduleHealthColor'); $router->get('/dashboard/get-detail-schedule-health-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailScheduleHealthColor');
$router->get('/dashboard/get-detail-invoice-color/{role_name}', 'DashboardBoDController@getDetailInvoiceColor'); $router->get('/dashboard/get-detail-invoice-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailInvoiceColor');
$router->post('/role/search', 'RoleController@search'); $router->post('/role/search', 'RoleController@search');
$router->post('/role/add', 'RoleController@add'); $router->post('/role/add', 'RoleController@add');
@ -66,15 +66,15 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/document-project/upload', 'ProjectDokumenController@uploadProjectDokumen'); $router->post('/document-project/upload', 'ProjectDokumenController@uploadProjectDokumen');
$router->get('/document-project/get/{id}', 'ProjectDokumenController@dokumenByProyekId'); $router->get('/document-project/get/{id}', 'ProjectDokumenController@dokumenByProyekId');
$router->delete('/document-project/delete/{id}', 'ProjectDokumenController@delete'); $router->delete('/document-project/delete/{id}/{company_id}', 'ProjectDokumenController@delete');
$router->post('/document-project/search', 'ProjectDokumenController@searchDocProject'); $router->post('/document-project/search', 'ProjectDokumenController@searchDocProject');
$router->get('/document-project/download/{id}', 'ProjectDokumenController@downloadDokumen'); $router->get('/document-project/download/{id}/{company_id}', 'ProjectDokumenController@downloadDokumen');
$router->post('/document-activity/upload', 'ActivityDokumenController@uploadProjectDokumen'); $router->post('/document-activity/upload', 'ActivityDokumenController@uploadProjectDokumen');
$router->get('/document-activity/get/{id}', 'ActivityDokumenController@dokumenByActivityId'); $router->get('/document-activity/get/{id}', 'ActivityDokumenController@dokumenByActivityId');
$router->delete('/document-activity/delete/{id}', 'ActivityDokumenController@delete'); $router->delete('/document-activity/delete/{id}/{company_id}', 'ActivityDokumenController@delete');
$router->post('/document-activity/search', 'ActivityDokumenController@searchDocProject'); $router->post('/document-activity/search', 'ActivityDokumenController@searchDocProject');
$router->get('/document-activity/download/{id}', 'ActivityDokumenController@downloadDokumen'); $router->get('/document-activity/download/{id}/{company_id}', 'ActivityDokumenController@downloadDokumen');
$router->get('/project-by-customer/{id}', 'ProjectController@getByUser'); $router->get('/project-by-customer/{id}', 'ProjectController@getByUser');
$router->post('/project/search', 'ProjectController@search'); $router->post('/project/search', 'ProjectController@search');
@ -82,7 +82,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->put('/project/update/{id}', 'ProjectController@update'); $router->put('/project/update/{id}', 'ProjectController@update');
$router->get('/project/edit/{id}', 'ProjectController@edit'); $router->get('/project/edit/{id}', 'ProjectController@edit');
$router->get('/project/detail/{id}[/{gantt_id}[/{s_curve}]]', 'ProjectController@detail'); $router->get('/project/detail/{id}[/{gantt_id}[/{s_curve}]]', 'ProjectController@detail');
$router->delete('/project/delete/{id}', 'ProjectController@delete'); $router->delete('/project/delete/{id}/{company_id}', 'ProjectController@delete');
$router->get('/project/list', 'ProjectController@list'); $router->get('/project/list', 'ProjectController@list');
$router->get('/project/set-baseline/{gantt_id}', 'ProjectController@setBaseline'); $router->get('/project/set-baseline/{gantt_id}', 'ProjectController@setBaseline');
$router->get('/project/set-baseline-activity/{activity_id}/{gantt_id}', 'ProjectController@setBaselineActivity'); $router->get('/project/set-baseline-activity/{activity_id}/{gantt_id}', 'ProjectController@setBaselineActivity');
@ -106,7 +106,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
/* $router->get('/project/get-status-health-schedule/{id}', 'ProjectController@getStatusSchedule'); */ /* $router->get('/project/get-status-health-schedule/{id}', 'ProjectController@getStatusSchedule'); */
/* $router->get('/project/get-status-health-budget/{id}', 'ProjectController@getStatusBudget'); */ /* $router->get('/project/get-status-health-budget/{id}', 'ProjectController@getStatusBudget'); */
$router->get('/project-carausell/{all_project}/{hierarchy}', 'ProjectCarausellController@invoke'); $router->get('/project-carausell/{company_id}/{all_project}/{hierarchy}', 'ProjectCarausellController@invoke');
$router->post('/project-charter/search', 'ProjectCharterController@search'); $router->post('/project-charter/search', 'ProjectCharterController@search');
$router->post('/project-charter/add', 'ProjectCharterController@add'); $router->post('/project-charter/add', 'ProjectCharterController@add');
@ -333,8 +333,8 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/image/search', 'ImageController@search'); $router->post('/image/search', 'ImageController@search');
$router->delete('/image/delete/{id}', 'ImageController@delete'); $router->delete('/image/delete/{id}', 'ImageController@delete');
$router->delete('/image/delete/{id}/{category}', 'ImageController@deleteByRef'); $router->delete('/image/delete/{id}/{category}/{company_id}', 'ImageController@deleteByRef');
$router->delete('/image/multiple-delete/{id}/{category}', 'ImageController@deleteByRefMultiple'); $router->delete('/image/multiple-delete/{id}/{category}/{company_id}', 'ImageController@deleteByRefMultiple');
$router->post('/image/upload', 'ImageController@uploadImage'); $router->post('/image/upload', 'ImageController@uploadImage');
$router->post('/image/multiple-upload', 'ImageController@uploadMultipleImage'); $router->post('/image/multiple-upload', 'ImageController@uploadMultipleImage');
$router->get('/image/{id}/{category}', 'ImageController@getByRefId'); $router->get('/image/{id}/{category}', 'ImageController@getByRefId');
@ -431,7 +431,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/report-activity-material/add', 'ReportActivityMaterialController@add'); $router->post('/report-activity-material/add', 'ReportActivityMaterialController@add');
$router->post('/report-activity-material/search', 'ReportActivityMaterialController@search'); $router->post('/report-activity-material/search', 'ReportActivityMaterialController@search');
$router->delete('/report-activity-material/delete/{id}', 'ReportActivityMaterialController@delete'); $router->delete('/report-activity-material/delete/{id}/{company_id}', 'ReportActivityMaterialController@delete');
$router->get('/report-activity-material/list', 'ReportActivityMaterialController@list'); $router->get('/report-activity-material/list', 'ReportActivityMaterialController@list');
$router->get('/report-activity-material/datatables', 'ReportActivityMaterialController@datatables'); $router->get('/report-activity-material/datatables', 'ReportActivityMaterialController@datatables');
$router->post('/report-activity-material/update-status', 'ReportActivityMaterialController@updateStatusStartFinish'); $router->post('/report-activity-material/update-status', 'ReportActivityMaterialController@updateStatusStartFinish');
@ -485,7 +485,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->get('/user-to-proyek/edit/{id}', 'UserToProyekController@edit'); $router->get('/user-to-proyek/edit/{id}', 'UserToProyekController@edit');
$router->put('/user-to-proyek/update/{id}', 'UserToProyekController@update'); $router->put('/user-to-proyek/update/{id}', 'UserToProyekController@update');
$router->post('/user-to-proyek/search', 'UserToProyekController@search'); $router->post('/user-to-proyek/search', 'UserToProyekController@search');
$router->delete('/user-to-proyek/delete/{id}', 'UserToProyekController@delete'); $router->delete('/user-to-proyek/delete/{id}/{company_id}', 'UserToProyekController@delete');
$router->get('/user-to-proyek/list', 'UserToProyekController@list'); $router->get('/user-to-proyek/list', 'UserToProyekController@list');
$router->get('/user-to-proyek/select', 'UserToProyekController@select'); $router->get('/user-to-proyek/select', 'UserToProyekController@select');
$router->get('/user-to-proyek/get-employee-integration', 'UserToProyekController@getEmployeeIntegration'); $router->get('/user-to-proyek/get-employee-integration', 'UserToProyekController@getEmployeeIntegration');
@ -494,7 +494,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->get('/folder-document-proyek/edit/{id}', 'FolderDocumentProyekController@edit'); $router->get('/folder-document-proyek/edit/{id}', 'FolderDocumentProyekController@edit');
$router->put('/folder-document-proyek/update/{id}', 'FolderDocumentProyekController@update'); $router->put('/folder-document-proyek/update/{id}', 'FolderDocumentProyekController@update');
$router->post('/folder-document-proyek/search', 'FolderDocumentProyekController@search'); $router->post('/folder-document-proyek/search', 'FolderDocumentProyekController@search');
$router->delete('/folder-document-proyek/delete/{id}', 'FolderDocumentProyekController@delete'); $router->delete('/folder-document-proyek/delete/{id}/{company_id}', 'FolderDocumentProyekController@delete');
$router->get('/folder-document-proyek/list', 'FolderDocumentProyekController@list'); $router->get('/folder-document-proyek/list', 'FolderDocumentProyekController@list');
$router->get('/folder-document-proyek/get-tree/{id}', 'FolderDocumentProyekController@getTree'); $router->get('/folder-document-proyek/get-tree/{id}', 'FolderDocumentProyekController@getTree');

Loading…
Cancel
Save