Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding budgeting #8

Closed
saesh opened this issue Jan 5, 2020 · 10 comments
Closed

Adding budgeting #8

saesh opened this issue Jan 5, 2020 · 10 comments

Comments

@saesh
Copy link
Contributor

saesh commented Jan 5, 2020

Hey @adept, this is more a discussion starter than an issue.

I followed the wiki and have a working setup with multiple years of transactions. This is already a great step up from my original setup.

I am having trouble adding budgeting to the system. Do you have any ideas how to start?

In my original setup I use YNAB style envelope budgeting using balances virtual postings and auto-postings, which work like this:

Every income goes automatically into an "available budget" using an auto-posting:

= assets:lloyds:current
    [assets:lloyds:current]   *-1
    [budget:available]         *1

Then, in my journal, budgeting into categories happened manually:

2019/12/26 salary
   assets:lloyds:current    €1000,00
   income:employer

2019/12/27 budget income from employer
    [budget:monthly:rent]     €500,00
    [budget:available]

And later the expense happens:

2019/12/29 pay rent
    assets:lloyds:current    -€500,00
    expenses:rent

With another auto-posting, when the expense happens, the budget gets automatically adjusted:

= expenses:rent
    [budget:monthly:rent]   *-1
    [budget:available]       *1

From this I could generate budget reports and make purchase decisions.

But hledger does not support auto-postings on balance adjusted accounts (opening and closing balances).

Any ideas on budgeting are welcome!

@simonmichael
Copy link

hledger does not support auto-postings on balance adjusted accounts (opening and closing balances).

Could you show a small example ?

@saesh
Copy link
Contributor Author

saesh commented Jan 5, 2020

Yes, see this commit.

If I run this command to see the balance of the budget I get:

$ hledger bal budget --auto -f all.journal
hledger: balance assignments cannot be used with accounts which are
posted to by transaction modifier rules (auto postings).
Please write the posting amount explicitly, or remove the rule.

account: assets:Lloyds:current

transaction:

2014/01/01 opening balances
    assets:Lloyds:current       = £100
    assets:cash                 = £150
    equity:opening balances

@saesh
Copy link
Contributor Author

saesh commented Jan 5, 2020

Ah, but I think I misunderstood the balanced auto postings. The account name must not match the rule account name. I can work around this issue by using virtual instead of accounts as a prefix in the auto-posting:

= assets:checking
    [virtual:checking]    *-1
    [budget:available]     *1

2019/01/01 salary
    assets:checking   =  500
    income:salary     = -500

Maybe this way I can add my budgeting system.

@simonmichael
Copy link

simonmichael commented Jan 5, 2020

I'm not sure about your rules, but the error is easy to work around, just avoid balance assignments:

2014/01/01 opening balances
    assets:Lloyds:current      £100 = £100
    assets:cash                £150 = £150
    equity:opening balances

(The combination of balance assignments and auto posting rules is not solvable in general, so we don't allow it.)

@saesh
Copy link
Contributor Author

saesh commented Jan 5, 2020

Thanks @simonmichael for helping out! This solved my initial issue.

Now I can add (still manual) budgeting the way I am used to.

@saesh saesh closed this as completed Jan 5, 2020
@saesh
Copy link
Contributor Author

saesh commented Jan 30, 2020

@adept I have a working setup with budgeting. It basically works like this:

  • income to budgeted account goes to available budget
  • on every income available money has to be budgeted manually into categories
  • rules ensure expenses are deducted automatically from budgets
  • automatic generation of budget balance report and monthly change to budgets

Are you interested in a PR with an additional chapter on budgeting?

@adept
Copy link
Owner

adept commented Feb 26, 2020 via email

@saesh
Copy link
Contributor Author

saesh commented Mar 11, 2020

@adept Alright, cool, I will prepare something!

@ihsanrawi
Copy link

Hello. I would love if budgeting be added into the wiki please?. I've been cracking my head on how to incorporate it into full-fledge-hledger locally

@saesh
Copy link
Contributor Author

saesh commented Oct 10, 2022

Hey @ihsanrawi, I have made a PR to show what method I use to do budgeting. Hope this is helpful to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants