[fix] Get fifo rate only qty exists in batch
This commit is contained in:
parent
845bbe3e27
commit
7edb951fdb
@ -300,7 +300,7 @@ class update_entries_after(object):
|
|||||||
|
|
||||||
# select first batch or the batch with same rate
|
# select first batch or the batch with same rate
|
||||||
batch = self.stock_queue[index]
|
batch = self.stock_queue[index]
|
||||||
|
if batch[0]:
|
||||||
if qty_to_pop >= batch[0]:
|
if qty_to_pop >= batch[0]:
|
||||||
# consume current batch
|
# consume current batch
|
||||||
qty_to_pop = qty_to_pop - batch[0]
|
qty_to_pop = qty_to_pop - batch[0]
|
||||||
|
@ -133,6 +133,7 @@ def get_fifo_rate(previous_stock_queue, qty):
|
|||||||
qty_to_pop = abs(qty)
|
qty_to_pop = abs(qty)
|
||||||
while qty_to_pop and previous_stock_queue:
|
while qty_to_pop and previous_stock_queue:
|
||||||
batch = previous_stock_queue[0]
|
batch = previous_stock_queue[0]
|
||||||
|
if batch[0]:
|
||||||
if 0 < batch[0] <= qty_to_pop:
|
if 0 < batch[0] <= qty_to_pop:
|
||||||
# if batch qty > 0
|
# if batch qty > 0
|
||||||
# not enough or exactly same qty in current batch, clear batch
|
# not enough or exactly same qty in current batch, clear batch
|
||||||
|
Loading…
x
Reference in New Issue
Block a user