pending customer po grouped by customer

This commit is contained in:
omair saleh
2020-12-07 11:45:39 +08:00
parent c39e91fe5a
commit 37b6ccc251
+2 -10
View File
@@ -91,14 +91,6 @@ Route::group(['middleware' => ['role:admin']], function() {
})->name('po.approval');
Route::get('/po-pending-customers', function(){
$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('invoice_id', $pendingChangeInvoices)->get();
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->invoice->booking->id."/upload-invoice'>".$invoice->invoice->booking->id."</a><br>";
}
$bookings = Booking::where('admin_status', 6)->where(function($q){
$q->WhereDoesntHave('invoice')->WhereDoesntHave('purchaseOrder');
})->get();
@@ -107,14 +99,14 @@ Route::group(['middleware' => ['role:admin']], function() {
});
echo "<h1>Total Po Pending Customer Update: <b>".count($bookings)."</b></h1>";
foreach ($customers as $customer => $bookings) {
echo "<h3>".$bookings->user->marking."(".count($bookings).")</h3><br>";
echo "<h3>".$customer."(".count($bookings).")</h3><br>";
foreach ($bookings as $booking) {
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$booking->id."/upload-invoice'>".$booking->id."</a> <small style='color: red;'>".$booking->user->marking."</small> / <small style='color: darkgrey;'>".$booking->created_at."</small><br>";
}
echo "<br><br><br>";
}
})->name('po.approval');
})->name('po.approval.customer');
Route::get('/po-approved', function(){
$approvedInvoices = InvoiceStatuses::where('status', 'approve')->distinct()->get(['invoice_id'])->pluck('invoice_id');