Performance in Ledger Report, footer was being generated on every voucher

This commit is contained in:
Tanshu 2013-02-20 20:15:53 +05:30
parent ac11133f97
commit 5ff11d9c6b
1 changed files with 6 additions and 6 deletions

View File

@ -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):