Ledger was wrongly adding the opening to the total of debit / credit, fixed.

This commit is contained in:
Tanshu 2013-01-16 19:13:08 +05:30
parent a9176f783d
commit bfa9702a23
1 changed files with 1 additions and 7 deletions

View File

@ -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}