Tax fixes
This commit is contained in:
parent
822c733d71
commit
1544e1fa91
|
|
@ -60,6 +60,7 @@ abstract class CalculateInvoiceTotal {
|
|||
lineItems.forEach((item) {
|
||||
final double taxRate1 = round(item.taxRate1, 3);
|
||||
final double taxRate2 = round(item.taxRate2, 3);
|
||||
final double taxRate3 = round(item.taxRate3, 3);
|
||||
|
||||
final lineTotal = getItemTaxable(item, total, precision);
|
||||
|
||||
|
|
@ -159,6 +160,7 @@ abstract class CalculateInvoiceTotal {
|
|||
final double itemDiscount = round(item.discount, precision);
|
||||
final double taxRate1 = round(item.taxRate1, 3);
|
||||
final double taxRate2 = round(item.taxRate2, 3);
|
||||
final double taxRate3 = round(item.taxRate3, 3);
|
||||
double lineTotal = qty * cost;
|
||||
|
||||
if (itemDiscount != 0) {
|
||||
|
|
@ -182,6 +184,9 @@ abstract class CalculateInvoiceTotal {
|
|||
if (taxRate2 != 0) {
|
||||
itemTax += round(lineTotal * taxRate2 / 100, precision);
|
||||
}
|
||||
if (taxRate3 != 0) {
|
||||
itemTax += round(lineTotal * taxRate3 / 100, precision);
|
||||
}
|
||||
});
|
||||
|
||||
if (discount != 0.0) {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,12 @@ class InvoiceItemListTile extends StatelessWidget {
|
|||
subtitle += ' • $taxRate2 ${invoiceItem.taxName2}';
|
||||
}
|
||||
|
||||
if (invoiceItem.taxRate3 != 0) {
|
||||
final taxRate3 = formatNumber(invoiceItem.taxRate3, context,
|
||||
formatNumberType: FormatNumberType.percent);
|
||||
subtitle += ' • $taxRate3 ${invoiceItem.taxName3}';
|
||||
}
|
||||
|
||||
final List<String> parts = [];
|
||||
if (invoiceItem.customValue1.isNotEmpty) {
|
||||
parts.add(formatCustomValue(
|
||||
|
|
|
|||
Loading…
Reference in New Issue