Mortgages + Fava Extension / Time Filter

143 views
Skip to first unread message

Scott Wallace

unread,
Dec 2, 2021, 3:56:49 PM12/2/21
to Beancount
Hi, I'm new to beancount/fava but very impressed with it so far.

I've set up a few months of data to see how things work, and one items I'd like to track is monthly cash available after expenses and mortgage payments. Since mortgage payments are partially paying down a liability (and thus, a chunk isn't really an 'expense' per se), it's not really clear to me the best way to do this.

I had been thinking that perhaps I should write a fava extension that calculates this figure, but as I'm writing this it occurs to me that maybe there's a way to do it by setting the accounts up differently.

Any thoughts out there for me?
Also, if I do go down the road of a fava extension, I'd like the extension to be able to use values typed into the time filter. Can anyone point me to sample code that does this? My quick tour of the fava code didn't reveal any obvious suspects, but I have yet to really understand how it all fits together.

Thanks!
 -Scott

Ben Blount

unread,
Dec 2, 2021, 4:10:23 PM12/2/21
to Beancount
I don't know of a better way. I take the same view that you describe: that the interest portion of the payment should be attributed as an Expense, principal as paying down a Liability, and any escrow taken out for the mortgage company to pay taxes+insurance on your behalf as adding to an Asset account.

Some day I was thinking of writing a beancount plugin that does this split automatically based on the standard amortization schedule, but it's low on my list. It would be a pretty easy plugin I think. A fava extension doesn't seem like the right tool for this - I haven't used those but it seems like their role is to give you ways to display data in your ledger, rather than actually mutating the ledger as proposed here. You could even have the plugin automatically insert the transactions using just the plugin configuration.

For example, this could be all the user has to input:
plugin "your_cool_plugins.mortgage" "{
  'transaction_day_of_month' : 1,
  'start_date' : '2010-01-01',
  'principal_and_interest_amt': 1000 USD,
  'interest_rate_pct': 4.25,
  'escrow_amt': 200 USD,
}"

Then the plugin can generate a transaction every month between `start_date` and today().

As for plugin examples, there are several great plugin authors in our community. See here, and here (and there are lots more out there). 

--
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 on the web visit https://groups.google.com/d/msgid/beancount/e5722df9-687c-4e24-bced-f7c917c9ace9n%40googlegroups.com.

Scott Wallace

unread,
Dec 2, 2021, 4:54:10 PM12/2/21
to Beancount
Thanks for the leads!  And just to clarify, my intent with the Fava extension wasn't to produce the transactions, but to calculate:

 income - expenses - change in prepaid principal

over some period of time -- essentially, this would be an income statement with this augmented value.

Ben Blount

unread,
Dec 2, 2021, 4:59:11 PM12/2/21
to Beancount
Ah that makes sense, thanks. I still think it's better to produce the transactions instead because that way all beancount tooling will work out of the box.

redst...@gmail.com

unread,
Dec 2, 2021, 6:42:38 PM12/2/21
to Beancount
On Thursday, December 2, 2021 at 1:54:10 PM UTC-8 swall...@gmail.com wrote:
Thanks for the leads!  And just to clarify, my intent with the Fava extension wasn't to produce the transactions, but to calculate:

 income - expenses - change in prepaid principal

Hi,
I'm not sure I understand what is being calculated here. But a simple query in BQL might suffice for most of these types of queries. Have you tried that yet? If not, a description of what exactly you are wanting would help.

Scott Wallace

unread,
Dec 2, 2021, 8:06:02 PM12/2/21
to Beancount
Yes, I think it's likely that a BQL query would do it; I read through the google doc on BQL, but now I see that the builtin help function shows much more than what's covered in the document...  I'll scratch my head as I look over that for a while...

Thanks for the lead!
 -Scott
Reply all
Reply to author
Forward
0 new messages