Tax Report calculating incorrectly when discount is applied #554
This commit is contained in:
parent
43ad767127
commit
1b3415bda8
|
|
@ -143,16 +143,6 @@ abstract class CalculateInvoiceTotal {
|
||||||
lineItems.forEach((invoiceItem) {
|
lineItems.forEach((invoiceItem) {
|
||||||
double lineTotal = invoiceItem.quantity * invoiceItem.cost;
|
double lineTotal = invoiceItem.quantity * invoiceItem.cost;
|
||||||
|
|
||||||
if (discount != 0) {
|
|
||||||
if (isAmountDiscount) {
|
|
||||||
if (total != 0) {
|
|
||||||
lineTotal -= round(lineTotal / total * discount, precision);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lineTotal -= round(lineTotal * discount / 100, precision);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (invoiceItem.discount != 0) {
|
if (invoiceItem.discount != 0) {
|
||||||
if (isAmountDiscount) {
|
if (isAmountDiscount) {
|
||||||
lineTotal -= invoiceItem.discount;
|
lineTotal -= invoiceItem.discount;
|
||||||
|
|
@ -164,7 +154,7 @@ abstract class CalculateInvoiceTotal {
|
||||||
total += lineTotal;
|
total += lineTotal;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (discount > 0) {
|
if (discount != 0) {
|
||||||
if (isAmountDiscount) {
|
if (isAmountDiscount) {
|
||||||
total -= discount;
|
total -= discount;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue