Add surcharge 3/4 to invoice total

This commit is contained in:
Hillel Coren 2022-04-14 14:44:12 +03:00
parent 5617ede0af
commit 77629a3849
1 changed files with 24 additions and 0 deletions

View File

@ -105,6 +105,14 @@ abstract class CalculateInvoiceTotal {
total += round(customSurcharge2, precision);
}
if (customSurcharge3 != 0.0 && customTaxes3) {
total += round(customSurcharge3, precision);
}
if (customSurcharge4 != 0.0 && customTaxes4) {
total += round(customSurcharge4, precision);
}
if (taxRate1 != 0) {
taxAmount =
_calculateTaxAmount(total, taxRate1, useInclusiveTaxes, precision);
@ -256,6 +264,14 @@ abstract class CalculateInvoiceTotal {
total += round(customSurcharge2, precision);
}
if (customSurcharge3 != 0.0 && customTaxes3) {
total += round(customSurcharge3, precision);
}
if (customSurcharge4 != 0.0 && customTaxes4) {
total += round(customSurcharge4, precision);
}
if (!usesInclusiveTaxes) {
final double taxAmount1 = round(total * taxRate1 / 100, precision);
final double taxAmount2 = round(total * taxRate2 / 100, precision);
@ -272,6 +288,14 @@ abstract class CalculateInvoiceTotal {
total += round(customSurcharge2, precision);
}
if (customSurcharge3 != 0.0 && !customTaxes3) {
total += round(customSurcharge3, precision);
}
if (customSurcharge4 != 0.0 && !customTaxes4) {
total += round(customSurcharge4, precision);
}
return total;
}