Hi Eben, Using account names is not the right solution for this problem; doing this will force your to create a new account for each new invoice. This is just not how accounts are meant to be used and these account names will become irrelevant as soon as the associated invoice is paid. Not a good idea. In Beancount there is no dedicated feature to do this. I've had the same question for a long while actually: though I don't currently run invoices and a company, having just 3 or 4 payables it can be a bit annoying to look through the journal of a receivables account and figure out which has been paid which hasn't, from the sum total. I just had an idea: you can build such a tracking feature in Beancount on top of the link attributes attached to transactions. What you would do is group linked transactions that occur in a "transfer account", that is, your payables account or your receivables account. If the sum of all balance changes for this list of entries does not add to zero, the transactions are marked as "pending". This solution work for payables and receivables. It will work with multiple payments or with groups of multiple invoices as well. So I've built an example plugin for this a few hours ago, just to test it out. I'm trying to think of a way to integrate this feature in mainline Beancount in the most reusable and least complicated way possible. Some thoughts: - Earlier today I wrote this only for a specific transfer account, e.g. you would have to say "Liabilities:AccountsPayable" is the account; I don't like that, the fact that I would have to specify one. For this project I really much prefer to design features which do not require any custom configuration, so I thought of this idea instead: given a set of entries, automatically compute the intersection of all of the common accounts of their postings. This list of common accounts now implicitly defines the transfer accounts. I think this makes sense. - Also, I originally wrote a dedicated script to list pending transactions. I just changed this into a Beancount plugin that just inserts a "#PENDING" tag to those incomplete transactions. This way those transactions automatically show up as a tag view in the web interface and you can e.g. view a balance sheet of all your unpaid transactions. If you run the file as a script it looks for those transactions with a #PENDING tag and spits them out. - Another idea, would be to introduce a special kind of "matching link", maybe with an alternative syntax, e.g., ^^da5f4404c77c instead of,^da5f4404c77c or perhaps simpler, to allow the user to specify a regexp to restrict which links are subjected to this pending detection. See example script here: https://hg.furius.ca/public/beancount/file/25adf321377b/src/python/beancount/plugins/tag_pending.py If you want to try this at home, save the example script to a file, clone Beancount, build it ("make build") and run this: cd beancount/src/python/beancount/plugins ./tag_pending.py /tmp/test.beancount You should get this output with the attached file, which is the pending transaction: Pending/incomplete transactions: 2013-03-30 * "Bill for gas" #PENDING ^invoice-562b4da33bd9 Expenses:Gas 204.20 USD Liabilities:AccountsPayable -204.20 USD I made this as a plugin, so you can also run it with the web interface, like this: bean-web --plugin=beancount.plugins.tag_pending /tmp/test.beancount For those who can't be bothered install it, I baked its output in attachment, using this command: bean-bake --plugin=beancount.plugins.tag_pending /tmp/test.beancount pending Unzip the file, navigate to index.html, click on #PENDING, then Journal, which should show only the pending transaction. Edit the test file various ways and reload your web page to experiment with changes (it reparses the file automatically on reload). Thoughts and ideas welcome,
--
---
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 ledger-cli+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Alex,
Can you describe in more detail how you'd like this to look like?
Here's what I think you're saying (please correct me if I'm wrong):
For this kind of input:
2014-05-11 open Liabilities:CreditCard BRL
2014-05-11 open Expenses:CoolStuff BRL,USD
2014-05-11 open Expenses:ForeignTax BRL
2014-05-11 * "Compra local"
Liabilities:CreditCard -102.39 BRL
Expenses:CoolStuff
2014-05-11 * "Compra global"
Liabilities:CreditCard -82.30 BRL @ 0.45 USD
Expenses:CoolStuff
You would like the transactions to get parsed into this:
2014-05-11 * "Compra local"
Liabilities:CreditCard -82.30 BRL @ 0.45 USD
Expenses:CoolStuff 37.0350 USD