From 4fd36ea7ce23bd0e8e77081ae2ce7b928ac17208 Mon Sep 17 00:00:00 2001 From: sharifcse57 Date: Wed, 8 Feb 2023 16:44:39 +0600 Subject: [PATCH] Made some changes in rate history work --- .../views/pages/rate_histories.blade.php | 8 +- routes/api.php | 31 ++- routes/rate.php | 6 +- routes/web.php | 194 ++++++++---------- 4 files changed, 108 insertions(+), 131 deletions(-) diff --git a/resources/views/pages/rate_histories.blade.php b/resources/views/pages/rate_histories.blade.php index 429168ce..f256e648 100644 --- a/resources/views/pages/rate_histories.blade.php +++ b/resources/views/pages/rate_histories.blade.php @@ -1,12 +1,8 @@ @extends('layouts.base_portal') @section('inner_content') -
+
-
-
- -
-
+
@endsection diff --git a/routes/api.php b/routes/api.php index 6c17a107..211547eb 100644 --- a/routes/api.php +++ b/routes/api.php @@ -14,8 +14,7 @@ use Illuminate\Support\Facades\Route; */ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function () { - - require __DIR__ . '/account.php'; + require __DIR__.'/account.php'; // Route::get('/rate/calculate', 'RateCalculateCurrencyController@convert')->name('calculate'); @@ -26,36 +25,34 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function Route::post('online_payment/callback', 'Billplz\CallbackBillplzController@callback')->name('online_payment.callback'); Route::group(['middleware' => 'valid.token'], function () { - Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file'); Route::post('/import/update-debtor/f614e339d7058904a831aad742e24d55', 'Imports\ImportUpdateDebtorController@import')->name('debtor.import'); - require __DIR__ . '/company.php'; + require __DIR__.'/company.php'; - require __DIR__ . '/document.php'; + require __DIR__.'/document.php'; - require __DIR__ . '/segment.php'; + require __DIR__.'/segment.php'; - require __DIR__ . '/segment_constant.php'; + require __DIR__.'/segment_constant.php'; - require __DIR__ . '/currency.php'; + require __DIR__.'/currency.php'; - require __DIR__ . '/bank.php'; + require __DIR__.'/bank.php'; - require __DIR__ . '/booking.php'; + require __DIR__.'/booking.php'; - require __DIR__ . '/transaction.php'; + require __DIR__.'/transaction.php'; - require __DIR__ . '/crud.php'; + require __DIR__.'/crud.php'; - require __DIR__ . '/announcement.php'; + require __DIR__.'/announcement.php'; - require __DIR__ . '/billplz.php'; + require __DIR__.'/billplz.php'; - require __DIR__ . '/wallet.php'; + require __DIR__.'/wallet.php'; -// require __DIR__ . '/rate.php'; + require __DIR__.'/rate.php'; // require __DIR__ . '/receipt.php'; - }); }); diff --git a/routes/rate.php b/routes/rate.php index 55b4719a..8f2a329d 100644 --- a/routes/rate.php +++ b/routes/rate.php @@ -10,4 +10,8 @@ Route::group(['namespace' => 'Rates', 'prefix' => 'currency-rate'], function () Route::post('/create', 'CreateRateController@create')->name('create'); Route::put('/update/{id}', 'UpdateRateController@update')->name('update'); Route::delete('/delete/{id}', 'DeleteRateController@delete')->name('delete'); -}); \ No newline at end of file +}); + +Route::group(['prefix' => 'rates', 'namespace' => 'Rates', 'as' => 'rates.'], function () { + Route::get('/currency-rate-histories', 'RateHistoriesController@histories')->name('histories'); +}); diff --git a/routes/web.php b/routes/web.php index 737ed375..7e3db69c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,11 +16,9 @@ use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Route; -use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; use Maatwebsite\Excel\Excel; use Meneses\LaravelMpdf\Facades\LaravelMpdf; -use Webklex\PDFMerger\Facades\PDFMergerFacade as PDFMerger; /* |-------------------------------------------------------------------------- @@ -57,7 +55,6 @@ Route::get('/banks', function () { return view('pages.banks.index'); })->name('banks'); - Route::get('/settings', function () { return view('pages.settings'); })->name('settings'); @@ -68,6 +65,7 @@ Route::get('/customers', function () { Route::get('/customer/{marking}', function ($marking) { $id = \App\Models\Company::where('reference', '=', $marking)->first()->id; + return view('pages.customers.profile', ['id' => $id]); })->name('customer.profile'); @@ -109,14 +107,11 @@ Route::get('/support', function () { 'email' => null, 'bookingReference' => null, 'company' => null, - 'booking' => null + 'booking' => null, ]); })->name('support'); -Route::get('/currency-rate-histories', 'Currencies\Rates\RateHistoriesController@histories')->name('rate.histories'); - Route::post('/support', function (Request $request) { - $marking = $request->input('marking'); $email = $request->input('customer_email'); $bookingReference = $request->input('booking_reference'); @@ -124,17 +119,17 @@ Route::post('/support', function (Request $request) { $company = null; $booking = null; - if($email) { - $company = Company::whereHas('Employees', function($user) use($email) { + if ($email) { + $company = Company::whereHas('Employees', function ($user) use ($email) { return $user->where('email', $email); })->first(); } - if($marking) { + if ($marking) { $company = Company::where('reference', $marking)->first(); } - if($bookingReference) { + if ($bookingReference) { $booking = Booking::where('marking', $bookingReference)->first(); $company = $booking->company; } @@ -146,7 +141,6 @@ Route::post('/support', function (Request $request) { 'company' => $company, 'booking' => $booking, ]); - })->name('support'); Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callback')->name('online_payment.redirect'); @@ -157,19 +151,19 @@ Route::get('/export/analytic/booking', 'Exports\ExportAnalyticToExcelController@ Route::get('/export/analytic/bills', 'Exports\ExportAnalyticToExcelController@billingData'); Route::get('/export/customers/leads', 'Exports\ExportCustomersToExcelController@leadsData')->name('leads.export'); -Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { +Route::get('/products', function (App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { return $exportsProducts->download('products.csv', Excel::CSV, ['Content-Type' => 'text/csv']); })->name('products.random'); Route::get('/fix_bills', function () { ini_set('max_execution_time', '1000000'); Auth()->login(User::find(1)); - $bookings = \App\Models\Booking::where('status', 3)->whereHas('transactions', function ($query){ - return $query->where('type', 1)->whereHas('transactions', function($query){ - return $query->where('type', 3)->where('issuer', 2210); + $bookings = \App\Models\Booking::where('status', 3)->whereHas('transactions', function ($query) { + return $query->where('type', 1)->whereHas('transactions', function ($query) { + return $query->where('type', 3)->where('issuer', 2210); }); })->get(); - foreach ($bookings as $booking){ + foreach ($bookings as $booking) { $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->delete(); $po = $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first(); $supplier_deliver_order_transaction = $booking->transactions()->where('type', TransactionType::SUPPLIER_DELIVER)->first(); @@ -183,15 +177,14 @@ Route::get('/fix_bills', function () { 'supplier_delivery_orders' ); - $document = (App()->make(CreatesDocument::class))->execute($booking, $document_object); - (App()->make(CreatesFiles::class))->execute($document, $document_object); + $document = App()->make(CreatesDocument::class)->execute($booking, $document_object); + App()->make(CreatesFiles::class)->execute($document, $document_object); } - - })->name('products.random'); Route::get('/wallet/{marking}/details', function ($marking) { $id = \App\Models\Company::where('reference', '=', $marking)->first()->id; + return view('pages.wallet.index', ['id' => $id]); })->name('wallet.details'); @@ -205,11 +198,10 @@ Route::get('/bookings/billplz', function () { Route::get('/document/download', 'Bookings\DownloadBookingDocumentController@download')->name('documents.download'); -Route::get('billplz/bills/{bill_no}', function($bill_no){ - return redirect(env('BILLPLZ_BASE_URL').'/bills/'.$bill_no); +Route::get('billplz/bills/{bill_no}', function ($bill_no) { + return redirect(env('BILLPLZ_BASE_URL').'/bills/'.$bill_no); })->name('billplz.bill'); - Route::get('/export/customers/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export'); Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@transactions'); Route::get('/export/null-debtor/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@nullDebtor')->name('newDebtor.export'); @@ -217,24 +209,25 @@ Route::get('/export/payment-transactions/f614e339d7058904a831aad742e24d55', 'Exp Route::get('/export/wallet-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@walletTransactions')->name('walletTransactions.export'); Route::get('/export/booking-transactions', 'Exports\ExportCustomersToExcelController@bookingTransactions')->name('export.transactions.booking'); -Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { - $bookings = Booking::where(function($query){ +Route::get('/products', function (App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) { + $bookings = Booking::where(function ($query) { return $query->whereMonth('created_at', 7)->orWhereMonth('created_at', 8)->orWhereMonth('created_at', 9)->orWhereMonth('created_at', 10)->orWhereMonth('created_at', 11)->orWhereMonth('created_at', 12); - })->whereDoesntHave('transactions', function($q){ + })->whereDoesntHave('transactions', function ($q) { $q->where('type', TransactionType::PURCHASE_ORDER); $q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]); })->get(); dd($bookings->count()); + return $exportsProducts->download('products.csv', Excel::CSV, ['Content-Type' => 'text/csv']); })->name('products.random'); Route::get('/auto-purchase-order-fill', 'Bookings\AutoPurchaseOrderFillController@auto')->name('assign'); -Route::get('purchase/sensitive/', function(Request $request){ +Route::get('purchase/sensitive/', function (Request $request) { $keywords = json_decode($request->input('keywords')); $items = \App\Models\TransactionDetail::query(); - foreach ($keywords as $key => $keyword){ - if(!$key){ + foreach ($keywords as $key => $keyword) { + if (!$key) { $items->Where('product_name', 'like', '%'.$keyword.'%'); continue; } @@ -244,8 +237,8 @@ Route::get('purchase/sensitive/', function(Request $request){ $items = $items->get(); - foreach ($items as $key => $item){ - echo ($key+1).'. '.$item->product_name.' => '.$item->transaction->owner->marking.'

'; + foreach ($items as $key => $item) { + echo($key + 1).'. '.$item->product_name.' => '.$item->transaction->owner->marking.'

'; } }); @@ -253,16 +246,16 @@ Route::get('/transactions/supplier/{id}/mock_up', 'Transactions\DownloadMockUpWh Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list'); -Route::get('/supplier/pi/export', function(){ - $groups = \App\Models\Group::where('issuer', 2729)->whereMonth('created_at', 9)->whereYear('created_at', 2022)->get(); +Route::get('/supplier/pi/export', function () { + $groups = \App\Models\Group::where('issuer', 2729)->whereMonth('created_at', 9)->whereYear('created_at', 2022)->get(); - echo ''; - $i = 0; - foreach ($groups as $group){ - foreach ($group->transactions as $transaction){ + echo '
'; + $i = 0; + foreach ($groups as $group) { + foreach ($group->transactions as $transaction) { $booking = $purchaseOrder = $transaction->owner->owner; $purchaseOrder = $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->where('status', ApprovalStatus::APPROVED)->first(); - if(!$purchaseOrder) { + if (!$purchaseOrder) { echo ''; echo ''; echo ''; @@ -274,27 +267,24 @@ Route::get('/supplier/pi/export', function(){ echo ''; continue; } - foreach ($purchaseOrder->transactionDetails as $item){ - $i++; + foreach ($purchaseOrder->transactionDetails as $item) { + ++$i; echo ''; echo ''; echo ''; echo ''; echo ''; - echo ''; - echo ''; + echo ''; + echo ''; echo ''; echo ''; - } } - - } + } echo ''; - echo '
-'.$group->created_at.'
'.$i.''.$group->created_at.''.$item->product_name.''.$item->quantity.''.$item->price * (1/$group->currency_rate).''.($item->price * $item->quantity) * (1/$group->currency_rate).''.$item->price * (1 / $group->currency_rate).''.($item->price * $item->quantity) * (1 / $group->currency_rate).''.$booking->marking.'
Service Charge'.$groups->sum('service_charge').'
'; + echo ''; }); - Route::get('/segments', function (Request $request) { $segment = null; @@ -305,20 +295,19 @@ Route::get('/segments', function (Request $request) { return view('pages.segments.index', compact('segment')); })->name('segments'); -Route::get('/pending_orders', function(){ +Route::get('/pending_orders', function () { $payments = Transaction::where('type', TransactionType::PAYMENT)->where('owner_type', Booking::class)->whereIn('status', [ApprovalStatus::APPROVED])->get(); echo ''; $i = 0; - foreach ($payments as $payment){ + foreach ($payments as $payment) { $booking = $payment->owner; - if(!$booking instanceof Booking){ + if (!$booking instanceof Booking) { dd($payment); } $bankType = str::length($booking->bank->holder_name) > 4 ? 'Company' : 'Personal'; - if (!preg_match('/[^A-Za-z0-9]/', $booking->bank->holder_name)) - { + if (!preg_match('/[^A-Za-z0-9]/', $booking->bank->holder_name)) { $bankType = str_word_count($booking->bank->holder_name) > 4 ? 'Company' : 'Personal'; } @@ -342,7 +331,7 @@ Route::get('/pending_orders', function(){ echo '
'; })->name('orders.pending'); -Route::get('/group/text/{id}', function($id){ +Route::get('/group/text/{id}', function ($id) { $group = \App\Models\Group::where('id', $id)->first(); echo 'RATE: '.$group->currency_rate.'
'; @@ -350,32 +339,32 @@ Route::get('/group/text/{id}', function($id){ $i = 0; - foreach ($group->transactions as $transaction){ - $i++; + foreach ($group->transactions as $transaction) { + ++$i; $booking = $transaction->owner->owner; echo 'No.'.$i.'
'; echo 'Bank Details:'.$booking->bank->holder_name.'
'; echo $booking->bank->bank_name.' '.$booking->bank->bank_branch.'
'; echo 'Bank Account Number:'.$booking->bank->account_no.'
'; echo 'Order Amount:'.$transaction->original_currency->short_code.' '.(round($transaction->original_amount, 2) + 0).'

'; - } })->name('group.text'); Route::get('/wallet/audit', function (Request $request) { $wallets = \App\Models\Wallet::all(); - $i = 0; - foreach ($wallets as $wallet){ + foreach ($wallets as $wallet) { $topups = 0; $credit = 0; $payments = 0; $debit = 0; - foreach ($wallet->transactions as $transaction){ - if(!in_array((int) $transaction->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) continue; - if((int) $transaction->type === TransactionType::TOP_UP) { + foreach ($wallet->transactions as $transaction) { + if (!in_array((int) $transaction->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) { + continue; + } + if ((int) $transaction->type === TransactionType::TOP_UP) { $topups += (float) $transaction->amount; // $response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference); // @@ -389,26 +378,32 @@ Route::get('/wallet/audit', function (Request $request) { // }else{ // echo "billplz error"; // } - } - if((int) $transaction->type === TransactionType::CREDIT_NOTE) $credit += (float) $transaction->amount; - if((int) $transaction->type === TransactionType::PAYMENT) $payments += (float) $transaction->amount; - if((int) $transaction->type === TransactionType::DEBIT_NOTE) $debit += (float) $transaction->amount; + if ((int) $transaction->type === TransactionType::CREDIT_NOTE) { + $credit += (float) $transaction->amount; + } + if ((int) $transaction->type === TransactionType::PAYMENT) { + $payments += (float) $transaction->amount; + } + if ((int) $transaction->type === TransactionType::DEBIT_NOTE) { + $debit += (float) $transaction->amount; + } + } + if ((round((float) $wallet->amount - (($topups + $credit) - ($payments + $debit)), 2) == 0) and $wallet->amount > -0.01) { + continue; } - if((round((float) $wallet->amount - (($topups + $credit) - ($payments + $debit)), 2) == 0) AND $wallet->amount > -0.01) continue; - $i++; + ++$i; - echo $i.". Marking: ". $wallet->owner->reference ."(".$wallet->id.")
Current Balance: ". $wallet->amount ."
Audit Balance: ". (($topups + $credit) - ($payments + $debit)) ."
Difference: ". round((float) $wallet->amount - (($topups + $credit) - ($payments + $debit)), 2) ."


"; + echo $i.'. Marking: '.$wallet->owner->reference.'('.$wallet->id.')
Current Balance: '.$wallet->amount.'
Audit Balance: '.(($topups + $credit) - ($payments + $debit)).'
Difference: '.round((float) $wallet->amount - (($topups + $credit) - ($payments + $debit)), 2).'


'; } }); - -Route::get('/wallets/active', function(){ +Route::get('/wallets/active', function () { $wallets = Wallet::all(); echo ''; - foreach ($wallets as $wallet){ + foreach ($wallets as $wallet) { echo ''; echo ''; echo ''; @@ -417,14 +412,13 @@ Route::get('/wallets/active', function(){ echo '
'.$wallet->owner->reference.''.$wallet->amount.'
'; }); -Route::get('/payments/manual', function(){ - +Route::get('/payments/manual', function () { $payments = Transaction::where('type', TransactionType::PAYMENT)->whereIn('payment_method', [\App\Classes\ValueObjects\Constants\PaymentMethodType::CASH, \App\Classes\ValueObjects\Constants\PaymentMethodType::BA, \App\Classes\ValueObjects\Constants\PaymentMethodType::CHEQUE])->where('owner_type', Booking::class)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get(); $i = 0; echo ''; - foreach ($payments as $payment){ - $i++; + foreach ($payments as $payment) { + ++$i; echo ''; echo ''; echo ''; @@ -435,13 +429,10 @@ Route::get('/payments/manual', function(){ echo '
'.$i.''.$payment->documents()->first()->created_at->format('d-m-Y').'
'; }); - - -Route::get('/1688/fix/{reference}', function($reference){ - +Route::get('/1688/fix/{reference}', function ($reference) { $booking = Booking::where('marking', $reference)->first(); - (App()->make(createPurchaseOrderFor1688OrderProcessor::class))->execute($booking); + App()->make(createPurchaseOrderFor1688OrderProcessor::class)->execute($booking); // set_time_limit(1800); // $purchaseOrderDocuments = \App\Models\Document::where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get(); @@ -457,43 +448,36 @@ Route::get('/1688/fix/{reference}', function($reference){ // } })->name('ecommerce.fix'); -Route::get('/po/manual/fix', function(){ - - $bookings = Booking::whereIn('company_id', [199, 510])->whereHas('documents', function($query){ +Route::get('/po/manual/fix', function () { + $bookings = Booking::whereIn('company_id', [199, 510])->whereHas('documents', function ($query) { return $query->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER); })->get(); - foreach ($bookings as $booking){ + foreach ($bookings as $booking) { $booking->status = ApprovalStatus::APPROVED; $booking->save(); $booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::INVOICE, DocumentType::SUPPLIER_DELIVER_ORDER])->delete(); $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->update(['status' => ApprovalStatus::PENDING_SUBMISSION]); - } - })->name('ecommerce.fix'); -Route::get('/payment/check', function(){ - +Route::get('/payment/check', function () { $transactions = Transaction::where('type', TransactionType::BILL)->whereDate('created_at', '>=', Carbon::today())->get(); - foreach ($transactions as $transaction){ + foreach ($transactions as $transaction) { $booking = $transaction->owner->owner; $documents = $transaction->documents; - if(!count($documents)){ + if (!count($documents)) { echo $booking->marking.'

'; continue; } // echo $transaction->owner->owner->marking.'. payment: '.$transaction->updated_at.' -> document: '.$documents[0]->created_at.'
'; } - - })->name('payment.check'); -Route::get('/refund/fix', 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, 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(); @@ -501,21 +485,21 @@ Route::get('/refund/fix', function(){ $placed = []; $completed = []; - foreach ($bookings as $booking){ + foreach ($bookings as $booking) { $payments = $booking->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get(); - foreach ($payments as $payment){ - if($payment->status === ApprovalStatus::APPROVED){ + foreach ($payments as $payment) { + if ($payment->status === ApprovalStatus::APPROVED) { $notPlaced[] = $booking; continue; } $bill = $payment->transactions()->where('type', TransactionType::BILL)->first(); - if(!$bill){ + if (!$bill) { $notPlaced[] = $booking; continue; } - if(in_array($bill->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])){ + if (in_array($bill->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) { $completed[] = $booking; continue; } @@ -524,21 +508,17 @@ Route::get('/refund/fix', function(){ } echo '

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

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

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

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

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

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