Flat balance overview calculates total wrong #94

Closed
simonmichael opened this Issue Apr 8, 2013 · 1 comment

Projects

None yet

1 participant

@simonmichael
Owner

Original author: nome...@gmail.com (December 03, 2012 21:49:45)

The flat view still adds the balances of subaccounts to parent accounts, but then counts it multiple times for the total balance:

$ cat test.ledger
2008/05/05 Desc1
Account1 "Stock1" 10 @ EUR 50
Account2 EUR -500.00

2008/05/19 Desc2
Account1 "Stock1" -10 @ EUR 60
Account2:Subaccount EUR 600

2012/12/01 Magical Money
Account2 EUR -100
Very:Deeply:Nested:Account EUR 100
$ hledger -f test.ledger balance -E
0 Account1
0 Account2
EUR 600.00 Subaccount

EUR 100.00 Very:Deeply:Nested:Account

      EUR 100.00

$ hledger -f test.ledger balance -E --flat
0 Account1
0 Account2
EUR 600.00 Account2:Subaccount
EUR 100.00 Very
EUR 100.00 Very:Deeply
EUR 100.00 Very:Deeply:Nested

EUR 100.00 Very:Deeply:Nested:Account

     EUR 1000.00

Yay, lots more money now!

As a suggestion: There could be two options, one whether to list accounts with their full names or indented (i.e. whether the view should be flat), and one whether to add child balances to parent accoutns (i.e. whether the balance should be calculated flatly).

Original issue: http://code.google.com/p/hledger/issues/detail?id=94

@simonmichael
Owner

From simon@joyful.com on December 04, 2012 01:08:57
Oops, thanks for catching that regression. Fixed in darcs.

@simonmichael simonmichael added the balance label May 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment