show old invoices

This commit is contained in:
omair saleh
2020-09-25 18:12:39 +08:00
parent c0fbb748ae
commit d018bee90e
+8 -5
View File
@@ -18,13 +18,16 @@ Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('p
Route::get('/old-invoices', function(){
$bookings = \App\Booking::where('status', 6)->whereHas('purchaseOrder', function($q){
$q->whereNotNull('image_path');
})->get();
dd($bookings->groupBy(function($item) {
})->get()->groupBy(function($item) {
return $item->created_at->format('Y-m');
}));
});
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>";
foreach ($bookings as $month => $bookings) {
echo "<h3>".$month."</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>date: ".$booking->created_at."</small><br>";
}
echo "<br><br><br>";
}
})->name('home');
Route::group(['middleware' => ['role:admin']], function() {