Correct third tax rate

This commit is contained in:
Hillel Coren 2022-02-11 15:29:47 +02:00
parent 0690362961
commit 68f1018c43
2 changed files with 6 additions and 1 deletions

View File

@ -259,8 +259,9 @@ abstract class CalculateInvoiceTotal {
if (!usesInclusiveTaxes) {
final double taxAmount1 = round(total * taxRate1 / 100, precision);
final double taxAmount2 = round(total * taxRate2 / 100, precision);
final double taxAmount3 = round(total * taxRate3 / 100, precision);
total += itemTax + taxAmount1 + taxAmount2;
total += itemTax + taxAmount1 + taxAmount2 + taxAmount3;
}
if (customSurcharge1 != 0.0 && !customTaxes1) {

View File

@ -843,6 +843,10 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
invoice.taxName3.isNotEmpty)
TaxRateDropdown(
onSelected: (taxRate) {
final updatedInvoice =
invoice.applyTax(taxRate, isThird: true);
print(
'## UPDATED\nRate 3: ${updatedInvoice.taxName3} => ${updatedInvoice.taxRate3}');
viewModel.onChanged(
invoice.applyTax(taxRate, isThird: true));
},