I find being able to specify different dates for different legs (aka 
postings) of a transaction to be valuable. I was using a plugin I'd hacked 
up for a long while, and I finally got around to rewriting it to allow for 
per-posting dates with configurable holding accounts. Sharing it. Feedback 
welcome:

https://github.com/redstreet/beancount_plugins_redstreet/tree/master/effective_date

Cases where I use it:
- booking a tax refund to the correct year
- booking the last paycheck of the year to the correct year (when it gets 
deposited a day later in the next year)
- spread a lumpsum expense across time (eg: booking insurance premiums paid 
upfront for one year across several months)
- booking expenses to the correct month (eg: rent paid a couple days before 
the start of a month)
etc.

The plugin also inserts a beancount link to link the original transaction 
and all its associated newly inserted transactions to help you find them 
easily in beancount or fava.

Here's the README:

Effective dates plugin for Beancount 

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.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/955c773f-2957-4b08-b63c-a68422ab1006%40googlegroups.com.

Reply via email to