From 2c714dfe984c22a9e743f69339a720c787399c8b Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Mon, 14 Oct 2013 15:16:21 +0530 Subject: [PATCH] Fixed: Issues were negative in Stock Movement --- brewman/views/reports/stock_movement.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brewman/views/reports/stock_movement.py b/brewman/views/reports/stock_movement.py index a9f527a2..0e2ed106 100644 --- a/brewman/views/reports/stock_movement.py +++ b/brewman/views/reports/stock_movement.py @@ -64,10 +64,10 @@ def build_stock_movement(start_date, finish_date): .group_by(Product).all() for product, quantity in issues: if product.id in dict: - dict[product.id]['Issue'] = quantity + dict[product.id]['Issue'] = quantity * -1 else: dict[product.id] = {'ProductID': product.id, 'Name': product.full_name, 'Group': product.product_group.name, - 'Issue': quantity} + 'Issue': quantity * -1} list = [value for key, value in dict.items()] list = sorted(list, key=lambda x: x['Name'].lower())