diff --git a/routes/web.php b/routes/web.php
index 7c1c936c..ae5fc51a 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,6 +1,7 @@
name('password.reset');
Route::get('/po-approval', function(){
- $approvedInvoices = InvoiceStatuses::where(function($q) {
- $q->where('status', 'approve')
- ->orWhere('status', 'request_change');
- })->distinct()->get(['invoice_id'])->pluck('invoice_id');
- $invoices = InvoiceStatuses::whereNotIn('invoice_id', $approvedInvoices)->get();
- echo "
Total PO Pending Approval:".count($invoices)."
";
+ $approvedInvoices = InvoiceStatuses::where('status', 'approve')->distinct()->get(['invoice_id'])->pluck('invoice_id');
+ $pendingChangeInvoices = InvoiceStatuses::where('status', 'request_change')->distinct()->get(['invoice_id'])->pluck('invoice_id');
+ $invoices = InvoiceStatuses::whereNotIn('invoice_id', $approvedInvoices)->whereNotIn($pendingChangeInvoices)->get();
+ echo "Total PO Pending Approval: ".count($invoices)."
";
foreach ($invoices as $invoice){
echo "".$invoice->invoice->booking->id."
";
}
+ $completedInvoices = Invoice::where('invoice_path', '!=', '')->orWhereNotNull('invoice_path')->get();
+ $completedInvoices = array_merge($completedInvoices, $approvedInvoices);
+ echo "Total Po Approved: ".count($completedInvoices)."
";
+ foreach ($completedInvoices as $invoice){
+ echo "".$invoice->booking->id."
";
+ }
})->name('po.approval');
Route::get('/old-invoices', function(){