Fix an error with refund for transaction that used a voucher earlier, get discount amount for voucher so to get details breakdown

This commit is contained in:
Dillon Ngo
2024-08-12 22:29:04 +08:00
parent cfcc5fbe26
commit 13dd19d0a1
@@ -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();