diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 9f7e2e1597..80b02eab72 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -508,13 +508,13 @@ class InvoiceRepository extends BaseRepository } } - if (isset($item['tax_rate1']) && Utils::parseFloat($item['tax_rate1']) > 0) { - $invoiceItemTaxRate = Utils::parseFloat($item['tax_rate1']); - $itemTax += round($lineTotal * $invoiceItemTaxRate / 100, 2); + $taxRate1 = Utils::parseFloat($item['tax_rate1']); + if ($taxRate1 != 0) { + $itemTax += round($lineTotal * $taxRate1 / 100, 2); } - if (isset($item['tax_rate2']) && Utils::parseFloat($item['tax_rate2']) > 0) { - $invoiceItemTaxRate = Utils::parseFloat($item['tax_rate2']); - $itemTax += round($lineTotal * $invoiceItemTaxRate / 100, 2); + $taxRate2 = Utils::parseFloat($item['tax_rate2']); + if ($taxRate2 != 0) { + $itemTax += round($lineTotal * $taxRate2 / 100, 2); } }