mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-28 14:18:24 +00:00
Merge pull request #28302 from nemesis189/shipping-rule-updation-error
fix: Shipping Rule picking up old net_rate
This commit is contained in:
@@ -81,6 +81,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
||||
this.initialize_taxes();
|
||||
this.determine_exclusive_rate();
|
||||
this.calculate_net_total();
|
||||
this.calculate_shipping_charges();
|
||||
this.calculate_taxes();
|
||||
this.manipulate_grand_total_for_inclusive_tax();
|
||||
this.calculate_totals();
|
||||
@@ -266,8 +267,13 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
||||
me.frm.doc.net_total += item.net_amount;
|
||||
me.frm.doc.base_net_total += item.base_net_amount;
|
||||
});
|
||||
}
|
||||
|
||||
calculate_shipping_charges() {
|
||||
frappe.model.round_floats_in(this.frm.doc, ["total", "base_total", "net_total", "base_net_total"]);
|
||||
if (frappe.meta.get_docfield(this.frm.doc.doctype, "shipping_rule", this.frm.doc.name)) {
|
||||
this.shipping_rule();
|
||||
}
|
||||
}
|
||||
|
||||
add_taxes_from_item_tax_template(item_tax_map) {
|
||||
|
||||
@@ -1085,16 +1085,8 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
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', ''));
|
||||
}
|
||||
else {
|
||||
me.calculate_taxes_and_totals();
|
||||
}
|
||||
}
|
||||
|
||||
set_margin_amount_based_on_currency(exchange_rate) {
|
||||
|
||||
Reference in New Issue
Block a user