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:
Nabin Hait 2019-04-12 11:02:37 +05:30 committed by GitHub
commit 165e92ad5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 310 additions and 136 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1389,14 +1389,17 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
args: {
"master_doctype": frappe.meta.get_docfield(this.frm.doc.doctype, "taxes_and_charges",
this.frm.doc.name).options,
"master_name": this.frm.doc.taxes_and_charges,
"master_name": this.frm.doc.taxes_and_charges
},
callback: function(r) {
if(!r.exc) {
for (let tax of r.message) {
me.frm.add_child("taxes", tax);
me.frm.set_value("taxes", r.message);
if(me.frm.doc.shipping_rule) {
me.frm.script_manager.trigger("shipping_rule");
} else {
me.calculate_taxes_and_totals();
}
me.calculate_taxes_and_totals();
}
}
});