fix invoice decimals bug

This commit is contained in:
edmondlang
2023-07-10 21:59:08 +08:00
parent 74cf3acd3e
commit 46ae50b569
+11 -5
View File
@@ -174,15 +174,21 @@
<td colspan="4"></td>
<td class="right middle">Total</td>
<td class="total right middle">
@php
$service_charge = (float)number_format($transaction->service_charge, 2,'.','');
$tax = (float)number_format($transaction->tax, 2,'.','');
$rounded_voucher = (float)number_format($voucher_discount, 2,'.','');
@endphp
@if($transaction->booking()->first()->fix_currency_id !== 1)
@php
$service_charge = (float)number_format($transaction->service_charge, 2,'.','');
$tax = (float)number_format($transaction->tax, 2,'.','');
$rounded_voucher = (float)number_format($voucher_discount, 2,'.','');
$rounded_subtotal = (float)number_format($subtotal, 2,'.','');
@endphp
{{ number_format($subtotal + $service_charge + $tax + $rounded_voucher, 2) }}
{{ number_format($rounded_subtotal + $service_charge + $tax + $rounded_voucher, 2) }}
@else
{{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax + $voucher_discount, 2) }}
@php
$rounded_transaction_amount = (float)number_format($transaction->amount, 2,'.','');
@endphp
{{ number_format($rounded_transaction_amount + $service_charge + $tax + $rounded_voucher, 2) }}
@endif
</td>
</tr>