From eb63166f392b52b4e1768073efd6d299684388ce Mon Sep 17 00:00:00 2001 From: Amritanshu <tanshu@gmail.com> Date: Tue, 27 May 2014 12:01:45 +0530 Subject: [PATCH] Fix: in the current sqlalchemy non-lowercased labels are not being quoted causing an error. --- brewman/views/reports/closing_stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brewman/views/reports/closing_stock.py b/brewman/views/reports/closing_stock.py index be847690..f36c298e 100644 --- a/brewman/views/reports/closing_stock.py +++ b/brewman/views/reports/closing_stock.py @@ -33,7 +33,7 @@ def report_data(request): def build_report(date): date = datetime.datetime.strptime(date, '%d-%b-%Y') - amount_sum = func.sum(Journal.debit * Inventory.quantity * Inventory.rate * (1 + Inventory.tax)).label('Amount') + amount_sum = func.sum(Journal.debit * Inventory.quantity * Inventory.rate * (1 + Inventory.tax)).label('amount') quantity_sum = func.sum(Journal.debit * Inventory.quantity).label('Quantity') query = DBSession.query(Product, quantity_sum, amount_sum) \ .join(Product.inventories).join(Inventory.voucher).join(Voucher.journals) \