From 52c2c6840ce2459dceef816c15663645420e3a48 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 22 Nov 2022 11:26:07 +0800 Subject: [PATCH 1/9] hide duplicate purchase orders for verification --- resources/views/pages/dashboards/admin.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pages/dashboards/admin.blade.php b/resources/views/pages/dashboards/admin.blade.php index 46a40648..d7223cc0 100644 --- a/resources/views/pages/dashboards/admin.blade.php +++ b/resources/views/pages/dashboards/admin.blade.php @@ -202,7 +202,7 @@
- + From ebfcce83ade25ddbcb50cd5a112525101c28f1b5 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:28:45 +0800 Subject: [PATCH 2/9] fix refunded bookings --- routes/web.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) 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 '

Not Placed ('.count($notPlaced).')

'; + foreach ($notPlaced as $booking){ + echo ''.$booking->reference.'
'; + } + + echo '

Placed ('.count($placed).')

'; + foreach ($placed as $booking){ + echo ''.$booking->reference.'
'; + } + + echo '

Complete ('.count($completed).')

'; + foreach ($completed as $booking){ + echo ''.$booking->reference.'
'; + } + +}); + + + From f683f76981aabc404476c06441b67e6e1df83ea3 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:30:39 +0800 Subject: [PATCH 3/9] fix refunded bookings --- routes/web.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routes/web.php b/routes/web.php index 40400621..e0a5f741 100644 --- a/routes/web.php +++ b/routes/web.php @@ -473,17 +473,17 @@ Route::get('/refund/fix', function(){ echo '

Not Placed ('.count($notPlaced).')

'; foreach ($notPlaced as $booking){ - echo ''.$booking->reference.'
'; + echo ''.$booking->marking.'
'; } echo '

Placed ('.count($placed).')

'; foreach ($placed as $booking){ - echo ''.$booking->reference.'
'; + echo ''.$booking->marking.'
'; } echo '

Complete ('.count($completed).')

'; foreach ($completed as $booking){ - echo ''.$booking->reference.'
'; + echo ''.$booking->marking.'
'; } }); From a4b22f92d1475ee7cfcdf763ee5cbe309d93de03 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:31:55 +0800 Subject: [PATCH 4/9] fix refunded bookings --- routes/web.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routes/web.php b/routes/web.php index e0a5f741..a2fee9a4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -473,17 +473,17 @@ Route::get('/refund/fix', function(){ echo '

Not Placed ('.count($notPlaced).')

'; foreach ($notPlaced as $booking){ - echo ''.$booking->marking.'
'; + echo ''.$booking->marking.'
'; } echo '

Placed ('.count($placed).')

'; foreach ($placed as $booking){ - echo ''.$booking->marking.'
'; + echo ''.$booking->marking.'
'; } echo '

Complete ('.count($completed).')

'; foreach ($completed as $booking){ - echo ''.$booking->marking.'
'; + echo ''.$booking->marking.'
'; } }); From 3468864687a03d69c17ee2ca8d99f07e09300937 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:33:34 +0800 Subject: [PATCH 5/9] fix refunded bookings --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index a2fee9a4..b253c2f4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -458,7 +458,7 @@ Route::get('/refund/fix', function(){ foreach ($bookings as $booking){ $payments = $booking->transactions()->where('type', TransactionType::PAYMENT)->get(); foreach ($payments as $payment){ - if($payment->status = ApprovalStatus::APPROVED){ + if($payment->status === ApprovalStatus::APPROVED){ $notPlaced[] = $booking; continue; } From 84c8f238fecba8a0e75d4cecaa6cba78053ea270 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:36:41 +0800 Subject: [PATCH 6/9] 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; From 5964342db5e9329ac5f63b8d0b60dc8bf0d09878 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:43:34 +0800 Subject: [PATCH 7/9] fix refunded bookings --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 54540f19..bc956601 100644 --- a/routes/web.php +++ b/routes/web.php @@ -448,7 +448,7 @@ Route::get('/payment/check', function(){ 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]) + $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, 38548, 74366, 21060, 43240, 94612, 33164, 98630, 33164, 22898, 44320, 31153, 36480, 55085, 64039, 99796, 42238, 71458, 34415, 49935, 37902, 25598, 51833, 89733, 38081, 71564, 51366, 20173, 91400, 86540, 92131, 76724, 22657, 62117, 86443, 85827, 46570, 99809, 89258, 68834, 20785, 24478, 79588, 49111, 24838, 41989, 79081, 48440, 57375, 86104, 78719, 61502, 96167, 23398, 27873, 80065, 33048, 83138, 99211, 98183, 28639, 54547, 70098, 27216, 67404, 47761, 85049, 41906, 62328, 63645, 46750, 86975, 69955, 21714, 33889, 87344, 58345, 34183, 82504, 68636, 70962, 92553, 20125, 88625, 20661, 98146, 92075, 67543, 99045, 27395, 67163, 32245, 43347, 87947, 97897, 59860, 26003, 47852, 96008, 54166, 50037, 31435, 35821, 81929, 76751, 80379, 32473, 81598, 58716, 70554, 67473, 82491, 93859, 99159, 84772, 84772, 32473, 42050, 26532, 81526, 81526, 45780, 46570, 78657, 35293, 98311, 62095, 86914, 45215, 37650, 57708, 60449, 46750, 91834, 60989, 54877, 98298, 52382, 86346, 65219]) ->get(); $notPlaced = []; From 9fde5db903ff9b75943394e6d65389edb2034c45 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:44:45 +0800 Subject: [PATCH 8/9] fix refunded bookings --- routes/web.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routes/web.php b/routes/web.php index bc956601..ba8bd29d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -477,17 +477,17 @@ Route::get('/refund/fix', function(){ } } - echo '

Not Placed ('.count($notPlaced).')

'; + echo '

Customer Paid ('.count($notPlaced).')

'; foreach ($notPlaced as $booking){ echo ''.$booking->marking.'
'; } - echo '

Placed ('.count($placed).')

'; + echo '

White Form Generated ('.count($placed).')

'; foreach ($placed as $booking){ echo ''.$booking->marking.'
'; } - echo '

Complete ('.count($completed).')

'; + echo '

China Bankslip Uploaded ('.count($completed).')

'; foreach ($completed as $booking){ echo ''.$booking->marking.'
'; } From b120d44e86ee79cae9534a1d6d32e8885f31969f Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Thu, 24 Nov 2022 22:50:09 +0800 Subject: [PATCH 9/9] fix refunded bookings --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index ba8bd29d..a177dc5c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -456,7 +456,7 @@ Route::get('/refund/fix', function(){ $completed = []; foreach ($bookings as $booking){ - $payments = $booking->transactions()->where('type', TransactionType::PAYMENT)->get(); + $payments = $booking->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get(); foreach ($payments as $payment){ if($payment->status === ApprovalStatus::APPROVED){ $notPlaced[] = $booking;