Merge branch dillon/66.2-exchange-debug into development

This commit is contained in:
Dillon Ngo
2024-08-12 10:32:56 +08:00
3 changed files with 36 additions and 7 deletions
+2 -2
View File
@@ -23,11 +23,11 @@ class TransactionResource extends JsonResource
$bank = null;
if(in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND, TransactionType::SUPPLIER_REFUND])){
$booking = $this->owner->owner;
$bank = $this->owner->bank;
$bank = $this->owner->bank ?? $booking->bank;
}
else{
$booking = $this->owner;
$bank = $this->bank;
$bank = $this->bank ?? $booking->bank;
}
$days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1);
@@ -33,6 +33,12 @@
<div class="font-heading fs-8 all-caps" :class="[{'text-danger': item.status === 4}, {'text-primary': item.status !== 4}]">{{ item.status === 2 ? 'Received' : item.status === 4 ? 'Rejected' : 'Submitted'}} On: {{item.updated_at}}</div>
</div>
</div>
<div class="row" v-if="$store.getters.isSuperAdmin">
<div class="col">
<div class="font-heading fs-8 all-caps">Payment Method: {{ convertPaymentMethod(item.payment_method) }}</div>
<div class="font-heading fs-8 all-caps">Payment Date: {{ item.created_at }}</div>
</div>
</div>
<div class="row" v-if="$store.getters.isAdmin && item.bill_no">
<div class="col">
<div class="font-heading fs-8 all-caps m-t-5">Bill Number: <b>{{ item.bill_no }}</b></div>
@@ -470,6 +476,15 @@
trackShipment(){
window.open(route('booking.track_shipping_order', this.data.booking.marking) + '?token=' + this.$store.getters.getAccessToken, '_blank');
},
convertPaymentMethod(paymentMethod){
var paymentMethodArray = [];
paymentMethodArray[1] = 'Cash';
paymentMethodArray[2] = 'Cheque';
paymentMethodArray[3] = 'ba';
paymentMethodArray[4] = 'Wallet';
paymentMethodArray[5] = 'Payment Gateway';
return paymentMethodArray[paymentMethod];
},
},
mixins: [componentHandler]
}
+19 -5
View File
@@ -407,9 +407,25 @@ Route::get('/pending_orders', function(){
})
->orderBy('updated_at', 'desc')
->get();
echo '<table>';
echo '<table border="1">';
// echo '<thead>';
// echo '<tr>';
// echo '<th>Client Booking Date</th>';
// echo '<th>Payment Type</th>';
// echo '<th>Marking</th>';
// echo '<th>Customer Payment Currency</th>';
// echo '<th>Customer Payment Amount</th>';
// echo '<th>Reference No.</th>';
// echo '<th>Booking Amount Currency</th>';
// echo '<th>CNY</th>';
// echo '<th>Service</th>';
// echo '<th>Days</th>';
// echo '<th>Cust Supplier Acc Type</th>';
// echo '<th>Cust Supplier Acc Name</th>';
// echo '</tr>';
// echo '</thead>';
// echo '<tbody>';
$i = 0;
foreach ($payments as $payment){
$booking = $payment->owner;
@@ -429,15 +445,13 @@ Route::get('/pending_orders', function(){
echo '<tr>';
echo '<td>'.$payment->updated_at->format('d-M-y').'</td>';
echo '<td>'.$booking->marking.'</td>';
echo '<td>'.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].'</td>';
echo '<td>'.$booking->marking.'</td>';
echo '<td>'.$payment->currency->short_code.'</td>';
echo '<td>'.number_format(bcsub($payment->amount, $refunds, 7), 5, '.', '').'</td>';
echo '<td>'.$booking->company->reference.'</td>';
echo '<td></td>';
echo '<td>'.$payment->original_currency->short_code.'</td>';
echo '<td>'.number_format(bcsub($payment->original_amount, $original_refunds, 7), 5, '.', '').'</td>';
echo '<td></td>';
echo '<td>'.$booking->service->name.'</td>';
echo '<td>'.$payment->updated_at->diffForHumans().'</td>';
echo '<td>'.$bankType.'</td>';