From a32e57ae82a5eba8c8aadc611f9b922d1b41298d Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 8 Mar 2018 16:21:13 +0530 Subject: [PATCH] [Fix] Discount in offline POS is enabled even is it's disabled in POS Profile (#13233) --- erpnext/accounts/page/pos/pos.js | 6 +++-- erpnext/public/js/pos/pos.html | 28 +++++++++++--------- erpnext/public/js/pos/pos_selected_item.html | 2 +- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 29f27fb70c..fe71f28e61 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -393,7 +393,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.frm = {} this.frm.doc = this.doc this.set_transaction_defaults("Customer"); - this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false, + this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false; + this.frm.doc["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false; this.wrapper.html(frappe.render_template("pos", this.frm.doc)); this.make_search(); this.make_customer(); @@ -1256,6 +1257,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ $(this.wrapper).find('.selected-item').empty(); if(this.child_doc.length) { this.child_doc[0]["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false, + this.child_doc[0]["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false; this.selected_row = $(frappe.render_template("pos_selected_item", this.child_doc[0])) $(this.wrapper).find('.selected-item').html(this.selected_row) } @@ -1683,7 +1685,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ setInterval(function () { me.freeze_screen = false; me.sync_sales_invoice() - }, 60000) + }, 180000) }, sync_sales_invoice: function () { diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html index 1d9fd7c20f..af90756963 100644 --- a/erpnext/public/js/pos/pos.html +++ b/erpnext/public/js/pos/pos.html @@ -37,20 +37,22 @@
-
-
-
{%= __("Discount") %}
-