From 0c82aa17fc0f25a37e0ca6362e7e022094fa556c Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 17 Feb 2023 13:40:13 +0800 Subject: [PATCH] auto generate invoices --- routes/web.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/routes/web.php b/routes/web.php index b8b95e8f..1aaebd28 100644 --- a/routes/web.php +++ b/routes/web.php @@ -764,4 +764,14 @@ Route::get('/generate/invoices', function(){ } })->name('generate.invoices'); +Route::get('/invoices/approve', function(Request $request){ +// whereDoesntHave + $invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::PENDING_VERIFICATION)->whereHas('owner', function ($packingList) use ($request) { + return $packingList->whereHas('owner', function ($order) use ($request) { + return $order->whereIn('reference', json_decode($request->input('exclude'))); + }); + })->get(); + dd($invoices); +})->name('generate.invoices'); +