diff --git a/resources/views/pages/pdfs/invoice.blade.php b/resources/views/pages/pdfs/invoice.blade.php index 0d39923a..782d0687 100644 --- a/resources/views/pages/pdfs/invoice.blade.php +++ b/resources/views/pages/pdfs/invoice.blade.php @@ -74,6 +74,7 @@ @php $subtotal = 0; @endphp + @foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail) @php $exactUnitPrice = bcdiv($transaction_detail->price, $transaction->currency_rate, 5); // Retain precision with 5 decimals @@ -95,10 +96,14 @@ @endforeach
+ @php + $voucherDiscount = getVoucherDiscount($voucher_redemption); + $subtotalWithDiscount = bcsub($subtotal, $voucherDiscount, 5); // Use bcsub to subtract + @endphp