Merge pull request #7082 from rohitwaghchaure/pos_qty_issues

[Fix] Wrong actual qty showing in POS
This commit is contained in:
Nabin Hait 2016-11-28 12:39:09 +05:30 committed by GitHub
commit 96be3dd4f4

View File

@ -246,6 +246,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
var me = this;
this.items = this.item_data;
this.actual_qty_dict = {};
if(load_doc) {
this.frm.doc = JSON.parse(localStorage.getItem('doc'));
}
@ -680,7 +682,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
item_code: d.item_code,
item_name: (d.item_name===d.item_code || !d.item_name) ? "" : ("<br>" + d.item_name),
qty: d.qty,
actual_qty: me.actual_qty,
actual_qty: me.actual_qty_dict[d.item_code] || 0,
projected_qty: d.projected_qty,
rate: format_number(d.rate, me.frm.doc.currency),
amount: format_currency(d.amount, me.frm.doc.currency)
@ -1083,9 +1085,11 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
get_actual_qty: function(item) {
this.actual_qty = 0.0;
var warehouse = this.pos_profile_data['warehouse'] || item.default_warehouse;
if(warehouse && this.bin_data[item.item_code]) {
this.actual_qty = this.bin_data[item.item_code][warehouse] || 0;
this.actual_qty_dict[item.item_code] = this.actual_qty
}
return this.actual_qty