mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-25 07:14:22 +00:00
include approved po's in the system
This commit is contained in:
+14
-1
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Booking;
|
||||
use App\Http\Controllers\InvoiceController;
|
||||
use App\Invoice;
|
||||
use App\InvoiceStatuses;
|
||||
@@ -28,6 +29,18 @@ 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>";
|
||||
}
|
||||
$bookings = Booking::where('admin_status', 6)->whereDoesntHave('purchaseOrder')->orWhereDoesntHave('invoice', function($q){
|
||||
$q->where('invoice_path', '=', '')->orWhereNull('invoice_path');
|
||||
});
|
||||
echo "<h1>Total Po Pending Customer Update: <b>".count($bookings)."</b></h1>";
|
||||
foreach ($bookings as $booking){
|
||||
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$booking->id."/upload-invoice'>".$booking->id."</a><br>";
|
||||
}
|
||||
|
||||
})->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 "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$invoice->booking->id."/admin/complete'>".$invoice->booking->id."</a><br>";
|
||||
}
|
||||
})->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){
|
||||
|
||||
Reference in New Issue
Block a user