From b4cf29391bf0ff152a46469f626788bf99c17953 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 15 Jul 2019 18:58:06 +0530 Subject: [PATCH] fix: taxes sequence if shipping rule is set in the sales invoice (#18330) --- erpnext/public/js/controllers/transaction.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 79119b262ca..17fad54453b 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1290,11 +1290,14 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ }, callback: function(r) { if(!r.exc) { - me.frm.set_value("taxes", r.message); + if(me.frm.doc.shipping_rule && me.frm.doc.taxes) { + for (let tax of r.message) { + me.frm.add_child("taxes", tax); + } - if(me.frm.doc.shipping_rule) { - me.frm.script_manager.trigger("shipping_rule"); + refresh_field("taxes"); } else { + me.frm.set_value("taxes", r.message); me.calculate_taxes_and_totals(); } }