list po pending approval

This commit is contained in:
omair saleh
2020-09-29 13:13:22 +08:00
parent b025400b64
commit bb05a68eb5
+5 -3
View File
@@ -18,12 +18,14 @@ Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
Route::get('/po-approval', function(){
$approvedInvoices = InvoiceStatuses::where('status', 'approve')->distinct()->get(['invoice_id'])->pluck('invoice_id');
$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();
dd($invoices);
echo "<h1>Total PO Pending Approval:<b>".count($invoices)."</b></h1>";
foreach ($invoices as $invoice){
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$invoice->booking->id."/upload-invoice'>".$invoice->booking->id."</a><br>";
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$invoice->invoice->booking->id."/upload-invoice'>".$invoice->invoice->booking->id."</a><br>";
}
})->name('po.approval');