John Wiegley writes:

>>>>>> Myles English <[email protected]> writes:
>
>> but how can I remove the Gum line and add it to the Food?, thus:
>
> For a balance report that would be --depth=2, but I'm not sure if it works
> that way in the register or not.  Certainly worth a feature request, if it
> doesn't.

Thanks John here is my feature request, what shall I do with it?

Feature request: collapse and accumulate sub accounts to hide unwanted
                 detail

Use case: For certain reports, I would like to:
           - hide the name of a sub account, and
           - add it to the parent account

For example:  Suppose I would like to conceal the amount I spend on gum
and add the value of the transaction to the Food account:

$ cat ~/tmp/gum_test.bat
2013-08-06 The Shop
    Expenses:Food                   £10.10
    Expenses:Food:Gum               £1.10
    Assets:Cash

2013-08-07 The Shop
    Expenses:Food                   £0.02
    Expenses:Food:Gum               £0.01 ;; following a collapse in gum prices
    Assets:Cash

The basic register report:

$ ledger reg -f ~/tmp/gum_test.bat          
2013-08-06 The Shop  Expenses:Food        £10.10      £10.10
                     Expenses:Food:Gum    £1.10       £11.20
                     Assets:Cash        £-11.20            0
2013-08-07 The Shop  Expenses:Food         £0.02       £0.02
                     Expenses:Food:Gum     £0.01       £0.03
                     Assets:Cash          £-0.03           0

This almost does it but doesn't accumulate the Gum entries into the Food
entries:

$ ledger reg -f ~/tmp/gum_test.bat --depth=2
2013-08-06 The Shop  Expenses:Food    £10.10   £10.10
                     Assets:Cash     £-11.20        0
2013-08-07 The Shop  Expenses:Food    £0.02     £0.02
                     Assets:Cash     £-0.03         0
 
The basic balance report can get the right totals:

$ ledger bal -f ~/tmp/gum_test.bat --depth=2   
             £-11.23  Assets:Cash
              £11.23  Expenses:Food
--------------------
                   0

It would be nice if the new feature could get results like this:

$ ledger reg -f ~/tmp/gum_test.bat --depth=2
2013-08-06 The Shop  Expenses:Food    £11.20   £11.20
                     Assets:Cash     £-11.20        0
2013-08-07 The Shop  Expenses:Food    £0.03     £0.03
                     Assets:Cash     £-0.03         0

Further considerations, what happens if the level (or depth) of the
required cut-off varies, i.e.

Expenses:Food
Expenses:Food:Gum
Expenses:Food:Nuts

and I want Nuts to be reported but want Gum to be hidden in Food.  Then
perhaps an option similar to --depth could apply a default for all
transactions unless an account has a depth configured by some other
method.

Thanks,
Myles

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to