order export refund by created at

This commit is contained in:
Jia Sheng
2024-07-02 20:46:53 +08:00
parent a4b09cedb1
commit cf17e9bb11
+3 -3
View File
@@ -463,7 +463,7 @@ Route::get('/approve_refunds', function(Request $request){
echo '<table>'; echo '<table>';
echo '<tr>'; echo '<tr>';
echo '<td>No.</td>'; echo '<td>No.</td>';
echo '<td>Updated At</td>'; echo '<td>Created At</td>';
echo '<td>Marking</td>'; echo '<td>Marking</td>';
echo '<td>Payment Method</td>'; echo '<td>Payment Method</td>';
echo '<td colspan="2">Refunded Amount</td>'; echo '<td colspan="2">Refunded Amount</td>';
@@ -478,7 +478,7 @@ Route::get('/approve_refunds', function(Request $request){
echo '<td>Bank Holder Name</td>'; echo '<td>Bank Holder Name</td>';
echo '<td>Note Remark</td>'; echo '<td>Note Remark</td>';
echo '</tr>'; echo '</tr>';
foreach ($payments->orderBy('updated_at', 'DESC')->get() as $index => $payment){ foreach ($payments->orderBy('created_at', 'DESC')->get() as $index => $payment){
$booking = $payment->owner; $booking = $payment->owner;
$original_refunds = floatval((App()->make(CalculatesBookingRefundAmount::class))->calculateRefundAmount($payment, $booking->fix_currency_id)); $original_refunds = floatval((App()->make(CalculatesBookingRefundAmount::class))->calculateRefundAmount($payment, $booking->fix_currency_id));
$refunds = $original_refunds / $payment->currency_rate; $refunds = $original_refunds / $payment->currency_rate;
@@ -511,7 +511,7 @@ Route::get('/approve_refunds', function(Request $request){
echo '<tr>'; echo '<tr>';
echo '<td>'.($index + 1).'.</td>'; echo '<td>'.($index + 1).'.</td>';
echo '<td>'.$payment->updated_at->format('d-M-y').'</td>'; echo '<td>'.$payment->created_at->format('d-M-y').'</td>';
echo '<td>'.$booking->marking.'</td>'; echo '<td>'.$booking->marking.'</td>';
echo '<td>'.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].'</td>'; echo '<td>'.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].'</td>';
echo '<td>'.$payment->currency->short_code.'</td>'; echo '<td>'.$payment->currency->short_code.'</td>';