diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js
index ce3784abd31..1d58f2d2dc0 100644
--- a/accounts/doctype/sales_invoice/pos.js
+++ b/accounts/doctype/sales_invoice/pos.js
@@ -19,8 +19,10 @@ erpnext.POS = Class.extend({
\
\
\
- | Item | \
- Qty | \
+ Item | \
+ | \
+ Qty | \
+ | \
Rate | \
\
\
@@ -357,8 +359,18 @@ erpnext.POS = Class.extend({
$(repl('\
| %(item_code)s%(item_name)s | \
- \
+ \
+ \
+ \
+ | \
+ | \
+ \
+ \
+ \
+ \
+ | \
%(amount)s %(rate)s | \
',
{
@@ -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;