Merge pull request #1064 from akhileshdarjee/1310
[fix] [minor] stock related reports fixed for serialized item
This commit is contained in:
commit
b5a58c8a8f
@ -11,7 +11,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
|
|||||||
parent: $(wrapper).find('.layout-main'),
|
parent: $(wrapper).find('.layout-main'),
|
||||||
appframe: wrapper.appframe,
|
appframe: wrapper.appframe,
|
||||||
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
|
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
|
||||||
"Fiscal Year"],
|
"Fiscal Year", "Serial No"],
|
||||||
tree_grid: {
|
tree_grid: {
|
||||||
show: true,
|
show: true,
|
||||||
parent_field: "parent_item_group",
|
parent_field: "parent_item_group",
|
||||||
|
@ -34,11 +34,14 @@ erpnext.StockGridReport = wn.views.TreeGridReport.extend({
|
|||||||
if(add_qty)
|
if(add_qty)
|
||||||
wh.fifo_stack.push([add_qty, sl.incoming_rate, sl.posting_date]);
|
wh.fifo_stack.push([add_qty, sl.incoming_rate, sl.posting_date]);
|
||||||
} else {
|
} else {
|
||||||
|
// called everytime for maintaining fifo stack
|
||||||
|
var fifo_value_diff = this.get_fifo_value_diff(wh, sl);
|
||||||
|
|
||||||
// outgoing
|
// outgoing
|
||||||
if(sl.serial_no) {
|
if(sl.serial_no) {
|
||||||
var value_diff = -1 * this.get_serialized_value_diff(sl);
|
var value_diff = -1 * this.get_serialized_value_diff(sl);
|
||||||
} else if(is_fifo) {
|
} else if(is_fifo) {
|
||||||
var value_diff = this.get_fifo_value_diff(wh, sl);
|
var value_diff = fifo_value_diff;
|
||||||
} else {
|
} else {
|
||||||
// average rate for weighted average
|
// average rate for weighted average
|
||||||
var rate = (wh.balance_qty.toFixed(2) == 0.00 ? 0 :
|
var rate = (wh.balance_qty.toFixed(2) == 0.00 ? 0 :
|
||||||
@ -84,11 +87,6 @@ erpnext.StockGridReport = wn.views.TreeGridReport.extend({
|
|||||||
qty = qty - batch[0];
|
qty = qty - batch[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(qty) {
|
|
||||||
// msgprint("Negative values not allowed for FIFO valuation!\
|
|
||||||
// Item " + sl.item_code.bold() + " on " + dateutil.str_to_user(sl.posting_datetime).bold() +
|
|
||||||
// " becomes negative. Values computed will not be accurate.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset the updated stack
|
// reset the updated stack
|
||||||
wh.fifo_stack = fifo_stack.reverse();
|
wh.fifo_stack = fifo_stack.reverse();
|
||||||
|
@ -25,7 +25,7 @@ erpnext.StockAgeing = erpnext.StockGridReport.extend({
|
|||||||
page: wrapper,
|
page: wrapper,
|
||||||
parent: $(wrapper).find('.layout-main'),
|
parent: $(wrapper).find('.layout-main'),
|
||||||
appframe: wrapper.appframe,
|
appframe: wrapper.appframe,
|
||||||
doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Item Group", "Brand"],
|
doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Item Group", "Brand", "Serial No"],
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setup_columns: function() {
|
setup_columns: function() {
|
||||||
@ -175,7 +175,7 @@ erpnext.StockAgeing = erpnext.StockGridReport.extend({
|
|||||||
grid: { hoverable: true, clickable: true },
|
grid: { hoverable: true, clickable: true },
|
||||||
xaxis: {
|
xaxis: {
|
||||||
ticks: $.map(me.data, function(item, idx) { return [[idx+1, item.name]] }),
|
ticks: $.map(me.data, function(item, idx) { return [[idx+1, item.name]] }),
|
||||||
max: 20
|
max: 15
|
||||||
},
|
},
|
||||||
series: { downsample: { threshold: 1000 } }
|
series: { downsample: { threshold: 1000 } }
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ erpnext.StockLedger = erpnext.StockGridReport.extend({
|
|||||||
page: wrapper,
|
page: wrapper,
|
||||||
parent: $(wrapper).find('.layout-main'),
|
parent: $(wrapper).find('.layout-main'),
|
||||||
appframe: wrapper.appframe,
|
appframe: wrapper.appframe,
|
||||||
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand"],
|
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", "Serial No"],
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ erpnext.StockLevel = erpnext.StockGridReport.extend({
|
|||||||
parent: $(wrapper).find('.layout-main'),
|
parent: $(wrapper).find('.layout-main'),
|
||||||
appframe: wrapper.appframe,
|
appframe: wrapper.appframe,
|
||||||
doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Production Order",
|
doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Production Order",
|
||||||
"Material Request Item", "Purchase Order Item", "Sales Order Item", "Brand"],
|
"Material Request Item", "Purchase Order Item", "Sales Order Item", "Brand", "Serial No"],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.wrapper.bind("make", function() {
|
this.wrapper.bind("make", function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user