include approved po's in the system

This commit is contained in:
omair saleh
2020-12-03 17:06:47 +08:00
parent 34c2433082
commit 48e7354b38
+8 -4
View File
@@ -28,10 +28,14 @@ Route::get('/po-approval', function(){
foreach ($invoices as $invoice){
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$invoice->invoice->booking->id."/upload-invoice'>".$invoice->invoice->booking->id."</a><br>";
}
$completedInvoices = Invoice::where('invoice_path', '!=', '')->orWhereNotNull('invoice_path')->get();
$completedInvoices = array_merge($completedInvoices, $approvedInvoices);
echo "<h1>Total Po Approved: <b>".count($completedInvoices)."</b></h1>";
foreach ($completedInvoices as $invoice){
$oldCompletedInvoices = Invoice::where('invoice_path', '!=', '')->orWhereNotNull('invoice_path')->get();
$newCompletedInvoices = Invoice::whereIn('invoice_id', $approvedInvoices)->get();
$total = count($oldCompletedInvoices) + count($newCompletedInvoices);
echo "<h1>Total Po Approved: <b>".$total."</b></h1>";
foreach ($newCompletedInvoices as $invoice){
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$invoice->booking->id."/admin/complete'>".$invoice->booking->id."</a><br>";
}
foreach ($oldCompletedInvoices as $invoice){
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$invoice->booking->id."/admin/complete'>".$invoice->booking->id."</a><br>";
}
})->name('po.approval');