mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 14:33:59 +00:00
list pending orders in table format
This commit is contained in:
@@ -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 '<table>';
|
||||
$i = 0;
|
||||
foreach ($payments as $payment){
|
||||
$booking = $payment->owner;
|
||||
echo '<tr>';
|
||||
echo '<td>'.$payment->update_at.'</td>';
|
||||
echo '<td>'.$booking->marking.'</td>';
|
||||
echo '<td>'.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].'</td>';
|
||||
echo '<td>'.$payment->amount.' '.$payment->currency->short_code.'</td>';
|
||||
echo '<td>'.$booking->company->reference.'</td>';
|
||||
echo '<td></td>';
|
||||
echo '<td>'.$payment->original_amount.' '.$payment->original_currency->short_code.'</td>';
|
||||
echo '<td></td>';
|
||||
echo '<td>'.$booking->service->name.'</td>';
|
||||
echo '<td>'.$payment->update_at->diffForHumans().'</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user