diff --git a/routes/web.php b/routes/web.php
index 8a3e3f46..7bfb2637 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,5 +1,6 @@
invoice->booking->id."/upload-invoice'>".$invoice->invoice->booking->id."
";
}
+ $bookings = Booking::where('admin_status', 6)->whereDoesntHave('purchaseOrder')->orWhereDoesntHave('invoice', function($q){
+ $q->where('invoice_path', '=', '')->orWhereNull('invoice_path');
+ });
+ echo "
Total Po Pending Customer Update: ".count($bookings)."
";
+ foreach ($bookings as $booking){
+ echo "".$booking->id."
";
+ }
+
+})->name('po.approval');
+
+Route::get('/po-approved', function(){
+ $approvedInvoices = InvoiceStatuses::where('status', 'approve')->distinct()->get(['invoice_id'])->pluck('invoice_id');
$oldCompletedInvoices = Invoice::where('invoice_path', '!=', '')->orWhereNotNull('invoice_path')->get();
$newCompletedInvoices = Invoice::whereIn('id', $approvedInvoices)->get();
$total = count($oldCompletedInvoices) + count($newCompletedInvoices);
@@ -38,7 +51,7 @@ Route::get('/po-approval', function(){
foreach ($oldCompletedInvoices as $invoice){
echo "".$invoice->booking->id."
";
}
-})->name('po.approval');
+})->name('po.approved');
Route::get('/old-invoices', function(){
$bookings = \App\Booking::where('status', 6)->where('user_id', '!=', 1)->whereHas('purchaseOrder', function($q){