diff --git a/routes/web.php b/routes/web.php index a8ad44ba..40400621 100644 --- a/routes/web.php +++ b/routes/web.php @@ -446,3 +446,47 @@ Route::get('/payment/check', function(){ })->name('payment.check'); +Route::get('/refund/fix', function(){ + + $bookings = Booking::whereIn('marking', [82935, 92135, 96183, 94448, 29819, 30403, 63969, 42116, 79278, 89987, 51432, 76289, 67767, 98433, 47431, 93472, 50933, 87298, 35329, 93845, 55902, 82629, 51019, 42820, 90666, 40167, 29253, 48891, 67364, 64628, 91859, 22123, 34154, 84366, 27370, 58222, 67695, 71233, 26466, 83894, 35664, 65669, 68986, 40382, 63743, 39611, 60658, 32893, 98243, 23822, 64323, 79271, 79053, 48497, 48708, 86463, 30054, 50590, 85808, 88988, 79663, 57558, 85902, 95451, 95897, 33164, 82342, 38091, 27451, 64809, 39444, 32101, 27242, 71851, 50850, 70659, 89403, 55540, 65743, 77315, 22921, 35623, 77315, 32344, 81717, 57176, 48775, 34133, 39396, 67473, 42749, 89395, 32132, 23670, 36783, 21783, 66348, 47205, 72784, 22437, 96271, 45396, 45352, 47896, 61654, 73174, 47002, 25448, 95810, 80827, 81180, 52142, 37640, 30295, 59816, 99197, 76541, 94786, 30776, 89769, 77720, 30610, 28546, 50931, 94525, 43425, 37461, 20629, 60586, 87228, 24814, 68011, 90547, 30572, 26274, 26274, 38599, 44487, 96767, 63872, 29576, 20173, 23555, 64657, 71021, 65316, 86540, 73981, 32747, 71086, 83221, 66168, 90541, 52366, 29227, 30915, 45242, 81384, 37533, 89752, 70133, 45894, 21918, 85579, 48650, 88747, 23200, 37018, 21753, 21188, 60449, 63918, 68888, 49910, 30402, 96338, 36578, 82133, 37872, 90437, 54404, 73439, 94283, 97752, 83333]) + ->get(); + + $notPlaced = []; + $placed = []; + $completed = []; + + foreach ($bookings as $booking){ + $payments = $booking->transactions()->where('type', TransactionType::PAYMENT)->get(); + foreach ($payments as $payment){ + if($payment->status = ApprovalStatus::APPROVED){ + $notPlaced[] = $booking; + continue; + } + $bill = $payment->transactions()->where('type', TransactionType::BILL)->first(); + if(in_array($bill->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])){ + $completed[] = $booking; + continue; + } + $placed[] = $booking; + } + } + + echo '