How to do cross account budgets with beancount?

617 views
Skip to first unread message

victor....@gmail.com

unread,
Jun 20, 2016, 5:37:43 PM6/20/16
to Beancount
Hi! I'm new to beancount, and accounting in general actually. I'm wondering
what's the proper way to handle the following scenario.

I want to budget any income every time it comes in. As a simplified example,
let's say I get 2000 EUR, I want to put 200 EUR of that into savings, anticipate
700 EUR of rent for this month, and the rest is free to be spent how I want. If
I have one main checking account, I can do something like that with a
sub-account for each budget:

2016-01-01 * "Salary"
   
Income:Salary                    -1000 EUR
   
Assets:Bank:Budget:Savings         200 EUR
   
Assets:Bank:Budget:Rent            700 EUR
   
Assets:Bank:Budget:Free  

2016-01-15 * "Paying rent"
   
Assets:Bank:Budget:Rent           -700 EUR
   
Expenses:Rent

2016-01-20 * "Buying video games"
   
Assets:Bank:Budget:Free         -15.99 EUR
   
Expenses:VideoGames


But what if my budgets and savings are spread over multiple accounts? For
example, I may have 500 EUR in savings, where 200 EUR is in bank A and the other
300 are in bank B. (This is a simplified example, but makes sense when you
consider different interest rates and maximum balances in various saving
accounts). I'd rather not have multiple budget accounts, depending in which bank
they are in... The notation would get very long, and I would not immediately see
how much I have in savings, I would have to do the sum myself, which is silly I
guess.

What I really want is something like this, where a transaction can exist in
"two dimensions":

2016-01-01 * "Salary"
   
; In dimension 1 ("real money")
   
Income:Salary                    -1000 EUR
   
Assets:BankA:Checking              450 EUR ; some arbitrary split
   
Assets:BankB:Checking              550 EUR

   
; In dimension 2 ("budgets")
   
Income:Salary                    -1000 EUR
   
Budget:Savings                     200 EUR
   
Budget:Rent                        700 EUR
   
Budget:Free

2016-01-15 * "Paying rent"
   
; In dimension 1 ("real money")
   
Assets:BankA:Cheking              -700 EUR
   
Expenses:Rent

   
; In dimension 2 ("budgets")
   
Income:Salary                    -1000 EUR
   
Budget:Rent                       -700 EUR
   
Expenses:Rent

2016-01-20 * "Buying video games"
   
; In dimension 1 ("real money")
   
Assets:BankB:Checking           -15.99 EUR
   
Expenses:VideoGames

   
; In dimension 2 ("budgets")
   
Budget:Free                     -15.99 EUR
   
Expenses:VideoGames

I don't know if it makes sense. But basically I would like to be able to have
say 500 EUR of savings, and have beancount tell me that it's made of 200 in bank
A and 300 in bank B. I'd like to be able to move all to bank A, or all to bank B
without that changing the total savings balance. All with multiple budgets,
multiple accounts (multiple currencies if possible) and strong zero-sum
transactions guarantees. Oh and a nice syntax please :-)

Although I guess that if I have two accounts sharing two budgets, it's kind of
impossible to tell how both are split because there are many solutions:

        Budget 1  Budget 2
Bank A        A1        A2
Bank B        B1        B2

As long as A1 + A2 == balance in bank A,
and        B1 + B2 == balance in bank B,
and        A1 + B1 == balance in budget 1,
and        A2 + B2 == balance in budget 2,

all is good. And there are infinity solution to that, for example both of those
are valid:

        Budget 1  Budget 2  | Total
Bank A        10       440  |  450
Bank B        90       460  |  550
------      ----      ----    ----
Total        100       900  | 1000

       
Budget 1  Budget 2  | Total
Bank A       100       350  | 450
Bank B         0       550  | 550
------      ----      ----    ----
Total        100       900  | 1000

Multidimentional accounting? Does that make any sense?
Is that at all possible with beancount? Other accounting software?

Victor

Daniël Bos

unread,
Jun 20, 2016, 9:49:31 PM6/20/16
to Beancount

Hi Victor,

We're prototyping budgeting in fava, the beancount web interface. You might want to look at that and see if it solves your needs. Feature requests and bug reports are welcome!

See here for the documentation:
https://github.com/aumayr/fava/blob/master/fava/docs/budgets.md


--
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+...@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/94fab663-403d-49a6-8d78-84ac059b23b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Best regards,
Daniël Bos

Your government is reading your email. Slow them down with encryption.

My public key: http://goo.gl/gms497 (4096 bit RSA, id EF2D5D91)
Fingerprint  : D8D0 9FBE F075 F709 7B52  2F73 326C 2123 EF2D 5D91

Martin Blais

unread,
Jun 20, 2016, 11:47:47 PM6/20/16
to Beancount
These account names you can think of them as containing columns for a database roiw, which can be filtered and mapped.
Here's an idea to explore: allow account names which contain either the bank, the budget, or both, and then create plugins to allocate to either the bank or the budget.



--

Simon Michael

unread,
Jun 22, 2016, 9:59:14 AM6/22/16
to bean...@googlegroups.com, hle...@googlegroups.com
On 6/20/16 2:37 PM, victor....@gmail.com wrote:
> Hi! I'm new to beancount, and accounting in general actually. I'm wondering
> what's the proper way to handle the following scenario.
>
> I want to budget any income every time it comes in. As a simplified example,
> let's say I get 2000 EUR, I want to put 200 EUR of that into savings,
> anticipate
> 700 EUR of rent for this month, and the rest is free to be spent how I
> want. If
> I have one main checking account, I can do something like that with a
> sub-account for each budget:
>
> 2016-01-01 * "Salary"
> Income:Salary -1000 EUR
> Assets:Bank:Budget:Savings 200 EUR
> Assets:Bank:Budget:Rent 700 EUR
> Assets:Bank:Budget:Free
>
> 2016-01-15 * "Paying rent"
> Assets:Bank:Budget:Rent -700 EUR
> Expenses:Rent
>
> 2016-01-20 * "Buying video games"
> Assets:Bank:Budget:Free -15.99 EUR
> Expenses:VideoGames
>
>
> But what if my budgets and savings are spread over multiple accounts?

I do similar envelope budgeting, though in two main checking accounts.
See http://plaintextaccounting.org/#budgeting -> envelope budgeting with
plain transactions for an example. In the amazon txn at line 130, you'll
see extra postings to adjust the budget in the correct account (using
bracketed virtual postings to differentiate them, but regular postings
are also fine). Maybe this give some ideas ?



Reply all
Reply to author
Forward
0 new messages