fix: round item_wise_tax_detail in taxes
This commit is contained in:
parent
dfb5b88abb
commit
0ebcc2cf2c
@ -483,8 +483,13 @@ class calculate_taxes_and_totals(object):
|
|||||||
# store tax breakup for each item
|
# store tax breakup for each item
|
||||||
key = item.item_code or item.item_name
|
key = item.item_code or item.item_name
|
||||||
item_wise_tax_amount = current_tax_amount * self.doc.conversion_rate
|
item_wise_tax_amount = current_tax_amount * self.doc.conversion_rate
|
||||||
if tax.item_wise_tax_detail.get(key):
|
if frappe.flags.round_row_wise_tax:
|
||||||
item_wise_tax_amount += tax.item_wise_tax_detail[key][1]
|
item_wise_tax_amount = flt(item_wise_tax_amount, tax.precision("tax_amount"))
|
||||||
|
if tax.item_wise_tax_detail.get(key):
|
||||||
|
item_wise_tax_amount += flt(tax.item_wise_tax_detail[key][1], tax.precision("tax_amount"))
|
||||||
|
else:
|
||||||
|
if tax.item_wise_tax_detail.get(key):
|
||||||
|
item_wise_tax_amount += tax.item_wise_tax_detail[key][1]
|
||||||
|
|
||||||
tax.item_wise_tax_detail[key] = [tax_rate, flt(item_wise_tax_amount)]
|
tax.item_wise_tax_detail[key] = [tax_rate, flt(item_wise_tax_amount)]
|
||||||
|
|
||||||
|
|||||||
@ -480,8 +480,15 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let item_wise_tax_amount = current_tax_amount * this.frm.doc.conversion_rate;
|
let item_wise_tax_amount = current_tax_amount * this.frm.doc.conversion_rate;
|
||||||
if (tax_detail && tax_detail[key])
|
if (frappe.flags.round_row_wise_tax) {
|
||||||
item_wise_tax_amount += tax_detail[key][1];
|
item_wise_tax_amount = flt(item_wise_tax_amount, precision("tax_amount", tax));
|
||||||
|
if (tax_detail && tax_detail[key]) {
|
||||||
|
item_wise_tax_amount += flt(tax_detail[key][1], precision("tax_amount", tax));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (tax_detail && tax_detail[key])
|
||||||
|
item_wise_tax_amount += tax_detail[key][1];
|
||||||
|
}
|
||||||
|
|
||||||
tax_detail[key] = [tax_rate, flt(item_wise_tax_amount, precision("base_tax_amount", tax))];
|
tax_detail[key] = [tax_rate, flt(item_wise_tax_amount, precision("base_tax_amount", tax))];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user