From 17f6333030d222a585ab276379822dda77d02040 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Sun, 10 Apr 2022 00:23:23 +0800 Subject: [PATCH 1/2] refund bug --- app/Http/Resources/TransactionResource.php | 8 ++++---- .../bookings/elements/PaymentHistoryComponent.vue | 4 ++-- .../bookings/elements/RefundVerificationComponent.vue | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 30ba223c..4bec5255 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -19,7 +19,7 @@ class TransactionResource extends JsonResource { $booking = in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])? $this->owner->owner : $this->owner; - $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); + // $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); return [ 'id' => $this->id, @@ -28,7 +28,7 @@ class TransactionResource extends JsonResource 'bill_no' => $this->bill_no, 'payment_reference' => $this->payment_reference, 'payment_method' => (float) $this->payment_method, - 'recipient_bank_account' => new BankResource($booking->bank), + // 'recipient_bank_account' => new BankResource($booking->bank), 'issuer_name' => $this->issuerCompany->name, 'amount' => (double) $this->amount, 'original_amount' => (double) $this->original_amount, @@ -45,8 +45,8 @@ class TransactionResource extends JsonResource 'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:i:s A'), 'updated_at' => Carbon::parse($this->updated_at)->format('d-m-Y h:i:s A'), 'interval' => [ - 'value' => $days->gt(Carbon::now()) ? '+' : '-', - 'duration' => $days->diff(Carbon::now())->format('%d'), + // 'value' => $days->gt(Carbon::now()) ? '+' : '-', + // 'duration' => $days->diff(Carbon::now())->format('%d'), ] ]; } diff --git a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue index 51352679..bd45c392 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue @@ -123,7 +123,7 @@
Requested Refund Amount
-
{{item.original_currency.short_code}} {{(Math.round((totalRequestedRefund + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
+
{{item.currency.short_code}} {{(Math.round((totalRequestedRefund + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
@@ -220,7 +220,7 @@
-
+
diff --git a/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue b/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue index e78a14f6..42d5682e 100644 --- a/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue +++ b/resources/assets/vue/components/bookings/elements/RefundVerificationComponent.vue @@ -28,7 +28,7 @@
Amount
- {{(Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}} + {{(Math.round((data.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
From eee77325f71eaa961955cf94bd46f7d32cb03c0e Mon Sep 17 00:00:00 2001 From: glovetleong Date: Sun, 10 Apr 2022 00:24:22 +0800 Subject: [PATCH 2/2] back --- app/Http/Resources/TransactionResource.php | 8 ++++---- .../bookings/elements/PaymentHistoryComponent.vue | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index 4bec5255..30ba223c 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -19,7 +19,7 @@ class TransactionResource extends JsonResource { $booking = in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])? $this->owner->owner : $this->owner; - // $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); + $days = $this->created_at->endOfDay()->addWeekdays($booking->service_id === 3 ? 3 : 1); return [ 'id' => $this->id, @@ -28,7 +28,7 @@ class TransactionResource extends JsonResource 'bill_no' => $this->bill_no, 'payment_reference' => $this->payment_reference, 'payment_method' => (float) $this->payment_method, - // 'recipient_bank_account' => new BankResource($booking->bank), + 'recipient_bank_account' => new BankResource($booking->bank), 'issuer_name' => $this->issuerCompany->name, 'amount' => (double) $this->amount, 'original_amount' => (double) $this->original_amount, @@ -45,8 +45,8 @@ class TransactionResource extends JsonResource 'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:i:s A'), 'updated_at' => Carbon::parse($this->updated_at)->format('d-m-Y h:i:s A'), 'interval' => [ - // 'value' => $days->gt(Carbon::now()) ? '+' : '-', - // 'duration' => $days->diff(Carbon::now())->format('%d'), + 'value' => $days->gt(Carbon::now()) ? '+' : '-', + 'duration' => $days->diff(Carbon::now())->format('%d'), ] ]; } diff --git a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue index bd45c392..b73081b9 100644 --- a/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue +++ b/resources/assets/vue/components/bookings/elements/PaymentHistoryComponent.vue @@ -220,7 +220,7 @@
-
+