From e65a7208104b22f627b69cf954fbc7a9ca3bf839 Mon Sep 17 00:00:00 2001 From: Subin Tom Date: Tue, 9 Nov 2021 14:46:45 +0530 Subject: [PATCH] fix: Shipping Rule picking up old net_rate (cherry picked from commit c78b8b7897152ea5daba9bfa0005a294a40c5670) # Conflicts: # erpnext/public/js/controllers/taxes_and_totals.js # erpnext/public/js/controllers/transaction.js --- erpnext/public/js/controllers/taxes_and_totals.js | 7 +++++++ erpnext/public/js/controllers/transaction.js | 9 ++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index 019f3fbec12..7eb6f4c058a 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -266,7 +266,14 @@ erpnext.taxes_and_totals = erpnext.payments.extend({ }); frappe.model.round_floats_in(this.frm.doc, ["total", "base_total", "net_total", "base_net_total"]); +<<<<<<< HEAD }, +======= + if(frappe.meta.get_docfield(this.frm.doc.doctype,"shipping_rule",this.frm.doc.name)) { + this.shipping_rule() + } + } +>>>>>>> c78b8b7897 (fix: Shipping Rule picking up old net_rate) add_taxes_from_item_tax_template: function(item_tax_map) { let me = this; diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 555f8d04cc2..ad170e8a31c 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1065,17 +1065,16 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ return this.frm.call({ doc: this.frm.doc, method: "apply_shipping_rule", - callback: function(r) { - if(!r.exc) { - me.calculate_taxes_and_totals(); - } - } }).fail(() => this.frm.set_value('shipping_rule', '')); } +<<<<<<< HEAD else { me.calculate_taxes_and_totals(); } }, +======= + } +>>>>>>> c78b8b7897 (fix: Shipping Rule picking up old net_rate) set_margin_amount_based_on_currency: function(exchange_rate) { if (in_list(["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Purchase Invoice", "Purchase Order", "Purchase Receipt"]), this.frm.doc.doctype) {