fix: tax calc changes in js
This commit is contained in:
parent
3ead28906c
commit
c20258d2a3
@ -1387,9 +1387,6 @@ class PaymentEntry(AccountsController):
|
|||||||
def calculate_taxes(self):
|
def calculate_taxes(self):
|
||||||
self.total_taxes_and_charges = 0.0
|
self.total_taxes_and_charges = 0.0
|
||||||
self.base_total_taxes_and_charges = 0.0
|
self.base_total_taxes_and_charges = 0.0
|
||||||
frappe.flags.round_row_wise_tax = (
|
|
||||||
frappe.db.get_single_value("Accounts Settings", "round_row_wise_tax")
|
|
||||||
)
|
|
||||||
|
|
||||||
actual_tax_dict = dict(
|
actual_tax_dict = dict(
|
||||||
[
|
[
|
||||||
@ -1401,8 +1398,6 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
for i, tax in enumerate(self.get("taxes")):
|
for i, tax in enumerate(self.get("taxes")):
|
||||||
current_tax_amount = self.get_current_tax_amount(tax)
|
current_tax_amount = self.get_current_tax_amount(tax)
|
||||||
if frappe.flags.round_row_wise_tax:
|
|
||||||
current_tax_amount = flt(current_tax_amount, tax.precision("tax_amount"))
|
|
||||||
|
|
||||||
if tax.charge_type == "Actual":
|
if tax.charge_type == "Actual":
|
||||||
actual_tax_dict[tax.idx] -= current_tax_amount
|
actual_tax_dict[tax.idx] -= current_tax_amount
|
||||||
|
@ -185,7 +185,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
frappe.flags.round_off_applicable_accounts = [];
|
frappe.flags.round_off_applicable_accounts = [];
|
||||||
|
|
||||||
if (me.frm.doc.company) {
|
if (me.frm.doc.company) {
|
||||||
return frappe.call({
|
frappe.call({
|
||||||
"method": "erpnext.controllers.taxes_and_totals.get_round_off_applicable_accounts",
|
"method": "erpnext.controllers.taxes_and_totals.get_round_off_applicable_accounts",
|
||||||
"args": {
|
"args": {
|
||||||
"company": me.frm.doc.company,
|
"company": me.frm.doc.company,
|
||||||
@ -198,6 +198,11 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frappe.db.get_single_value("Accounts Settings", "round_row_wise_tax")
|
||||||
|
.then((round_row_wise_tax) => {
|
||||||
|
frappe.flags.round_row_wise_tax = round_row_wise_tax;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
determine_exclusive_rate() {
|
determine_exclusive_rate() {
|
||||||
@ -338,6 +343,9 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
$.each(me.frm.doc["taxes"] || [], function(i, tax) {
|
$.each(me.frm.doc["taxes"] || [], function(i, tax) {
|
||||||
// tax_amount represents the amount of tax for the current step
|
// tax_amount represents the amount of tax for the current step
|
||||||
var current_tax_amount = me.get_current_tax_amount(item, tax, item_tax_map);
|
var current_tax_amount = me.get_current_tax_amount(item, tax, item_tax_map);
|
||||||
|
if (frappe.flags.round_row_wise_tax) {
|
||||||
|
current_tax_amount = flt(current_tax_amount, precision("tax_amount", tax));
|
||||||
|
}
|
||||||
|
|
||||||
// Adjust divisional loss to the last item
|
// Adjust divisional loss to the last item
|
||||||
if (tax.charge_type == "Actual") {
|
if (tax.charge_type == "Actual") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user