From 91be2c8f77ec85d056b67cfc1aca6b2bf1e7c7b2 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 10 Aug 2022 11:10:53 +0800 Subject: [PATCH] list pending orders in table format --- routes/web.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/routes/web.php b/routes/web.php index ccd0108a..1bc31aab 100644 --- a/routes/web.php +++ b/routes/web.php @@ -10,6 +10,7 @@ use App\Models\Booking; use App\Models\Company; use App\Models\Transaction; use App\Models\User; +use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use Maatwebsite\Excel\Excel; @@ -245,3 +246,26 @@ Route::get('/segments', function (Request $request) { return view('pages.segments.index', compact('segment')); })->name('segments'); +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){ + $booking = $payment->owner; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + echo '
'.$payment->update_at.''.$booking->marking.''.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].''.$payment->amount.' '.$payment->currency->short_code.''.$booking->company->reference.''.$payment->original_amount.' '.$payment->original_currency->short_code.''.$booking->service->name.''.$payment->update_at->diffForHumans().'
'; +}); +