From f58dea32ac8bb39a67b9b9820eef8668da229806 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Wed, 7 Aug 2024 18:27:58 +0800 Subject: [PATCH 1/3] revert fixed pending_orders table --- routes/web.php | 48 +++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/routes/web.php b/routes/web.php index 1a654013..76446093 100644 --- a/routes/web.php +++ b/routes/web.php @@ -403,32 +403,24 @@ Route::get('/pending_orders', function(){ ->orderBy('updated_at', 'desc') ->get(); - echo ' - '; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; + echo '
Booking Updated DateBookingPayment TypePayment CurrencyPayment AmountCustomerBooking CurrencyBooking AmountServicePayment UpdatedCust Supplier Acc TypeCust Supplier Acc Name
'; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; $i = 0; foreach ($payments as $payment){ $booking = $payment->owner; @@ -446,15 +438,13 @@ Route::get('/pending_orders', function(){ echo ''; echo ''; - echo ''; echo ''; + echo ''; echo ''; echo ''; echo ''; - echo ''; echo ''; echo ''; - echo ''; echo ''; echo ''; echo ''; From 602b69dcba132823ed294998218916377b3fdf04 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Fri, 9 Aug 2024 19:47:58 +0800 Subject: [PATCH 2/3] show payment method and date --- .../bookings/elements/PaymentHistoryComponent.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue index 370092cd..939865b1 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue @@ -33,6 +33,12 @@
{{ item.status === 2 ? 'Received' : item.status === 4 ? 'Rejected' : 'Submitted'}} On: {{item.updated_at}}
+
+
+
Payment Method: {{ convertPaymentMethod(item.payment_method) }}
+
Payment Date: {{ item.created_at }}
+
+
Bill Number: {{ item.bill_no }}
@@ -456,6 +462,15 @@ clickExpandRefundTransactions(){ this.expandRefundTransactions = !this.expandRefundTransactions; }, + 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] } From 77e314c52b3211fe6ac24ffa4217a617f91e7fd2 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 12 Aug 2024 10:25:57 +0800 Subject: [PATCH 3/3] Quick fix on recipient_bank_account is null error on frontend --- app/Http/Resources/TransactionResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index f8620f05..595ce443 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -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);
Client Booking DatePayment TypeMarkingCustomer Payment CurrencyCustomer Payment AmountReference No.Booking Amount CurrencyCNYServiceDaysCust Supplier Acc TypeCust Supplier Acc Name
'.$payment->updated_at->format('d-M-y').''.$booking->marking.''.\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_METHODS_ID[$payment->payment_method].''.$booking->marking.''.$payment->currency->short_code.''.number_format(bcsub($payment->amount, $refunds, 7), 5, '.', '').''.$booking->company->reference.''.$payment->original_currency->short_code.''.number_format(bcsub($payment->original_amount, $original_refunds, 7), 5, '.', '').''.$booking->service->name.''.$payment->updated_at->diffForHumans().''.$bankType.'