> I want to use beancount to maintain customers and vendors, and so want to be able to allocate payments to invoices (and, by extension, use it to reconcile bank accounts). > I'm not sure if this has been solved - I couldn't find anything relating to it on Google. > In essence, this would mean that each transaction has a record showing how much of the transaction has been posted and to where. > For example, a payment of £20 against an invoice of £30 would have a record on both the invoice transaction and payment transaction showing £20. The payment is then fully allocated but the invoice is only partly allocated. This would allow reports to show that £10 was left. > Perhaps this could be done with tags? Has this been solved previously?
Easy. ; -*- mode: beancount -*- plugin "beancount.plugins.auto_accounts" 2016-09-01 * "Invoicing client A" ^invoice-00000001 Assets:AccountsReceivable:ClientA 30.00 GBP Income:Work:Services 2016-09-20 * "Invoicing client B" ^invoice-00000002 Assets:AccountsReceivable:ClientB 40.00 GBP Income:Work:Services 2016-10-01 * "Invoicing client A" ^invoice-00000003 Assets:AccountsReceivable:ClientA 12.00 GBP Income:Work:Services 2016-09-20 * "Client A" "Payment for invoice" ^invoice-00000001 Assets:AccountsReceivable:ClientA -20.00 GBP Assets:Checking You can view how much your liability from this client is, over all invoices: bean-query stalbansrfctreasurer.beancount "select sum(position) where account = 'Assets:AccountsReceivable:ClientA'" sum_posit --------- 22.00 GBP Or you can produce this for each of your clients in one go: bean-query stalbansrfctreasurer.beancount "select leaf(account) as client, sum(position) as balance where account ~ 'Assets:AccountsReceivable' group by 1" client balance ------- --------- ClientB 40.00 GBP ClientA 22.00 GBP Finally, if you'd like to isolate that particular invoice, use links or tags to segregate all the transactions for a particular invoice: bean-query stalbansrfctreasurer.beancount "select date, description, position, balance where account ~ 'Assets:AccountsReceivable:ClientA' and ('invoice-00000001' in links) " date description position balance ---------- ------------------------------ ---------- --------- 2016-09-01 Invoicing client A 30.00 GBP 30.00 GBP 2016-09-20 Client A | Payment for invoice -20.00 GBP 10.00 GBP If you invoice payments are always for the total amount owed, you may be able to write a plugin which automatically pairs them up with tags. See this plugin for some ideas: https://bitbucket.org/blais/beancount/src/ac55a614f17e75573832337a30c5e11be9c1d5c1/src/python/beancount/plugins/tag_pending.py?at=upload_using_v4_sheets_api&fileviewer=file-view-default On Tue, Dec 13, 2016 at 7:42 AM, <stalbansrfctreasu...@gmail.com> wrote: > Hi > I want to use beancount to maintain customers and vendors, and so want to > be able to allocate payments to invoices (and, by extension, use it to > reconcile bank accounts). > I'm not sure if this has been solved - I couldn't find anything relating > to it on Google. > In essence, this would mean that each transaction has a record showing how > much of the transaction has been posted and to where. > For example, a payment of £20 against an invoice of £30 would have a > record on both the invoice transaction and payment transaction showing £20. > The payment is then fully allocated but the invoice is only partly > allocated. This would allow reports to show that £10 was left. > Perhaps this could be done with tags? Has this been solved previously? > Thanks > Paul > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to beancount@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/beancount/27d3787d-1814-4389-b931-0123e211e5c1%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/27d3787d-1814-4389-b931-0123e211e5c1%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to beancount@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhO4Nf3g14HGfDObNUA1KGZZrDTDsDyWTUTDTExGfFWUEg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.