From 84c8f238fecba8a0e75d4cecaa6cba78053ea270 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:36:41 +0800 Subject: [PATCH] fix refunded bookings --- routes/web.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routes/web.php b/routes/web.php index b253c2f4..54540f19 100644 --- a/routes/web.php +++ b/routes/web.php @@ -462,7 +462,13 @@ Route::get('/refund/fix', function(){ $notPlaced[] = $booking; continue; } + $bill = $payment->transactions()->where('type', TransactionType::BILL)->first(); + if(!$bill){ + $notPlaced[] = $booking; + continue; + } + if(in_array($bill->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])){ $completed[] = $booking; continue;