Minor fix

This commit is contained in:
Nabin Hait 2014-10-21 20:23:39 +05:30
parent 2d414706dc
commit 38265efc39

View File

@ -100,7 +100,7 @@ def get_fifo_rate(previous_stock_queue, qty):
"""get FIFO (average) Rate from Queue""" """get FIFO (average) Rate from Queue"""
if qty >= 0: if qty >= 0:
total = sum(f[0] for f in previous_stock_queue) total = sum(f[0] for f in previous_stock_queue)
return total and sum(f[0] * f[1] for f in previous_stock_queue) / flt(total) or 0.0 return sum(flt(f[0]) * flt(f[1]) for f in previous_stock_queue) / flt(total) if total else 0.0
else: else:
available_qty_for_outgoing, outgoing_cost = 0, 0 available_qty_for_outgoing, outgoing_cost = 0, 0
qty_to_pop = abs(qty) qty_to_pop = abs(qty)