* Esben Stien <[email protected]> [2014-05-10 22:54]:
> No actually, I figured it out. I could just append the invoice number to
> the account.
I agree with Russell Adams that I wouldn't put such information in the
account name. Unfortunately, I cannot quite articulate why, but
experience has shown me that it's a bad approach. (Alas, I don't have
any examples showing why.)
Yes, what you're looking for is common and I'm not sure if a ledger
query can do it. I think we need more business logic on top of (or
in) ledger.
Thinking about it, I believe the --pivot option might do everything
(or almost everything) you want.
Take this example:
2011-01-01 * Opening balance
Assets:Cash 25.00 GBP
Equity:Opening balance -25.00 GBP
2011-02-01 * Sell to customer AAA
; Customer: AAA
; Invoice: 101
Assets:Receivables 10.00 GBP
Income:Sale -10.00 GBP
2011-02-02 * Sell to customer BBB
; Customer: BBB
; Invoice: 102
Assets:Receivables 11.00 GBP
Income:Sale -11.00 GBP
2011-02-03 * Sell to customer AAA
; Customer: AAA
; Invoice: 103
Assets:Receivables 12.00 GBP
Income:Sale -12.00 GBP
2011-02-03 * Money received from customer AAA for invoice 101
; Customer: AAA
; Invoice: 101
Assets:Cash 10.00 GBP
Assets:Receivables -10.00 GBP
Now you can see how much each customer owes you:
ledger -f d bal assets:receivables --pivot Customer
23.00 GBP Customer
12.00 GBP AAA:Assets:Receivables
11.00 GBP BBB:Assets:Receivables
--------------------
23.00 GBP
And you can see which invoices haven't been paid yet:
ledger -f d bal assets:receivables --pivot Invoice
23.00 GBP Invoice
11.00 GBP 102:Assets:Receivables
12.00 GBP 103:Assets:Receivables
--------------------
23.00 GBP
But I'm not sure if there's a way to see a list of open invoices for each
customer, i.e. a pivot on both Customer and Invoice.
John, does that sound like a reasonable feature request or is there a
way to do this already?
--
Martin Michlmayr
http://www.cyrius.com/
--
---
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/d/optout.