mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Fix for negative line item taxes
This commit is contained in:
parent
52ece5de9f
commit
4fd2329f6d
@ -508,13 +508,13 @@ class InvoiceRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($item['tax_rate1']) && Utils::parseFloat($item['tax_rate1']) > 0) {
|
$taxRate1 = Utils::parseFloat($item['tax_rate1']);
|
||||||
$invoiceItemTaxRate = Utils::parseFloat($item['tax_rate1']);
|
if ($taxRate1 != 0) {
|
||||||
$itemTax += round($lineTotal * $invoiceItemTaxRate / 100, 2);
|
$itemTax += round($lineTotal * $taxRate1 / 100, 2);
|
||||||
}
|
}
|
||||||
if (isset($item['tax_rate2']) && Utils::parseFloat($item['tax_rate2']) > 0) {
|
$taxRate2 = Utils::parseFloat($item['tax_rate2']);
|
||||||
$invoiceItemTaxRate = Utils::parseFloat($item['tax_rate2']);
|
if ($taxRate2 != 0) {
|
||||||
$itemTax += round($lineTotal * $invoiceItemTaxRate / 100, 2);
|
$itemTax += round($lineTotal * $taxRate2 / 100, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user