From 13dd19d0a1348c979022de494fdd583813c431ae Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 12 Aug 2024 22:29:04 +0800 Subject: [PATCH 1/4] Fix an error with refund for transaction that used a voucher earlier, get discount amount for voucher so to get details breakdown --- .../Bookings/ControllersLogic/CreateBookingRefundLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index 6a7510c2..6e6b2233 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -130,7 +130,7 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $quotationBeforeCurrentRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectBeforeCurrentRefund, $voucherCode, $redemptionId); - $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode); + $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode, $redemptionId); $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); From 204ebf04ca6e52443ed7cc64449df9865395b8b8 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Mon, 12 Aug 2024 23:19:12 +0800 Subject: [PATCH 2/4] fix merge code error --- .../CreateBookingRefundLogic.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index e6bf4f1c..fbafb659 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -113,32 +113,32 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $service_charges_to_refund = $transaction->service_charge; } else { $refundAmount = bcdiv($request->input('amount'), $transaction->currency_rate, 7); - - $bookingAmountBeforeCurrentRefund = $booking->fix_amount - $refundInPending; - - $bookingAmountAfterRefunded = $booking->fix_amount - $refundInPending - $request->input('amount'); - - $isFullyRefund = ($refund + $request->input('amount')) == $transaction->original_amount; - - $voucherCode = null; - $redemptionId = null; - - if ($transaction->voucherRedemption) { - // $voucherCode = $transaction->voucherRedemption->voucher->code; - $redemptionId = $transaction->voucherRedemption->redemption_id; - } - - $conversionObjectBeforeCurrentRefund = new CurrencyConversionObject($bookingAmountBeforeCurrentRefund, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); - - $conversionObjectAfterRefund = new CurrencyConversionObject($isFullyRefund ? $request->input('amount') : $bookingAmountAfterRefunded, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); - - $quotationBeforeCurrentRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectBeforeCurrentRefund, $voucherCode, $redemptionId); - - $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode, $redemptionId); - - $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); } + $bookingAmountBeforeCurrentRefund = $booking->fix_amount - $refundInPending; + + $bookingAmountAfterRefunded = $booking->fix_amount - $refundInPending - $request->input('amount'); + + $isFullyRefund = ($refund + $request->input('amount')) == $transaction->original_amount; + + $voucherCode = null; + $redemptionId = null; + + if ($transaction->voucherRedemption) { + // $voucherCode = $transaction->voucherRedemption->voucher->code; + $redemptionId = $transaction->voucherRedemption->redemption_id; + } + + $conversionObjectBeforeCurrentRefund = new CurrencyConversionObject($bookingAmountBeforeCurrentRefund, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); + + $conversionObjectAfterRefund = new CurrencyConversionObject($isFullyRefund ? $request->input('amount') : $bookingAmountAfterRefunded, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); + + $quotationBeforeCurrentRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectBeforeCurrentRefund, $voucherCode, $redemptionId); + + $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode, $redemptionId); + + $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); + // refund service charges if booking is not E2E $refundTotal = $refundAmount; From ca1d36bac697ef04372d5a55f36fa875c168b2cc Mon Sep 17 00:00:00 2001 From: edmondlang Date: Mon, 12 Aug 2024 23:39:17 +0800 Subject: [PATCH 3/4] fix code merging --- .../CreateBookingRefundLogic.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index fbafb659..e6bf4f1c 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -113,32 +113,32 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $service_charges_to_refund = $transaction->service_charge; } else { $refundAmount = bcdiv($request->input('amount'), $transaction->currency_rate, 7); + + $bookingAmountBeforeCurrentRefund = $booking->fix_amount - $refundInPending; + + $bookingAmountAfterRefunded = $booking->fix_amount - $refundInPending - $request->input('amount'); + + $isFullyRefund = ($refund + $request->input('amount')) == $transaction->original_amount; + + $voucherCode = null; + $redemptionId = null; + + if ($transaction->voucherRedemption) { + // $voucherCode = $transaction->voucherRedemption->voucher->code; + $redemptionId = $transaction->voucherRedemption->redemption_id; + } + + $conversionObjectBeforeCurrentRefund = new CurrencyConversionObject($bookingAmountBeforeCurrentRefund, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); + + $conversionObjectAfterRefund = new CurrencyConversionObject($isFullyRefund ? $request->input('amount') : $bookingAmountAfterRefunded, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); + + $quotationBeforeCurrentRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectBeforeCurrentRefund, $voucherCode, $redemptionId); + + $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode, $redemptionId); + + $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); } - $bookingAmountBeforeCurrentRefund = $booking->fix_amount - $refundInPending; - - $bookingAmountAfterRefunded = $booking->fix_amount - $refundInPending - $request->input('amount'); - - $isFullyRefund = ($refund + $request->input('amount')) == $transaction->original_amount; - - $voucherCode = null; - $redemptionId = null; - - if ($transaction->voucherRedemption) { - // $voucherCode = $transaction->voucherRedemption->voucher->code; - $redemptionId = $transaction->voucherRedemption->redemption_id; - } - - $conversionObjectBeforeCurrentRefund = new CurrencyConversionObject($bookingAmountBeforeCurrentRefund, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); - - $conversionObjectAfterRefund = new CurrencyConversionObject($isFullyRefund ? $request->input('amount') : $bookingAmountAfterRefunded, $booking->convertible_currency_id, $booking->service_id, $booking->fix_currency_id === 1 ? 0:1, $transaction->payment_method); - - $quotationBeforeCurrentRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectBeforeCurrentRefund, $voucherCode, $redemptionId); - - $quotationAfterRefund = $this->fetchBookingQuotation->execute($booking->company, $conversionObjectAfterRefund, $voucherCode, $redemptionId); - - $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); - // refund service charges if booking is not E2E $refundTotal = $refundAmount; From de008d593e38bd7ed6e768827d64e2f9612c2c52 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Tue, 13 Aug 2024 15:59:07 +0800 Subject: [PATCH 4/4] Minor UI update to show Terms requested by KS --- .../elements/AvailableVouchersComponent.vue | 43 ++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/resources/assets/vue/components/bookings/elements/AvailableVouchersComponent.vue b/resources/assets/vue/components/bookings/elements/AvailableVouchersComponent.vue index bcfd7219..a5fb4e3b 100644 --- a/resources/assets/vue/components/bookings/elements/AvailableVouchersComponent.vue +++ b/resources/assets/vue/components/bookings/elements/AvailableVouchersComponent.vue @@ -14,12 +14,43 @@ -->
- - Valid till {{ item.voucher.end_date }} - - - No expiry date - +
+ + Valid till {{ item.voucher.end_date }} + + + No expiry date + +
+
+ Terms +
+ +
+
+
+ Terms & Conditions +
+
+
    +
  1. Vouchers are only valid for purchases made on https://exchange.cief-malaysia.com/.
  2. +
  3. Each voucher is applicable for a single transaction (unless stated otherwise).
  4. +
  5. Each voucher is only applicable for new orders.
  6. +
  7. Voucher codes are to be entered at the checkout or cart page (unless stated otherwise).
  8. +
  9. Vouchers are not valid for promotions or discounted products (unless stated otherwise).
  10. +
  11. Customers should take note of the expiry dates of the voucher(s) that they wish to redeem. Any voucher(s) which have expired will be invalid.
  12. +
  13. Individual vouchers are only valid during its respective promotion period. This guideline overrides any individual voucher policy (unless stated otherwise).
  14. +
  15. CIEF reserves the right to cancel any order if a customer’s purchasing behavior appears to be suspicious or potentially fraudulent.
  16. +
  17. CIEF vouchers are not exchangeable for cash at https://exchange.cief-malaysia.com/.
  18. +
  19. This voucher can only be used and redeemed by a registered customer who has already logged into their account during purchase.
  20. +
  21. CIEF reserves the right to amend the terms & conditions or cancel any vouchers/promotions without prior notice.
  22. +
  23. Additional terms & conditions are stated on the respective promotion banners (e.g., duration, discount amounts, validity for campaigns/promotions or certain services).
  24. +
+ +
+
+
+