show-booking-expired for debug payment not showing

This commit is contained in:
edmondlang
2024-03-01 21:57:06 +08:00
parent efb909555e
commit 5cf55453fd
2 changed files with 76 additions and 6 deletions
+6 -6
View File
@@ -44,13 +44,13 @@ class Kernel extends ConsoleKernel
->appendOutputTo(storage_path().'/logs/delete-bulk-download-files.log')
->withoutOverlapping();
$schedule->command('booking:expired')
->dailyAt('02:00')
->withoutOverlapping();
// $schedule->command('booking:expired')
// ->dailyAt('02:00')
// ->withoutOverlapping();
$schedule->command('purchaseOrder:autoFill')
->dailyAt('03:00')
->withoutOverlapping();
// $schedule->command('purchaseOrder:autoFill')
// ->dailyAt('03:00')
// ->withoutOverlapping();
}
/**
+70
View File
@@ -872,6 +872,8 @@ Route::get('/transfer/{marking}/payment-details', function ($marking) {
$transactions = $booking->transactions()->withTrashed()->get();
$paymentMethods = PaymentMethodType::PAYMENT_METHODS_ID;
$statusLabels = [
0 => 'PAYMENT_ATTEMPT',
1 => 'PAYMENT',
@@ -898,6 +900,7 @@ Route::get('/transfer/{marking}/payment-details', function ($marking) {
echo '<th>Amount</th>';
echo '<th>Type</th>';
echo '<th>Status</th>';
echo '<th>Payment Method</th>';
echo '<th>Created At</th>';
echo '<th>Deleted At</th>';
echo '</tr>';
@@ -910,6 +913,7 @@ Route::get('/transfer/{marking}/payment-details', function ($marking) {
echo '<td>' . $transaction->amount . '</td>';
echo '<td>' . $statusLabels[$transaction->type] . '</td>';
echo '<td>' . $ApprovalStatus [$transaction->status] . '</td>';
echo '<td>' . $paymentMethods [$transaction->payment_method] . '</td>';
echo '<td>' . $transaction->created_at . '</td>';
echo '<td>' . $transaction->deleted_at . '</td>';
echo '</tr>';
@@ -917,4 +921,70 @@ Route::get('/transfer/{marking}/payment-details', function ($marking) {
echo '</tbody>';
echo '</table>';
echo '<br>';
echo '<td><a href="'.route('wallet.details', $booking->company->reference).'" target="_blank">Wallet Details</a></td>';
})->name('booking.details.transactions');
Route::get('show-booking-expired', function () {
$transactions = Transaction::where('type', TransactionType::PAYMENT)
->where('status', ApprovalStatus::EXPIRED)
->whereDate('updated_at', '>=', '2024-02-16')
->orderBy('updated_at', 'desc')
->get();
// print_r(count($transactions));
$statusLabels = [
0 => 'PAYMENT_ATTEMPT',
1 => 'PAYMENT',
2 => 'INVOICE',
3 => 'BILL',
4 => 'PROFORMA',
5 => 'TOP_UP',
6 => 'REFUND',
7 => 'PURCHASE_ORDER',
8 => 'SUPPLIER_DELIVER',
9 => 'CREDIT_NOTE',
10 => 'WITHDRAW',
11 => 'DEBIT_NOTE',
12 => 'TRANSFER_FEE',
13 => 'CASH_BACK',
];
$ApprovalStatus = ApprovalStatus::APPROVAL_STATUS_ID;
echo '<table border="1" width="100%">';
echo '<thead>';
echo '<tr>';
echo '<th>Counter</th>';
echo '<th>ID</th>';
echo '<th>Booking</th>';
echo '<th>Payments</th>';
echo '<th>Amount</th>';
echo '<th>Type</th>';
echo '<th>Status</th>';
echo '<th>Updated At</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$counter = 1;
foreach ($transactions as $transaction) {
echo '<tr>';
echo '<td>' . $counter++ . '</td>';
echo '<td>' . $transaction->id . '</td>';
echo '<td>' . '<a href="'.route('booking.details', $transaction->owner->marking).'" target="_blank">'.$transaction->owner->marking.'</a>' . '</td>';
echo '<td>' . '<a href="'.route('booking.details.transactions', $transaction->owner->marking).'" target="_blank">Payments</a>' . '</td>';
echo '<td>' . $transaction->amount . '</td>';
echo '<td>' . $statusLabels[$transaction->type] . '</td>';
echo '<td>' . $ApprovalStatus [$transaction->status] . '</td>';
echo '<td>' . $transaction->updated_at . '</td>';
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
});