Questions: Recurring Transactions (with reconciliation); Milk, Fuel and Mileage Tracking; and Net Profit Calculation

212 views
Skip to first unread message

Moisés Simón

unread,
Oct 26, 2025, 7:39:04 PMOct 26
to Beancount
I'm reaching out for some advice on a few challenges I'm facing with
Beancount. To give some context, I don't have any formal accounting
education—everything I know is self-taught. I suspect many of my issues
stem from that, but I'm eager to learn and improve.

This is the first time I'm tracking my finances seriously, with specific
financial objectives in mind. I was previously using GNUCash, but I
found the UX for budgets and reporting suboptimal for my needs. I really
like the Fava UI in comparison—it's much more intuitive. Here are the
main areas where I'm seeking help:

- Automate recurring transactions (with reconciliation) and forecasting

This is the feature I'm missing most from GNUCash.

In GNUCash, I could set up recurring transactions using a mortgage
formula that automatically calculated principal + interest. When you
opened GNUCash, if a recurring transaction was due, you had the chance
to review and apply it. That way, if something like a phone bill was
higher than expected for some reason, you could modify it before
posting.

My main reason for tracking finances is to forecast: knowing how much
money I'll have at certain points, when I'll reach X amount, or if
there's a month where I need to keep extra in my regular account for
annual payments. How can I achieve something similar in Beancount? Are
there plugins, scripts, or best practices for automating recurring
entries and generating forecasts?

I have tried some of them but I feel they where too complicated or too
simple this is, they just don't have any mechanisim for reconcile
(beancount_periodic.recur/amortize) or the mechanism/setup is too
involved (beanahead).

- Buy milk from farmer.

rigth now I do transactions like:

,----
| 2025-01-01 event "Milk price" "0.6 EUR"
| 2025-01-01 price Milk 0.6 EUR
|
| 2025-02-27 txn "Milk"
| Expenses:Groceries 6 MILK
| Liabilities:Milk
|
| 2025-03-03 txn "Pay Milk January/February"
| Assets:Cash -50.00 EUR
| Liabilities:Milk
`----

But this results in Fava reporting a liability of something like -300 MILK and 170 EUR, which isn't ideal. Of course, I don't want to track my daily milk consumption in detail. I set a price for MILK because I don't want to manually add the @ price every time, like this:

,----
| 2025-02-27 txn "Milk"
| Expenses:Groceries 6 MILK @ 0.6 EUR
| Liabilities:Milk
`----

So, how can I fix this while still keeping track of how much I owe without cluttering reports with commodity quantities I don't care about?

- Keep track of fuel consumpution AND KM/EUR

Similar to the Milk issue but more involved. I have a car that can use
LPG or Gasoline (95 or 98). Rigth now I do:

,----
| 2025-07-27 balance Equity:Hacks:Expenses:Coche:Kilometraje 154043.6 KM
|
| 2025-07-27 * "Fuel"
| time: "06:06:39"
| Expenses:Car:Fuel 15.91 LPG @@ 15.58 EUR
| Expenses:Car:Fuel 12.43 G95 @@ 20.00 EUR
| Equity:Hacks:Car:Fuel
| Assets:Cash EUR
|
| 2025-07-27 * "LPG: Marino"
| Expenses:Car:Fuel 25.32 LPG @@ 24.03 EUR
| Equity:Hacks:Expenses:Car:Mileage 255 KM @@ 25.32 LPG
| Equity:Hacks:Car:Fuel
| Assets:Cash EUR
`----

This feels too cumbersome, and I'm adding stuff to Equity that probably shouldn't be there. I want to track mileage, add maintenance events for the car, and calculate costs like EUR per KM so I can budget for long trips. What's a cleaner way to handle this in Beancount without hacks?

- Net Profit Liabilities and Expenses

I have a mortgage on my main house (it's my only one and not an investment).

As far as I can tell, net profit is calculated without accounting for principal payments on the mortgage because those are treated as Liabilities, not Expenses. This doesn't make much sense for personal finance tracking. How can I adjust this? Or, alternatively, how can I calculate what money I really have available (Income - Expenses - Payments on Liabilities)?

Thank you in advance for any insights, examples, or resources you can share. I'm happy to provide more details if needed.

redst...@gmail.com

unread,
Oct 27, 2025, 5:05:09 AMOct 27
to Beancount

Hi,
I don’t use forecasting myself, and there are probably plugins and scripts other uses, but here are some quick answers outside that.

In GNUCash, I could set up recurring transactions using a mortgage
formula that automatically calculated principal + interest. When you

Here’s the trivial script I use. When importing from your bank, manually replace your mortgage transaction with the output of this script. Or automate it if you have fancy importers setup.

  • Buy milk from farmer.

Simplified:

2025-03-03 txn "Pay Milk January/February" Assets:Csah -50 EUR Expenses:Groceries:Milk

Or if expense spreading matters, I use my plugin:

2025-03-03 txn "Pay Milk January/February" Assets:Csah -50 EUR Expenses:Groceries:Milk 25 EUR effective_date: 2025-01-01 Expenses:Groceries:Milk 25 EUR effective_date: 2025-02-01

I have a car that can use LPG or Gasoline (95 or 98). Rigth now I do:

Use metadata:

2024-06-01 * "Gasoline" odometer: 66,324 gallons: 11.567 Liabilities:Credit-Cards:Credit-Card -50 USD Expenses:Car:Koeninsegg:Fuel

You can then write a simple plugin to compute fuel efficiency and such. I use it for oil changes as well.

  • Net Profit Liabilities and Expenses I have a mortgage on my main house (it’s my only
    one and not an investment).

As far as I can tell, net profit is calculated without accounting for principal
payments on the mortgage because those are treated as Liabilities, not Expenses. This
doesn’t make much sense for personal finance tracking. How can I adjust this? Or,
alternatively, how can I calculate what money I really have available (Income -
Expenses - Payments on Liabilities)?

Payments are typically booked as such:

2025-10-12 * "Mortgage Payment" Assets:Banks: -1000 USD Expenses:House:Mortgage:Interest 800 USD Liabilities:Mortgage 200 USD

So money flows from Assets:Bank to Liabilities:Mortgage and Expenses:Interest. There’s nothing you should have to do: your net profit and net worth should all compute correctly as expected.

Alan H

unread,
Oct 27, 2025, 10:23:45 PMOct 27
to Beancount
Red's answer is straight forward and clear so I certainly won't cover any duplicate ground.

For tracking recurring and reconciliation I use a (modified) beancount_periodic plugin that posts computed transactions for mortgages with the flag as '"#" not "*" then to reconcile, in fava I open the transaction and change the flag, then I  roll the base month of the original computing posting forwards one month. This is simple and low effort. The trick is that my plugin computes the postings from metadata and balances so there isn't an issue with the recurring transaction 'hardcoding' anything that is in error.

NOTE I am the lender in this example ...

; set a value for zyx_loan_rate
2025-01-01 event xyz_loan_rate "0.095"
; Compute interested automatically
2025-01-01 # "Interest Charges [MONTHLY]"
bal_acc_loan: "Assets:Loans:Secured:XYZ-CA"
event_int_rate: "xyz_loan_rate"
expr_i: "R(div(mul(gcu(loan,'CAD'),int_rate),12),2)"
;
Income:Loans:Secured:XYZ-CA 0 CAD
expr: "-i"
Assets:Loans:Secured:XYZ-CA 0 CAD
expr: "i"

There's another recurring transaction that records the payment by the beneficiary and everything tracks itself quite nicely - statements are a simple query, etc.

The plugin is a little rough (the computation is done by creating a dict context with the noted events and balances referenced in the metadata that is passed to an eval) but it works for me.

Alan

Marcus Read

unread,
Oct 28, 2025, 12:00:04 PMOct 28
to bean...@googlegroups.com
Hi Moisés

I would have suggested beanahead for regular transactions, forecasting and reconciliation - although note you seem to have come across it already. As the author I'd be interested to know why you thought it was too involved and I'd certainly welcome any suggestions.

Cheers
Marcus

--
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 view this discussion visit https://groups.google.com/d/msgid/beancount/59517c6b-8041-4e4e-8e1c-7a7177c3e80cn%40googlegroups.com.

Moisés Simón

unread,
Nov 8, 2025, 4:43:17 AMNov 8
to redst...@gmail.com, Beancount
"redst...@gmail.com" <redst...@gmail.com> writes:

> Hi,
> I don’t use forecasting myself, and there are probably plugins and scripts other uses,
> but here are some quick answers outside that.
>
> In GNUCash, I could set up recurring transactions using a mortgage
> formula that automatically calculated principal + interest. When you
>
> Here’s the trivial script I use. When importing from your bank, manually replace your
> mortgage transaction with the output of this script. Or automate it if you have fancy
> importers setup.
>
> * Buy milk from farmer.
>
> Simplified:
>
> 2025-03-03 txn "Pay Milk January/February" Assets:Csah -50 EUR Expenses:Groceries:Milk
>
> Or if expense spreading matters, I use my plugin:
>
> 2025-03-03 txn "Pay Milk January/February" Assets:Csah -50 EUR Expenses:Groceries:Milk
> 25 EUR effective_date: 2025-01-01 Expenses:Groceries:Milk 25 EUR effective_date:
> 2025-02-01
>

but I need to keep track of how much milk I take to calculate how much I
pay, problem is after paying in cash I still hold milk as a commodity.
see my example

> I have a car that can use LPG or Gasoline (95 or 98). Rigth now I do:
>
> Use metadata:
>
> 2024-06-01 * "Gasoline" odometer: 66,324 gallons: 11.567
> Liabilities:Credit-Cards:Credit-Card -50 USD Expenses:Car:Koeninsegg:Fuel
>
> You can then write a simple plugin to compute fuel efficiency and such. I use it for oil
> changes as well.
>

Will try this. Thanks

> * Net Profit Liabilities and Expenses I have a mortgage on my main house (it’s my
> only
> one and not an investment).
>
> As far as I can tell, net profit is calculated without accounting for principal
> payments on the mortgage because those are treated as Liabilities, not Expenses.
> This
> doesn’t make much sense for personal finance tracking. How can I adjust this? Or,
> alternatively, how can I calculate what money I really have available (Income -
> Expenses - Payments on Liabilities)?
>
> Payments are typically booked as such:
>
> 2025-10-12 * "Mortgage Payment" Assets:Banks: -1000 USD Expenses:House:Mortgage:Interest
> 800 USD Liabilities:Mortgage 200 USD
>
> So money flows from Assets:Bank to Liabilities:Mortgage and Expenses:Interest. There’s
> nothing you should have to do: your net profit and net worth should all compute
> correctly as expected.
>

This is not my experience. take into account the following example:

option "operating_currency" "USD"

1970-01-01 open Liabilities:BestBank:Mortgage:Loan USD

1970-01-01 open Equity:Opening-Balances

1970-01-01 open Income:Salary:AcmeCo
1970-01-01 open Expenses:Food:Grocery
1970-01-01 open Expenses:Home:Monthly:Loan-Interest
1970-01-01 open Assets:House
1970-01-01 open Assets:BestBank:Checking USD

2008-01-01 * "Home" "Buy"
Assets:House 1 HOME {150000 USD}
Liabilities:BestBank:Mortgage:Loan -150000 USD
Equity:Opening-Balances

2008-02-10 * "ACME" "Salary paid from employer"
Assets:BestBank:Checking 2000.00 USD
Income:Salary:AcmeCo

2008-02-11 * "Groceries"
Expenses:Food:Grocery 300 USD
Assets:BestBank:Checking

2008-02-12 * "MORTGAGE PAYMENT"
Assets:BestBank:Checking -450 USD
Liabilities:BestBank:Mortgage:Loan 150 USD
Expenses:Home:Monthly:Loan-Interest

This gives a net profit af 1400 USD but balance in account is 1250

Moisés Simón

unread,
Nov 8, 2025, 4:51:06 AMNov 8
to Alan H, Beancount
So there is no way to use formulas (to calculate interest) in beancount
without plugins?

Alan Hawrylyshen

unread,
Nov 8, 2025, 8:13:25 AMNov 8
to Moisés Simón, Beancount
No. This is a feature, not a bug. 

I find the plugin approach is useful for solving exactly the problem I need and I can use balance assertions with metadata notes to ensure that any changes in plugins do not affect historic transactions.  I don't want complicated generic solutions when a simple plugin can do just what I need. The only ones I make heavy use of are metadata spray to save typing, forecast for future planning and my dynamic forecast that allows me to spec postings using a calculation and the inventory of other accounts



There are times I even "render" the plugin generated transactions for more stability ...



a l a n a t p o l y p h a s e d o t c a

redst...@gmail.com

unread,
Nov 8, 2025, 9:56:43 AMNov 8
to Beancount
Bbut I need to keep track of how much milk I take to calculate how much I

pay, problem is after paying in cash I still hold milk as a commodity.
see my example

This is basically asking “how do I model what I want using double entry bookkeeping?” which is a common question, but not really related to Beancount (except perhaps for some trivial figuring out of syntax at the end). I’d suggest writing up (in plain words) what you are trying to accomplish, which I couldn’t tell from your current set of posts. What are your goals? What do you want your assets, liabilities, and expenses to reflect with respect to milk?

This gives a net profit af 1400 USD but balance in account is 1250

Sounds correct to me. I’m guessing your mental model of Net Profit is probably different from what is accepted as its definition. How do you define it in your mind?

Here, your Liabilities went down by 150 which is the same as your Assets going up by 150. It’s as if you took the 150 and put it in a different bank. Therefore, the 150 does not affect your net profit.


On Saturday, November 8, 2025 at 5:13:25 AM UTC-8 Alan H wrote:
No. This is a feature, not a bug. 

I find the plugin approach is useful

+1 

Moisés Simón

unread,
Nov 8, 2025, 2:06:07 PMNov 8
to bean...@googlegroups.com
Marcus Read <marcu...@gmail.com> writes:

> [...]
> As the author I'd be interested to know why you thought it was too
> involved and I'd certainly welcome any suggestions.

Keep in mind I am a noob with beancount so take my input accordignly.
Rigth now with beancount I feel I am always figthing and I am in a "want
to solve this ASAP" mood so everything that is not a straigth
forward solution is making me mad.

Nevertheless, after giving it a go again I am the gettinghe gasp of it,
still the Readme would benefit with a more hands-on approach. You start
talking about Making beanahead files and having three files before
talking about what problem is being solved.

I will give a spin again to the reconcile and injecting stuff.

Moisés Simón

unread,
Nov 9, 2025, 2:57:07 AMNov 9
to bean...@googlegroups.com
"redst...@gmail.com" <redst...@gmail.com> writes:

> Bbut I need to keep track of how much milk I take to calculate how much I
> pay, problem is after paying in cash I still hold milk as a commodity.
> see my example
>
> This is basically asking “how do I model what I want using double entry bookkeeping?”
> which is a common question, but not really related to Beancount (except perhaps for some
> trivial figuring out of syntax at the end).

Yes, I realize this is my problem.

> I’d suggest writing up (in plain words) what you are trying to
>accomplish, which I couldn’t tell from your current set of posts. What
>are your goals? What do you want your assets, liabilities, and expenses
>to reflect with respect to milk?

Sorry for not being clear. My end goal for using beancount is that I
want to know future income/expenses and plan accordingly. This is, be
able to answer: How much MONEY will I have at X date? Will I have enough
money in the bank to pay Y? When would I have saved enough to buy Z?

regarding milk I want to do this:

2025-11-07 * "Milk"
Expenses:Groceries 3 MILK @ 0.6 EUR
Liabilitios:Milk EUR

without having to specify "@ 0.6 EUR" in every transaction, I want
beancount to take the price directive.

Why? because I know how many liters I take everytime, but I don't
know if the price may have change. If I don't specify "@ 0.6 EUR" my
liabilities in fava will show I owe lot of milk and that they owe me
EUR. unless of course I select convert to EUR.

>
> This gives a net profit af 1400 USD but balance in account is 1250
>
> Sounds correct to me. I’m guessing your mental model of Net Profit is probably different
> from what is accepted as its definition. How do you define it in your mind?
>
> Here, your Liabilities went down by 150 which is the same as your Assets going up by
> 150. It’s as if you took the 150 and put it in a different bank. Therefore, the 150 does
> not affect your net profit.
>

This was my initial understanding too, but:

> On Mon, 27 Oct 2025 02:05:09 -0700 (PDT) "redst...@gmail.com" wrote:
> So money flows from Assets:Bank to Liabilities:Mortgage and Expenses:Interest. There’s
> nothing you should have to do: your net profit and net worth should all compute
> correctly as expected.

Which confused me, maybe I didn't hunderstand what redst was telling me
or I didn't explain correctly. Now, what I am doing, is using "plugin
"beancount_reds_plugins.rename_accounts.rename_accounts" to rename
mortage pricipal to an expense in fava.

This works great and now my Net Profit reflects correctly. if there is
another way towhat money I really have available (Income - Expenses -
Lean payments on
Liabilities) I am all ears

> On Saturday, November 8, 2025 at 5:13:25 AM UTC-8 Alan H wrote:
>
> No. This is a feature, not a bug.
>
> I find the plugin approach is useful
>
> +1

Which resources do you recommend? Is the book tracking your finances
with python worth it? I know some programming, but I haven't touch
python in ages. As I told: I don't want to spend hours to accomplish my
financial tracking goals, but also the reason to use beancount was it
extensibility if it will let me say, automate getting my bank statements
and create dashboards with the info I need... it will be worth it.

Thanks,

redst...@gmail.com

unread,
Nov 9, 2025, 12:49:11 PMNov 9
to Beancount

Sorry for not being clear. My end goal for using beancount is that I
want to know future income/expenses and plan accordingly. This is, be
able to answer: How much MONEY will I have at X date? Will I have enough
money in the bank to pay Y? When would I have saved enough to buy Z?

Makes sense. In terms of reporting, the closest “standard” report that will help with that is usually called a “Cashflow report”, which is different from a “Net Profit” report. I’d recommend spending a few minutes with AI to dig in and understand these better.

> On Mon, 27 Oct 2025 02:05:09 -0700 (PDT) "redst...@gmail.com" wrote:
> So money flows from Assets:Bank to Liabilities:Mortgage and Expenses:Interest. There’s
> nothing you should have to do: your net profit and net worth should all compute
> correctly as expected.

Which confused me, maybe I didn't hunderstand what redst was telling me
or I didn't explain correctly. Now, what I am doing, is using "plugin
"beancount_reds_plugins.rename_accounts.rename_accounts" to rename
mortage pricipal to an expense in fava.

This works great and now my Net Profit reflects correctly. if there is
another way towhat money I really have available (Income - Expenses -
Lean payments on
Liabilities) I am all ears

If you rename a Liability account into an Expense account, that would have a lot of unintended effects on your ledger and reporting. It breaks the bookeeping paradigm a bit. For example, now your ledger says you had a huge negative expense the year you bought your house. That said, doing it with my plugin above is a great way to experiment as it’s trivially revertible.

See this thread on how to generate a Cashflow report and fine tune it to your needs.

Which resources do you recommend? Is the book tracking your finances
with python worth it? I know some programming, but I haven't touch
python in ages. As I told: I don't want to spend hours to accomplish my
financial tracking goals, but also the reason to use beancount was it
extensibility if it will let me say, automate getting my bank statements
and create dashboards with the info I need... it will be worth it.

If you want to create custom reports or dashboards, or automate a lot using the Beancount ecosystem, you would need to be very comfortable with Python. What I’d suggest in getting started is to get your initial ledger created, figure out the most important set of questions you want to ask of your ledger, and then work through them (like you already seem to be doing). You’ll gain a much better sense of what you need to go towards, in a little bit.

regarding milk I want to do this:

2025-11-07 * "Milk"
Expenses:Groceries 3 MILK @ 0.6 EUR
Liabilitios:Milk EUR

without having to specify "@ 0.6 EUR" in every transaction, I want
beancount to take the price directive.

Why? because I know how many liters I take everytime, but I don't
know if the price may have change. If I don't specify "@ 0.6 EUR" my
liabilities in fava will show I owe lot of milk and that they owe me
EUR. unless of course I select convert to EUR.

I think you may be confounding the problem you’re trying to solve with the solution. A solution in Beancount is subject to its syntax and such that you must adhere to. But other than that, this is the straightforward part.

The tricker part is the problem. I still can’t say I understand what you’re trying to accomplish around milk. Writing down a problem statement would help. Even better, spend a few minutes going back and forth with AI on this, and that should help.

Vasily M

unread,
Nov 12, 2025, 2:08:03 PMNov 12
to Beancount
> Keep in mind I am a noob with beancount so take my input accordignly.
> Rigth now with beancount I feel I am always figthing and I am in a "want
> to solve this ASAP" mood so everything that is not a straigth
> forward solution

Being in similar position at some point, I started putting together https://github.com/Evernight/lazy-beancount/ (and the linked guide). Instead of building from bare bones you may take a different approach and throw in a bunch of stuff right away with some examples and recipes. That's something I would be happy to find when I was just starting with Beancount, but apparently that's not the best approach for everyone. In any case, may simplify some things or give you more ideas.

A little warning: it's still more like a set of tools for power/technical users or those willing to invest in learning Beancount+Python ecosystem. I figured trying to replace some other more user-friendly (but less capable) tools out there would take much more work and generally not in the direction I'd like to focus on right now.  

At this point I solved a bunch of use-cases for myself (even more than I expected initially) and tried to do it in a manner that's composable, extensible and usable by others. I think once you get into a certain mindset and learn Beancount's concept and syntax, you can do a lot. But I'd also try to start with big common cases and keeping in mind that getting comfortable with all the new concepts will take time and effort in any case.


> "redst...@gmail.com" wrote:
> If you want to create custom reports or dashboards, or automate a lot using the Beancount ecosystem, you would need to be very comfortable with Python.

On another (positive) note, with that I would respectfully disagree! I think with correct usage of syntax, tags, etc, and the fava-dashboards plugin at this point you don't really need to dig deeply into Python. Rather into SQL (BQL) and some JS even.
That's unless you want to do something really custom and specific.


> without having to specify "@ 0.6 EUR" in every transaction, I want
beancount to take the price directive.

Without asking deeper about specific use-case and goals, that sounds similar to what https://github.com/Evernight/beancount-lazy-plugins?tab=readme-ov-file#currency_convert does. I wrote (LLM generated, honestly) it for different purposes but even if it doesn't work for yours, you can probably take it as a reference.

redst...@gmail.com

unread,
Nov 12, 2025, 2:26:04 PMNov 12
to Beancount
On Wednesday, November 12, 2025 at 11:08:03 AM UTC-8 Vasily M wrote:
Being in similar position at some point, I started putting together https://github.com/Evernight/lazy-beancount/ (and the linked guide). Instead of building from bare bones you may take a different approach and throw in a bunch of stuff right away with some examples and recipes.

Nice project! And a great curated list. I learned of a couple things from it.

I wonder how this could be advertised to new users of Beancount, and those wanting to test drive it.

Vasily M

unread,
Nov 15, 2025, 7:49:03 AM (13 days ago) Nov 15
to Beancount
> Nice project! And a great curated list. I learned of a couple things from it.

Thanks a lot for the positive feedback, glad to hear that!
Martin has already added it to the Contributions list a while ago. I also did a bunch of things to make it more discoverable including adding it to https://github.com/siddhantgoel/awesome-beancount.
I'm also going to post announcements in this mail list once I get to larger updates targeting some rough edges.

Simon Michael

unread,
Nov 19, 2025, 12:02:22 AM (9 days ago) Nov 19
to bean...@googlegroups.com
On 2025-11-15 02:49, Vasily M wrote:
> > Nice project! And a great curated list. I learned of a couple things
> from it.

And a beautiful README!

FWIW it's linked twice on https://plaintextaccounting.org also.

Reply all
Reply to author
Forward
0 new messages