diff --git a/app/Classes/Modules/PackingLists/Processors/FetchPackingListProcessor.php b/app/Classes/Modules/PackingLists/Processors/FetchPackingListProcessor.php index b128aeed..508e2293 100644 --- a/app/Classes/Modules/PackingLists/Processors/FetchPackingListProcessor.php +++ b/app/Classes/Modules/PackingLists/Processors/FetchPackingListProcessor.php @@ -33,14 +33,15 @@ class FetchPackingListProcessor * @throws \App\Classes\Exceptions\AccessForbiddenException * @throws \App\Classes\Exceptions\RequestValidationException */ - public function execute(){ + public function execute($params){ $packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST) ->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::SUSPENDED]) ->whereDoesntHave('containers', function($query){ $query->where('status', '=', ApprovalStatus::COMPLETED); - })->orderBy('created_at','desc')->limit(5)->get(); + })->orderBy('created_at','desc')->where('owner_id',$params['orderId'])->get(); + //dd($packingLists); $packingListsArray=[]; foreach($packingLists as $packingList){ diff --git a/app/Classes/Modules/Reports/ControllersLogic/CustomcClearanceLogic.php b/app/Classes/Modules/Reports/ControllersLogic/CustomcClearanceLogic.php index 5557c185..c7fa2c0d 100644 --- a/app/Classes/Modules/Reports/ControllersLogic/CustomcClearanceLogic.php +++ b/app/Classes/Modules/Reports/ControllersLogic/CustomcClearanceLogic.php @@ -25,7 +25,8 @@ class CustomcClearanceLogic extends AbstractControllerLogic public function logic(Request $request) : JsonResponse { - $packingLists = $this->listsPackingListProcessor->execute(); + $params = $request->all(); + $packingLists = $this->listsPackingListProcessor->execute($params); $excelExportLogic = new ExportExcelLogic(collect($packingLists)); $this->excelExportLogic = $excelExportLogic; diff --git a/app/Http/Controllers/Reports/CustomcClearanceReportController.php b/app/Http/Controllers/Reports/CustomcClearanceReportController.php index e7d24ff0..061f4a0b 100644 --- a/app/Http/Controllers/Reports/CustomcClearanceReportController.php +++ b/app/Http/Controllers/Reports/CustomcClearanceReportController.php @@ -9,7 +9,8 @@ use Maatwebsite\Excel\Facades\Excel; class CustomcClearanceReportController { - public function download(Request $request, CustomcClearanceLogic $customClearancelogic) { + public function download(int $orderId, Request $request, CustomcClearanceLogic $customClearancelogic) { + $request->merge(['orderId' => $orderId]); $filename = date("Y-m-d H:i:s")." - Custom cleared report "; $customClearancelogic->logic($request); return Excel::download( $customClearancelogic->getExcelCollection(), $filename.'.xlsx'); diff --git a/resources/assets/vue/components/containers/elements/ContainerComponent.vue b/resources/assets/vue/components/containers/elements/ContainerComponent.vue index e8af2c65..a6e53001 100644 --- a/resources/assets/vue/components/containers/elements/ContainerComponent.vue +++ b/resources/assets/vue/components/containers/elements/ContainerComponent.vue @@ -61,6 +61,14 @@