Browse Source

[fix] fifo in stock ledger

develop
Nabin Hait 9 years ago
parent
commit
8142cd2865
  1. 5
      erpnext/stock/doctype/stock_entry/stock_entry.js
  2. 1
      erpnext/stock/stock_ledger.py
  3. 1
      erpnext/stock/utils.py

5
erpnext/stock/doctype/stock_entry/stock_entry.js

@ -133,11 +133,12 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
var me = this;
this.toggle_enable_bom();
return this.frm.call({
method: "get_production_order_details",
return frappe.call({
method: "erpnext.stock.doctype.stock_entry.stock_entry.get_production_order_details",
args: {production_order: this.frm.doc.production_order},
callback: function(r) {
if (!r.exc) {
me.frm.set_value(r.message);
if (me.frm.doc.purpose == "Material Transfer for Manufacture" && !me.frm.doc.to_warehouse)
me.frm.set_value("to_warehouse", r.message["wip_warehouse"]);
me.frm.set_value("from_bom", 1);

1
erpnext/stock/stock_ledger.py

@ -300,7 +300,6 @@ class update_entries_after(object):
# select first batch or the batch with same rate
batch = self.stock_queue[index]
if batch[0]:
if qty_to_pop >= batch[0]:
# consume current batch
qty_to_pop = qty_to_pop - batch[0]

1
erpnext/stock/utils.py

@ -133,7 +133,6 @@ def get_fifo_rate(previous_stock_queue, qty):
qty_to_pop = abs(qty)
while qty_to_pop and previous_stock_queue:
batch = previous_stock_queue[0]
if batch[0]:
if 0 < batch[0] <= qty_to_pop:
# if batch qty > 0
# not enough or exactly same qty in current batch, clear batch

Loading…
Cancel
Save