fix: stock ageing report not working (#23923)

This commit is contained in:
rohitwaghchaure 2020-11-17 12:10:27 +05:30 committed by GitHub
parent c72b693223
commit 7aa60d1dea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,8 @@ def execute(filters=None):
fifo_queue = sorted(filter(_func, item_dict["fifo_queue"]), key=_func)
details = item_dict["details"]
if not fifo_queue and (not item_dict.get("total_qty")): continue
if not fifo_queue: continue
average_age = get_average_age(fifo_queue, to_date)
earliest_age = date_diff(to_date, fifo_queue[0][1])