Double entry bookkeeping requires each transaction to occur instantaneously in time. In Beancount, that translates to each transaction occuring on a single date. However, it is occasionally useful to view different legs of a transaction occuring across difference periods of time. For example, consider:
2014-12-15 * "Annual Insurance payment for 2015"
Liabilities:Credit-Card 100 USD
Expenses:Insurance
Here, the payment was made in Dec 2014 for an expense to be booked to 2015. To reflect this, one could book it thus:
2014-12-15 * "Annual Insurance payment for 2015"
Liabilities:Credit-Card 100 USD
Assets:Hold:Insurance
2015-01-01 * "Annual Insurance payment for 2015"
Assets:Hold:Insurance -100 USD
Expenses:Insurance
The expense is booked in 2015, while the credit card transaction, in 2014. The "Assets:Hold:Insurance" holds the money for the period in between.
This plugin automates the process above. One can simply enter a single transaction with an 'effective_date' metadata field for the posting (not the transaction) that needs to occur later (or earlier):
2014-12-15 * "Annual Insurance payment for 2015"
Liabilities:Credit-Card 100 USD
Expenses:Insurance
effective_date: 2015-01-01
The plugin also allows for legs to occur on multiple different dates. For example:
2015-02-01 * "Car insurance: 3 months"
Liabilities:Mastercard -600 USD
Expenses:Car:Insurance 200 USD
effective_date: 2015-03-01
Expenses:Car:Insurance 200 USD
effective_date: 2015-04-01
Expenses:Car:Insurance 200 USD
effective_date: 2015-05-01
The examples.bc shows you how the plugin can be configured for your choice of holding accounts.
I find being able to specify different dates for different legs (aka postings) of a transaction to be valuable.
On Sunday, March 1, 2020 at 4:09:52 AM UTC+7, Red S wrote:I find being able to specify different dates for different legs (aka postings) of a transaction to be valuable.Very cool. I have (relatively) frequent need for this as well. There are, unfortunately, all kinds of financial transfers that don't occur instantly. In some cases I can live with the date on one leg being wrong but in others I prefer more accuracy, especially when there are exchange rates or other external factors involved. I've been manually doing this for years and will be glad to switch over to a plugin to make it slightly more obvious what is happening.
A few quick comments based on scanning the plugin:For the LINK_FORMAT you might consider adding the date of the "real" posting as part of it. e.g. something like edate-20191225-xkjm. I do that in mine and find that having a tiny bit of human understandable context often helps and prevents me needing to do more complicated querying/digging. "Oh, it is probably that wire transfer, I think I did that in late December".
One thing I've struggled with is a nice way to do balance statements. You want some assurance that no money got left behind in limbo in some fake account I never look at. Of course, that's a bigger problem when it is all done manually. But it is hard to autogenerate balance statements when there could be multiple transactions in-flight using the holding account. e.g. you can't just make a balance statement after the final edate to assert $0. How do you handle balance statements for this Hold account in your own usage?
Good use cases I hadn't thought of. I use my zerosum plugin for some of those use cases, but depending upon one's preference to dedup their ingest, the effective_date plugin solves the same problem in a different way.
I personally don't find that to be a problem with effective_date, because the holding account is used solely by the plugin and is always eventually zero barring bugs. So the only use I'd see is to uncover bugs in the plugin-code. Are you seeing other use cases?
All of my transactions are manually entered since cash payments make up >50% my transactions and my primary bank account & credit card don't have any kind of export, so zerosum doesn't fit my use case, unfortunately. But I can how it would work with importers. effective_date looks like exactly what I want for my workflow, so I'll be using it from now on.
File "/usr/local/lib/python3.7/site-packages/beancount_reds_plugins/effective_date/effective_date.py", line 118, in effective_date
holding_account = holding_accts[found_acct]['earlier']
KeyError: ''
Anything I should be looking for?
It'll fail that way if you're calling it for an account for which you haven't supplied a corresponding config.
Please post in this thread if that doesn't work for you.
--
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/2e4d1c27-a31d-4a7e-a923-a71bdedad256n%40googlegroups.com.