2000-01-01 open Assets:Checking USD2000-01-01 open Assets:Receivables USD2000-01-01 open Expenses:Billable:Client1 USD2000-01-01 open Expenses:Billable:Client2 USD2000-01-01 open Expenses:Other USD
2016-01-01 * "Amazon.com" "purchase on behalf of self, client 1, and client 2" Assets:Checking -6.00 USD Expenses:Billable:Client1 1.00 USD invoice: "100" Expenses:Billable:Client2 2.00 USD invoice: "200" Expenses:Other 3.00 USD
2016-01-02 * "generate invoice for client 1" invoice: "100" Expenses:Billable:Client1 -1.00 USD Assets:Receivables
2016-01-02 * "generate invoice for client 2" invoice: "200" Expenses:Billable:Client1 -2.00 USD Assets:Receivables
2016-01-03 * "payment received from client 1" #payment invoice: "100" Assets:Receivables -1.00 USD Assets:Checking2016-01-03 * "payment received from client 2" #payment invoice: "200" Assets:Receivables -2.00 USD Assets:Checking
select date, description, position, balance where any_meta('invoice') = '200' and ('payment' in tags)
You can add a clause on the account name to further restrict.
Using ANY_META() causes a lookup to occur on both the posting and the transaction's metadata (falling back on transaction if posting lookup fails).
Finally, you can also easily script any kind of filter you'd like if it's not there. See this doc for details:
--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/16380e36-e03e-4d0c-a09e-206382abd59f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.