I dunno if this is similar, but I found this a bit confusing.

Here's my sample.dat with just three entries and my ledger command line:
$ cat sample.dat
2009/01/01 Eat at Joe's
  Expenses:Food:Restaurant  $10.00
  Assets:Cash:Petty

2009/01/02 Grocery shopping
  Expenses:Food  $100.00
  Assets:Cash

2009/01/03 Grocery shopping
  Expenses:Food:  $1000
  Assets:Cash


$ ./ledger -f sample.dat bal
           $-1110.00  Assets:Cash
             $-10.00    Petty
            $1110.00  Expenses:Food
            $1000.00
              $10.00    Restaurant
--------------------
                   0

It appears that the trailing ':' on Account names creates a separate balance line which totals only (in this case) Expenses:Food (the parent account) but not any sub-accounts like Expenses:Food:Restaurant.

However, with Assets:Cash:Petty and Assets:Cash, that separate balance line is not created. I don't know which is the correct behavior, but it seems a bit inconsistent. This happens because I sometimes use tab- completion using ledger.el in emacs, and I sometimes type the account name manually.

I've also managed to get trailing spaces at the end of some of my accounts, which is more annoying for me. I need to look at my 'bal' output carefully, and then scrub my input file with a few query- replace-regexp.

I'm using Ledger master-0-gd0c47b1 on Mac OS, but ledger.el version 2.7

Hope that helps you track down what you want to find.

-Ben



On 2009-Jun-30, at 16:57, John Wiegley wrote:


On Jun 30, 2009, at 2:46 AM, Nguyen Thai Ngoc Duy wrote:

The first thing, 'ledger -d "T&l<=2" b' no longer works.

Value expressions have been rewritten. I believe the string you want now is:

 -d "total & depth <= 2"

The second thing is in "ledger b" output, if one account has only one
subaccount, the parent account is hidden even when the parent account
has some credit in it. It should not be hidden.

Can you use "print --anon" to print out your ledger file, then test with that data? If it still occurs, e-mail it to me and I will fix. I have been hunting down balance reporting errors lately.

Thanks,
 John

Reply via email to