mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-25 23:34:11 +00:00
show old invoices
This commit is contained in:
+7
-3
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
@@ -14,10 +16,12 @@ Route::get('/', 'WelcomeController@index');
|
||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
|
||||
Route::get('/old-invoices', function(){
|
||||
$bookings = \App\Booking::select('id', 'created_at',DB::raw('YEAR(created_at) year, MONTH(created_at) month'))->where('status', 6)->whereHas('purchaseOrder', function($q){
|
||||
$bookings = \App\Booking::where('status', 6)->whereHas('purchaseOrder', function($q){
|
||||
$q->whereNotNull('image_path');
|
||||
})->groupby('year','month')->get();
|
||||
dd($bookings);
|
||||
})->get();
|
||||
dd($bookings->groupBy(function($item) {
|
||||
return Carbon::createFromFormat('Y-m-d', $item->date)->format('Y-W');
|
||||
}));
|
||||
echo "<h1>Total pending invoices:<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> <small>date: ".$booking->created_at."</small><br>";
|
||||
|
||||
Reference in New Issue
Block a user