auto generate invoices

This commit is contained in:
Omair Saleh
2023-02-17 13:40:13 +08:00
parent ed36b85a3d
commit 0c82aa17fc
+10
View File
@@ -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');