From 5ff11d9c6b7e20a51de675a094bf7535fa1eb5bd Mon Sep 17 00:00:00 2001 From: Tanshu Date: Wed, 20 Feb 2013 20:15:53 +0530 Subject: [PATCH] Performance in Ledger Report, footer was being generated on every voucher --- brewman/brewman/views/reports/ledger.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/brewman/brewman/views/reports/ledger.py b/brewman/brewman/views/reports/ledger.py index 5fa416f3..c0704478 100644 --- a/brewman/brewman/views/reports/ledger.py +++ b/brewman/brewman/views/reports/ledger.py @@ -82,12 +82,12 @@ def build_report(request, info): 'Type': VoucherType.by_id(voucher.type).name, 'Narration': voucher.narration, 'Debit': debit, 'Credit': credit, 'Running': running, 'Posted': voucher.posted}) - info['Footer'] = {'Date': finish_date, 'Name': 'Closing Balance', 'Type': 'Closing Balance', - 'Narration': '', 'Debit': "\u20B9 {0:,.2f}".format(totalDebit), - 'Credit': "\u20B9 {0:,.2f}".format(totalCredit), - 'Running': "\u20B9 {0:,.2f}".format(abs(runningTotal)) + ( - ' Dr' if runningTotal >= 0 else ' Cr'), - 'Posted': True} + info['Footer'] = {'Date': finish_date, 'Name': 'Closing Balance', 'Type': 'Closing Balance', + 'Narration': '', 'Debit': "\u20B9 {0:,.2f}".format(totalDebit), + 'Credit': "\u20B9 {0:,.2f}".format(totalCredit), + 'Running': "\u20B9 {0:,.2f}".format(abs(runningTotal)) + ( + ' Dr' if runningTotal >= 0 else ' Cr'), + 'Posted': True} def opening_balance(ledgerID, start_date):