fix: Do not apply shipping rule for POS transactions
(cherry picked from commit c0ebcfb39331caa678d36cc4694490a2363f10a0) # Conflicts: # erpnext/public/js/controllers/taxes_and_totals.js
This commit is contained in:
parent
ff7d81020c
commit
714fc08150
@ -307,6 +307,11 @@ class calculate_taxes_and_totals(object):
|
|||||||
self.doc.round_floats_in(self.doc, ["total", "base_total", "net_total", "base_net_total"])
|
self.doc.round_floats_in(self.doc, ["total", "base_total", "net_total", "base_net_total"])
|
||||||
|
|
||||||
def calculate_shipping_charges(self):
|
def calculate_shipping_charges(self):
|
||||||
|
|
||||||
|
# Do not apply shipping rule for POS
|
||||||
|
if self.doc.is_pos:
|
||||||
|
return
|
||||||
|
|
||||||
if hasattr(self.doc, "shipping_rule") and self.doc.shipping_rule:
|
if hasattr(self.doc, "shipping_rule") and self.doc.shipping_rule:
|
||||||
shipping_rule = frappe.get_doc("Shipping Rule", self.doc.shipping_rule)
|
shipping_rule = frappe.get_doc("Shipping Rule", self.doc.shipping_rule)
|
||||||
shipping_rule.apply(self.doc)
|
shipping_rule.apply(self.doc)
|
||||||
|
@ -272,7 +272,16 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
calculate_shipping_charges() {
|
calculate_shipping_charges() {
|
||||||
|
=======
|
||||||
|
calculate_shipping_charges: function() {
|
||||||
|
// Do not apply shipping rule for POS
|
||||||
|
if (this.frm.doc.is_pos) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> c0ebcfb393 (fix: Do not apply shipping rule for POS transactions)
|
||||||
frappe.model.round_floats_in(this.frm.doc, ["total", "base_total", "net_total", "base_net_total"]);
|
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)) {
|
if (frappe.meta.get_docfield(this.frm.doc.doctype, "shipping_rule", this.frm.doc.name)) {
|
||||||
this.shipping_rule();
|
this.shipping_rule();
|
||||||
|
Loading…
Reference in New Issue
Block a user