Merge pull request #17210 from rohitwaghchaure/fix_taxes_and_charges_are_adding_multiple_times
fix: Taxes and charges table not clear the existing rows if the template is changed
This commit is contained in:
commit
165e92ad5b
File diff suppressed because it is too large
Load Diff
@ -1389,14 +1389,17 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
args: {
|
args: {
|
||||||
"master_doctype": frappe.meta.get_docfield(this.frm.doc.doctype, "taxes_and_charges",
|
"master_doctype": frappe.meta.get_docfield(this.frm.doc.doctype, "taxes_and_charges",
|
||||||
this.frm.doc.name).options,
|
this.frm.doc.name).options,
|
||||||
"master_name": this.frm.doc.taxes_and_charges,
|
"master_name": this.frm.doc.taxes_and_charges
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
for (let tax of r.message) {
|
me.frm.set_value("taxes", r.message);
|
||||||
me.frm.add_child("taxes", tax);
|
|
||||||
|
if(me.frm.doc.shipping_rule) {
|
||||||
|
me.frm.script_manager.trigger("shipping_rule");
|
||||||
|
} else {
|
||||||
|
me.calculate_taxes_and_totals();
|
||||||
}
|
}
|
||||||
me.calculate_taxes_and_totals();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user