diff --git a/public/js/stock_analytics.js b/public/js/stock_analytics.js index d6a994cd1c..c3ed1cb232 100644 --- a/public/js/stock_analytics.js +++ b/public/js/stock_analytics.js @@ -134,6 +134,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({ var data = wn.report_dump.data["Stock Ledger Entry"]; this.item_warehouse = {}; + this.serialized_buying_rates = this.get_serialized_buying_rates(); for(var i=0, j=data.length; i 0 && sle.serial_no) { + $.each(sle.serial_no.trim().split("\n"), function(i, sr) { + if(sr && sle.incoming_rate !== undefined) { + serialized_buying_rates[sr] = flt(sle.incoming_rate); + } + }); + } + }); + + return serialized_buying_rates; + }, }); \ No newline at end of file diff --git a/startup/report_data_map.py b/startup/report_data_map.py index ba3b546b2c..f914277cc3 100644 --- a/startup/report_data_map.py +++ b/startup/report_data_map.py @@ -86,8 +86,9 @@ data_map = { "order_by": "name" }, "Stock Ledger Entry": { - "columns": ["name", "posting_date", "posting_time", "item_code", "warehouse", "actual_qty as qty", - "voucher_type", "voucher_no", "ifnull(incoming_rate,0) as incoming_rate", "stock_uom"], + "columns": ["name", "posting_date", "posting_time", "item_code", "warehouse", + "actual_qty as qty", "voucher_type", "voucher_no", + "ifnull(incoming_rate,0) as incoming_rate", "stock_uom", "serial_no"], "conditions": ["ifnull(is_cancelled, 'No')='No'"], "order_by": "posting_date, posting_time, name", "links": { diff --git a/stock/page/stock_balance/stock_balance.js b/stock/page/stock_balance/stock_balance.js index 9494f0dde6..47a3344b29 100644 --- a/stock/page/stock_balance/stock_balance.js +++ b/stock/page/stock_balance/stock_balance.js @@ -99,6 +99,7 @@ erpnext.StockBalance = erpnext.StockAnalytics.extend({ var data = wn.report_dump.data["Stock Ledger Entry"]; this.item_warehouse = {}; + this.serialized_buying_rates = this.get_serialized_buying_rates(); for(var i=0, j=data.length; i