Re: Balance Report showing all accounts

82 views
Skip to first unread message

Craig Earls

unread,
Jun 9, 2012, 6:35:37 PM6/9/12
to ledge...@googlegroups.com
In the given ledger Asset:Checking is the top level tracked.
'Jumping' is a subaccount of Assets:Checking. You need another sub
account of Assets before ledger will roll it up.

If you use this:

2012-01-02 brown fox
Assets:Checking 10
Liabilities:Saving -10

2012-01-03 jumps over
Assets:Jumping 100
Liabilities:Saving:Sleeping -100


then `ledger bal` reports:


15:33:48 ~ > ledger -f test.dat bal
110 Assets
10 Checking
100 Jumping
-110 Liabilities:Saving
-100 Sleeping
--------------------
0

On Sat, Jun 9, 2012 at 5:38 AM, Siddharth Sharma <s...@svs.io> wrote:
> 2012-01-02 brown fox
>   Assets:Checking       10
>   Liabilities:Saving   -10
>
> 2012-01-03 jumps over
>   Assets:Checking:Jumping         100
>   Liabilities:Saving:Sleeping    -100



--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

Martin Michlmayr

unread,
Jun 9, 2012, 6:55:29 PM6/9/12
to ledge...@googlegroups.com
* Siddharth Sharma <s...@svs.io> [2012-06-09 05:38]:
> when I ask for the balance report, there is no entry for "Assets", only
> "Assets:Checking" and "Assets:Checking:Jumping". How can I get the balance
> report to also give me one line for "Assets", which is the sum total of all
> accounts below Assets?

You only get Assets:Checking because Assets:Checking and Assets are
the same in your case. You'd get Assets as a separate line if you had
multiple sub-accounts within Assets.

You could also use --depth 1 to just get Assets but then you don't see
details for sub-accounts.

--
Martin Michlmayr
http://www.cyrius.com/

Siddharth Sharma

unread,
Jun 10, 2012, 12:59:18 AM6/10/12
to ledge...@googlegroups.com
Thanks for the replies. It seems there's no way to have an "Assets" line in the tree of accounts shown for the ledger file in my example? Not a problem - I am working around the issue with some ruby code.

cheers
Sid

Craig Earls

unread,
Jun 10, 2012, 8:03:43 AM6/10/12
to ledge...@googlegroups.com
No. You did not understand, in your example there is no tree, only a
straight line. Since you no doubt will have more than one sub account
under assets your problem will go away with a more realistic example
file.

Siddharth Sharma

unread,
Jun 10, 2012, 3:17:08 PM6/10/12
to ledge...@googlegroups.com
On Sun, Jun 10, 2012 at 5:33 PM, Craig Earls <ende...@gmail.com> wrote:
No.  You did not understand,  in your example there is no tree, only a
straight line.  Since you no doubt will have more than one sub account
under assets your problem will go away with a more realistic example
file.

Ah, so we agree! There is no way to get a line for just Assets in my example. 

What if this is nested deep inside the tree? i.e. A:B:C:D:E and A:B:C:F. Now there's no line for D and one can expect this to happen even in a more realistic situation. In any case, I do not know beforehand what the structure of the file is going to be, so I would love for ledger to print all the "node" accounts separately so I can display them in a balance sheet or something similar, no matter the structure. I am working around this using a small wrapper script.

thanks for the replies.

John Wiegley

unread,
Jun 11, 2012, 1:30:48 AM6/11/12
to ledge...@googlegroups.com
>>>>> Siddharth Sharma <s...@svs.io> writes:

> Ah, so we agree! There is no way to get a line for just Assets in my
> example.

Just using --empty should do it.

John
Reply all
Reply to author
Forward
0 new messages