From 17183a7b585bdb0e763fb9a4f1006dc8e172b678 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Mon, 17 Jul 2023 12:59:42 +0800 Subject: [PATCH 1/2] fix invoice amount error --- resources/views/pages/pdfs/invoice.blade.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/resources/views/pages/pdfs/invoice.blade.php b/resources/views/pages/pdfs/invoice.blade.php index d6b2383d..daf2cfd7 100644 --- a/resources/views/pages/pdfs/invoice.blade.php +++ b/resources/views/pages/pdfs/invoice.blade.php @@ -180,15 +180,9 @@ $rounded_voucher = (float)number_format($voucher_discount, 2,'.',''); @endphp @if($transaction->booking()->first()->fix_currency_id !== 1) - @php - $rounded_subtotal = (float)number_format($subtotal, 2,'.',''); - @endphp - {{ number_format($rounded_subtotal + $service_charge + $tax + $rounded_voucher, 2) }} + {{ number_format( ((1/$transaction->currency_rate) * $transaction->amount) + $transaction->service_charge + $transaction->tax, 2) }} @else - @php - $rounded_transaction_amount = (float)number_format($transaction->amount, 2,'.',''); - @endphp - {{ number_format($rounded_transaction_amount + $service_charge + $tax + $rounded_voucher, 2) }} + {{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax, 2) }} @endif From 3f8902385715011a6bcb8cd1f8da67e94afc4024 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Mon, 17 Jul 2023 13:06:27 +0800 Subject: [PATCH 2/2] fix invoice amount error --- resources/views/pages/pdfs/invoice.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/pages/pdfs/invoice.blade.php b/resources/views/pages/pdfs/invoice.blade.php index daf2cfd7..e489df26 100644 --- a/resources/views/pages/pdfs/invoice.blade.php +++ b/resources/views/pages/pdfs/invoice.blade.php @@ -180,9 +180,9 @@ $rounded_voucher = (float)number_format($voucher_discount, 2,'.',''); @endphp @if($transaction->booking()->first()->fix_currency_id !== 1) - {{ number_format( ((1/$transaction->currency_rate) * $transaction->amount) + $transaction->service_charge + $transaction->tax, 2) }} + {{ number_format( ((1/$transaction->currency_rate) * $transaction->amount) + $transaction->service_charge + $transaction->tax + $rounded_voucher, 2) }} @else - {{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax, 2) }} + {{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax + $rounded_voucher, 2) }} @endif