From bfa9702a233cf3630fe535722dc9d4fb716057b6 Mon Sep 17 00:00:00 2001 From: Tanshu Date: Wed, 16 Jan 2013 19:13:08 +0530 Subject: [PATCH] Ledger was wrongly adding the opening to the total of debit / credit, fixed. --- brewman/brewman/views/reports/ledger.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/brewman/brewman/views/reports/ledger.py b/brewman/brewman/views/reports/ledger.py index 18712f84..5fa416f3 100644 --- a/brewman/brewman/views/reports/ledger.py +++ b/brewman/brewman/views/reports/ledger.py @@ -101,22 +101,16 @@ def opening_balance(ledgerID, start_date): if opening is None or opening == 0: creditShow = "" debitShow = "" - debit = 0 - credit = 0 elif opening < 0: - credit = opening * -1 - debit = 0 creditShow = "\u20B9 {0:.2f}".format(opening * -1) debitShow = "" runningTotal = opening else: - debit = opening - credit = 0 debitShow = "\u20B9 {0:.2f}".format(opening) creditShow = "" runningTotal = opening running = "\u20B9 {0:,.2f}".format(abs(runningTotal)) + (' Dr' if runningTotal >= 0 else ' Cr') - return debit, credit, runningTotal, {'Date': start_date, 'Name': 'Opening Balance', 'Type': 'Opening Balance', + return 0, 0, runningTotal, {'Date': start_date, 'Name': 'Opening Balance', 'Type': 'Opening Balance', 'Narration': '', 'Debit': debitShow, 'Credit': creditShow, 'Running': running, 'Posted': True}