Register output formatting question...

68 views
Skip to first unread message

Doug Philips

unread,
Apr 9, 2012, 10:41:22 PM4/9/12
to ledge...@googlegroups.com
I'm still using 2.6, but if this can be done in 3, I'll upgrade! I've
looked over the docs from ledger-cli.org/docs.html and can't seem to
find what I'm looking for...

What I would like to see is a way to produce register output that is a
fusion of the normal ledger register output and the same result with
'-n' used.
That is, I would like to see the total of the transactions in the
entry as well as the broken-out values. I can't seem to find out what
it is that '-n' does, or how I can do that myself. Right now I'm
running the same register reports twice, once with -n and once without
and trying to read back and forth. For a few transactions, it isn't
too bad. I figure I have to be missing something, right?

Thanks!
--Doug
P.S. What I'd really love would be to have a total for the entry, as
well as subtotals based on (user-specifiable) account summaries.
so that Assets:Checking:Event:Date transactions within an entry are
all summarized and the Assets:Checking:Membership transactions within
an entry are all summarized, in addition to a summary of the deposits
and withdrawals. Yes, I need this because the bank shows a net amount
and I want to track the actual sub-amounts ($n for event fees
collected, $m for membership fees collected, all of which are
deposited and which the bank reports as one entry).

Craig Earls

unread,
Apr 9, 2012, 10:57:45 PM4/9/12
to ledge...@googlegroups.com
Can you post an example of what you want to see?  I have never used 2.6 and don't know the options, but I am pretty good with 3.0 format strings.


On Mon, Apr 9, 2012 at 19:41, Doug Philips <douglas...@gmail.com> wrote:
I'm still using 2.6, but if this can be done in 3, I'll upgrade! I've
looked over the docs from ledger-cli.org/docs.html and can't seem to
find what I'm looking for...
--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

Doug Philips

unread,
Apr 9, 2012, 11:26:59 PM4/9/12
to ledge...@googlegroups.com
Ok, here is an example (fixed width font needed):

Given normal register output:
(one entry shown, vastly summarized with two transactions where than
can be 6-12 of the same type):

2012/02/08 Deposits Assets:Checking:Memberships:2012 $fg.hi
$total1 ; name of member1
Assets:Checking:Memberships:2012 $fg.hi
$total2 ; name of member2
Assets:Checking:Event:A $jk.lm $total3
Assets:Checking:Event:B $jk.lm $total4


And then with -n:

2012/02/08 Deposits <Total> $nop.qr $total4


What I'd like to see is:
2012/02/08 Deposits Assets:Checking:Memberships:2012 $fg.hi
$total1 ; name of member1
Assets:Checking:Memberships:2012 $fg.hi
$total2 ; name of member2
Assets:Checking:Event:A $jk.lm $total3
Assets:Checking:Event:B $jk.lm $total4
<total> $nop.qr $total4


So I run the same register command twice, once without -n and with -n
and then try to line them up (or hand edit).
Thanks!
-Doug

P.S. I'd really really like to have subtotals for the 3rd level
accounts (configurable as to how deep to go to summarize) for each
entry, but one step at a time. :-)

Craig Earls

unread,
Apr 10, 2012, 12:02:32 AM4/10/12
to ledge...@googlegroups.com
I am not seeing what you want.  The default ledger register format gives something like this for entries with multiple accounts:

012/03/05 Pelican Parts        Expenses:Auto:Hobbies       $ 50.00      $ 50.00
                                Expenses:Auto:Hobbies       $ 62.50     $ 112.50
                                Expenses:Auto:Hobbies       $ 11.50     $ 124.00
                                Assets:VWCU:Joint         $ -124.00            0
2012/04/03 Pelican Parts        Expenses:Auto:Hobbies       $ 86.90      $ 86.90
                                Expenses:Auto:Hobbies        $ 7.50      $ 94.40
                                Expenses:Auto:Hobbies        $ 5.00      $ 99.40
                                Expenses:Auto:Hobbies      $ 158.00     $ 257.40
                                Expenses:Auto:Hobbies        $ 5.00     $ 262.40
                                Expenses:Auto:Hobbies        $ 7.50     $ 269.90
                                Expenses:Auto:Hobbies       $ 95.75     $ 365.65
                                Expenses:Auto:Hobbies       $ 18.75     $ 384.40
                                Assets:VWCU:Joint         $ -384.40            0

Doug Philips

unread,
Apr 10, 2012, 12:08:42 AM4/10/12
to ledge...@googlegroups.com
Right, except in this case I'm only getting a register report for the
Assets:Checking account (and sub-accounts).
The default ledger register will show how things balance to 0 for each
entry, but doesn't show running totals the way it does in my example.
So close and yet...
Thanks for trying to help, I think I'm not being clear enough though. :-(
-=Doug

John Wiegley

unread,
Apr 10, 2012, 1:09:14 AM4/10/12
to ledge...@googlegroups.com
>>>>> Doug Philips <douglas.philips-Re5...@public.gmane.org> writes:

> What I would like to see is a way to produce register output that is a
> fusion of the normal ledger register output and the same result with '-n'
> used. That is, I would like to see the total of the transactions in the
> entry as well as the broken-out values. I can't seem to find out what it is
> that '-n' does, or how I can do that myself. Right now I'm running the same
> register reports twice, once with -n and once without and trying to read
> back and forth. For a few transactions, it isn't too bad. I figure I have to
> be missing something, right?

There is no way presently to do what you're asking, either for 2.x or 3.0.

Feature requests in Bugzilla are always welcome! :)

> P.S. What I'd really love would be to have a total for the entry, as well as
> subtotals based on (user-specifiable) account summaries. so that
> Assets:Checking:Event:Date transactions within an entry are all summarized
> and the Assets:Checking:Membership transactions within an entry are all
> summarized, in addition to a summary of the deposits and withdrawals. Yes, I
> need this because the bank shows a net amount and I want to track the actual
> sub-amounts ($n for event fees collected, $m for membership fees collected,
> all of which are deposited and which the bank reports as one entry).

Are you sure it's register report you want, and not the balance report?

John

Doug Philips

unread,
Apr 10, 2012, 8:51:56 AM4/10/12
to ledge...@googlegroups.com
On Tue, Apr 10, 2012 at 01:09, John Wiegley <jwie...@gmail.com> wrote:
> There is no way presently to do what you're asking, either for 2.x or 3.0.
>
> Feature requests in Bugzilla are always welcome! :)

I started to look at the docs (v3) for Python, figuring I might be
able to use that.
As far as feature requests go, I'm not sure I have anything specific
enough, except for maybe 'make -n be just a short-cut for ....'
(except I'm not even sure what .... should be.


> Are you sure it's register report you want, and not the balance report?

I'm not sure, actually.
Partly, yes. Partly no.
More specifically, I just started (this calendar year) as treasurer
for a local non-profit club, and the previous treasurer used Excel
sheets to track everything, but it was only for one account.
However, the members are used to a treasurer's report where expenses
are broken down to the level of "we spent $$$ which was $$ for check
to person X for Y, $$ for check to group Z for ..." and then summaries
of income groups (except for income from dues where we want it broken
out by who it was who paid the dues and when).

I'm starting to think that ledger isn't the right tool in this case,
but then I remembered it was programmable with Python... :-) so I
hope it is the right tool. Otherwise it's back to a massive spread
sheet with all kinds of sub-totalling cells.

Thanks and sorry for the difficulties in explaining what I'm trying to do.

-=Doug

Craig Earls

unread,
Apr 10, 2012, 9:33:12 AM4/10/12
to ledge...@googlegroups.com
I think you want to look into ledger V3 metadata capabilities.  I don't completely understand what you want to do, but metadata allows you to slice and dice in quite complicated ways.


On Tue, Apr 10, 2012 at 05:51, Doug Philips <douglas...@gmail.com> wrote:

I'm starting to think that ledger isn't the right tool in this case,
but then I remembered it was programmable with Python... :-)  so I
hope it is the right tool. Otherwise it's back to a massive spread
sheet with all kinds of sub-totalling cells.

Thanks and sorry for the difficulties in explaining what I'm trying to do.

-=Doug



Simon Michael

unread,
Apr 13, 2012, 7:23:15 PM4/13/12
to ledge...@googlegroups.com
On 4/10/12 5:51 AM, Doug Philips wrote:
> More specifically, I just started (this calendar year) as treasurer
> for a local non-profit club, and the previous treasurer used Excel
> sheets to track everything, but it was only for one account.
> However, the members are used to a treasurer's report where expenses
> are broken down to the level of "we spent $$$ which was $$ for check
> to person X for Y, $$ for check to group Z for ..." and then summaries
> of income groups (except for income from dues where we want it broken
> out by who it was who paid the dues and when).

If you organised your accounts like:

expenses:PERSONORGROUP:PURPOSE

wouldn't a simple balance report give that info ?

Reply all
Reply to author
Forward
0 new messages