From 677978dd00e92533d7897dec041a901c0e3cbba9 Mon Sep 17 00:00:00 2001 From: John Clarke Date: Fri, 12 Jun 2020 05:53:24 -0600 Subject: [PATCH] Update stock_ageing.py As reviewer Deepesh Garg advised thanks! batch[0] can be int of float - see line 49 - so change proposed cint to flt --- erpnext/stock/report/stock_ageing/stock_ageing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.py b/erpnext/stock/report/stock_ageing/stock_ageing.py index 53bdfb523d..eea2312a24 100644 --- a/erpnext/stock/report/stock_ageing/stock_ageing.py +++ b/erpnext/stock/report/stock_ageing/stock_ageing.py @@ -180,14 +180,14 @@ def get_fifo_queue(filters, sle=None): qty_to_pop = abs(d.actual_qty) while qty_to_pop: batch = fifo_queue[0] if fifo_queue else [0, None] - if 0 < cint(batch[0]) <= qty_to_pop: + if 0 < flt(batch[0]) <= qty_to_pop: # if batch qty > 0 # not enough or exactly same qty in current batch, clear batch - qty_to_pop -= cint(batch[0]) + qty_to_pop -= flt(batch[0]) transferred_item_details[(d.voucher_no, d.name)].append(fifo_queue.pop(0)) else: # all from current batch - cint(batch[0]) -= qty_to_pop + flt(batch[0]) -= qty_to_pop transferred_item_details[(d.voucher_no, d.name)].append([qty_to_pop, batch[1]]) qty_to_pop = 0