Merge branch 'vapor/production' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into vapor/staging

This commit is contained in:
edmondlang
2025-02-01 00:28:25 +07:00
@@ -79,7 +79,21 @@
</tr>
@endif
@php
$displayedTotal = bcadd(bcadd(bcadd($displayedSubtotal, $serviceCharge, 5), $transaction->tax, 5), $voucherDiscount, 5);
$displayedSubtotal = is_numeric($displayedSubtotal) ? sprintf('%F', $displayedSubtotal) : '0';
$serviceCharge = is_numeric($serviceCharge) ? sprintf('%F', $serviceCharge) : '0';
$tax = is_numeric($transaction->tax) ? sprintf('%F', $transaction->tax) : '0';
$voucherDiscount = is_numeric($voucherDiscount) ? sprintf('%F', $voucherDiscount) : '0';
$displayedTotal = bcadd(
bcadd(
bcadd($displayedSubtotal, $serviceCharge, 5),
$tax,
5
),
$voucherDiscount,
5
);
$expectedTotal = bcadd(bcadd(bcadd($subtotal, $serviceCharge, 5), $transaction->tax, 5), $voucherDiscount, 5);
$discrepancy = bcsub($expectedTotal, $displayedTotal, 5);
$total = bcadd(bcadd(bcadd($subtotal, $serviceCharge, 5), $transaction->tax, 5), $voucherDiscount, 5);