diff --git a/patches/october_2013/__init__.py b/patches/october_2013/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/patches/october_2013/fix_is_cancelled_in_sle.py b/patches/october_2013/fix_is_cancelled_in_sle.py new file mode 100644 index 00000000000..050c1e68cd1 --- /dev/null +++ b/patches/october_2013/fix_is_cancelled_in_sle.py @@ -0,0 +1,13 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes + +def execute(): + webnotes.conn.sql("""update `tabStock Ledger Entry` set is_cancelled = 'No' + where ifnull(is_cancelled, '') = ''""") + + webnotes.conn.sql("""update tabBin b set b.stock_uom = + (select i.stock_uom from tabItem i where i.name = b.item_code) + where b.created_on>='2013-09-01'""") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 6d1a084f68e..f228acf97e7 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -219,4 +219,5 @@ patch_list = [ "execute:webnotes.conn.set_value('Accounts Settings', None, 'frozen_accounts_modifier', 'Accounts Manager') # 2013-09-24", "patches.september_2013.p04_unsubmit_serial_nos", "patches.september_2013.p05_fix_customer_in_pos", + "patches.october_2013.fix_is_cancelled_in_sle", ] \ No newline at end of file diff --git a/public/js/stock_grid_report.js b/public/js/stock_grid_report.js index 8b79b5e1eea..46370d27f60 100644 --- a/public/js/stock_grid_report.js +++ b/public/js/stock_grid_report.js @@ -29,6 +29,8 @@ erpnext.StockGridReport = wn.views.TreeGridReport.extend({ if(add_qty) wh.fifo_stack.push([add_qty, sl.incoming_rate, sl.posting_date]); + + if(sl.serial_no) value_diff = this.get_serialized_value_diff(sl); } else { // outgoing if(sl.serial_no) { @@ -98,7 +100,7 @@ erpnext.StockGridReport = wn.views.TreeGridReport.extend({ $.each(sl.serial_no.trim().split("\n"), function(i, sr) { if(sr) { - value_diff += flt(me.serialized_buying_rates[sr.trim()]); + value_diff += flt(me.serialized_buying_rates[sr.trim().toLowerCase()]); } }); @@ -112,7 +114,7 @@ erpnext.StockGridReport = wn.views.TreeGridReport.extend({ if(sle.qty > 0 && sle.serial_no) { $.each(sle.serial_no.trim().split("\n"), function(i, sr) { if(sr && sle.incoming_rate !== undefined) { - serialized_buying_rates[sr.trim()] = flt(sle.incoming_rate); + serialized_buying_rates[sr.trim().toLowerCase()] = flt(sle.incoming_rate); } }); } diff --git a/stock/doctype/bin/bin.py b/stock/doctype/bin/bin.py index 788642fe4f9..c419cad43bb 100644 --- a/stock/doctype/bin/bin.py +++ b/stock/doctype/bin/bin.py @@ -16,7 +16,7 @@ class DocType: self.doclist = doclist def validate(self): - if not self.doc.stock_uom: + if self.doc.fields.get("__islocal") or not self.doc.stock_uom: self.doc.stock_uom = webnotes.conn.get_value('Item', self.doc.item_code, 'stock_uom') self.validate_mandatory() diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.py b/stock/doctype/stock_reconciliation/stock_reconciliation.py index 465edc490ad..9feb57e716b 100644 --- a/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -246,6 +246,7 @@ class DocType(StockController): "stock_uom": webnotes.conn.get_value("Item", row.item_code, "stock_uom"), "voucher_detail_no": row.voucher_detail_no, "fiscal_year": self.doc.fiscal_year, + "is_cancelled": "No" }) args.update(opts) self.make_sl_entries([args]) diff --git a/stock/page/stock_balance/stock_balance.js b/stock/page/stock_balance/stock_balance.js index 1bc5d1c6bc0..b45a610be88 100644 --- a/stock/page/stock_balance/stock_balance.js +++ b/stock/page/stock_balance/stock_balance.js @@ -126,10 +126,11 @@ erpnext.StockBalance = erpnext.StockAnalytics.extend({ } else { item.inflow_value += value_diff; } - } - item.closing_qty += qty_diff; - item.closing_value += value_diff; + item.closing_qty += qty_diff; + item.closing_value += value_diff; + } + } else { break; }