From 0d5128ede6776896f61ea2a1c93382c003726493 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 4 Dec 2020 10:30:27 +0800 Subject: [PATCH] include approved po's in the system --- routes/web.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 989dc78b..6de87a19 100644 --- a/routes/web.php +++ b/routes/web.php @@ -33,9 +33,16 @@ Route::get('/po-approval', function(){ $bookings = Booking::where('admin_status', 6)->where(function($q){ $q->WhereDoesntHave('invoice')->WhereDoesntHave('purchaseOrder'); })->get(); + $months = $bookings->groupBy(function($item) { + return $item->created_at->format('Y-m'); + }); echo "

Total Po Pending Customer Update: ".count($bookings)."

"; - foreach ($bookings as $booking){ - echo "".$booking->id."
"; + foreach ($months as $month => $bookings) { + echo "

".$month."(".count($bookings).")


"; + foreach ($bookings as $booking) { + echo "".$booking->id." date: ".$booking->created_at."
"; + } + echo "


"; } })->name('po.approval');