From 0b3c10601c6eedffcdfcbf2f91c4a238b2aa6ac9 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Mon, 13 Jan 2014 13:34:34 +0530 Subject: [PATCH 1/2] Increase and decrease quantity buttons in POS --- accounts/doctype/sales_invoice/pos.js | 39 ++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js index ce3784abd3..1d58f2d2dc 100644 --- a/accounts/doctype/sales_invoice/pos.js +++ b/accounts/doctype/sales_invoice/pos.js @@ -19,8 +19,10 @@ erpnext.POS = Class.extend({ \ \ \ - \ - \ + \ + \ + \ + \ \ \ \ @@ -357,8 +359,18 @@ erpnext.POS = Class.extend({ $(repl('\ \ - \ + \ + \ \ ', { @@ -370,6 +382,11 @@ erpnext.POS = Class.extend({ } )).appendTo($items); }); + + this.wrapper.find(".increase-qty, .decrease-qty").on("click", function() { + var item_code = $(this).closest("tr").attr("id"); + me.selected_item_qty_operation(item_code, $(this).attr("class")); + }); }, show_taxes: function() { var me = this; @@ -501,6 +518,22 @@ erpnext.POS = Class.extend({ this.frm.script_manager.trigger("calculate_taxes_and_totals"); this.refresh(); }, + selected_item_qty_operation: function(item_code, operation) { + var me = this; + var child = wn.model.get_children(this.frm.doctype + " Item", this.frm.doc.name, + this.frm.cscript.fname, this.frm.doctype); + + $.each(child, function(i, d) { + if (d.item_code == item_code) { + if (operation == "increase-qty") + d.qty += 1; + else if (operation == "decrease-qty") + d.qty != 1 ? d.qty -= 1 : d.qty = 1; + + me.refresh(); + } + }); + }, make_payment: function() { var me = this; var no_of_items = $(this.wrapper).find("#cart tbody tr").length; From 1e347910d5a7e30dea13883fa5f6b651efa93146 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Mon, 13 Jan 2014 19:07:07 +0600 Subject: [PATCH 2/2] bumped to version 3.6.0 --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 8499ee84d3..8e033d52a2 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "app_name": "ERPNext", - "app_version": "3.5.1", + "app_version": "3.6.0", "base_template": "app/portal/templates/base.html", "modules": { "Accounts": { @@ -74,5 +74,5 @@ "type": "module" } }, - "requires_framework_version": "==3.5.0" + "requires_framework_version": "==3.7.0" } \ No newline at end of file
ItemQtyItemQtyRate
%(item_code)s%(item_name)s\ +
\ + \ +
\ +
\ +
\ + \ +
\ +
%(amount)s
%(rate)s