From 1a4d77a962dd21b2e977554a873e38855f0ee6fa Mon Sep 17 00:00:00 2001 From: Saurabh Date: Thu, 8 Feb 2018 01:32:48 +0530 Subject: [PATCH] Fixes #12810 for Offline POS --- erpnext/accounts/page/pos/pos.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index d779de0da0..29f27fb70c 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -1177,8 +1177,17 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ $(this.wrapper).on("change", ".pos-item-disc", function () { var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code"); var discount = $(this).val(); - me.update_discount(item_code, discount) - me.update_value() + if(discount > 100){ + discount = $(this).val(''); + frappe.show_alert({ + indicator: 'red', + message: __('Discount amount cannot be greater than 100%') + }); + me.update_discount(item_code, discount); + }else{ + me.update_discount(item_code, discount); + me.update_value(); + } }) }, @@ -2006,4 +2015,4 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ frappe.throw(__("LocalStorage is full , did not save")) } } -}) +}) \ No newline at end of file