From 60ceac645f368b086f8f1ba410403df5abfffeef Mon Sep 17 00:00:00 2001 From: edmondlang Date: Thu, 24 Aug 2023 14:36:47 +0800 Subject: [PATCH] fix bug invoices/approve --- routes/web.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 95850b9a..52a0146e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -865,11 +865,14 @@ Route::get('/invoices/combine/{ids}', function($ids){ // })->name('generate.invoices'); Route::get('/invoices/approve', function(Request $request){ -// whereDoesntHave $invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::PENDING_SUBMISSION)->get(); foreach ($invoices as $invoice) { $packingList = $invoice->owner; + if (!$packingList) { + dump ('Error packingList not found. Invoice ID - ' . $invoice->id); + continue; + } $order = $packingList->owner; if ($request->input('exclude')){