Depreciation plugin?

341 views
Skip to first unread message

Metin Akat

unread,
Sep 6, 2017, 3:32:51 AM9/6/17
to bean...@googlegroups.com
Hi,

Is there some plugin to ease me with generation of depreciation transactions?
For every more substantial thing I own I create its own account where I depreciate it over time by manually entering monthly transactions for depreciation. As you can imagine, this is very tedious.

It would be nice if I could write some balance statement (once a year or whenever I see fit) and have some plugin generate monthly depreciation transactions (without having them in my journal).
So I have two questions:

1. Does such a thing already exist?
2. If not, can I get some guidelines for implementing this? Like for example, what is the proper syntax to use in my journal file (if any) to denote the desired balance. One easy way (without breaking anything) would be to have my assets as different commodities and write their price with the existing syntax.


Thanks,
Metin

Martin Blais

unread,
Sep 6, 2017, 5:21:42 PM9/6/17
to Beancount
On Wed, Sep 6, 2017 at 9:32 AM, Metin Akat <akat....@gmail.com> wrote:
Hi,

Is there some plugin to ease me with generation of depreciation transactions?

No, but you could be the one to create it.

 
For every more substantial thing I own I create its own account where I depreciate it over time by manually entering monthly transactions for depreciation. As you can imagine, this is very tedious.

Sounds painful indeed.


It would be nice if I could write some balance statement (once a year or whenever I see fit) and have some plugin generate monthly depreciation transactions (without having them in my journal).

In a way, this would be similar to a version of the Pad directive but which is spread over time via multiple transactions.
I've been wanting something like this for myself for a long time but haven't given in to coding it yet.

 
So I have two questions:

1. Does such a thing already exist?

Not AFAIK

 
2. If not, can I get some guidelines for implementing this? Like for example, what is the proper syntax to use in my journal file (if any) to denote the desired balance. One easy way (without breaking anything) would be to have my assets as different commodities and write their price with the existing syntax.

I think you could use the normal Balance directive, and have your plugin process a Custom directive (with a particular name of your choosing) and insert the depreciation directives.



Thanks,
Metin

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAEk80bmR%3DGubRNQDh4nSuR01pHy3W_LjYXj1s%2BGMRw4MiDW3%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Cary Kempston

unread,
Sep 6, 2017, 7:00:49 PM9/6/17
to bean...@googlegroups.com
On Wed, Sep 6, 2017 at 12:32 AM, Metin Akat <akat....@gmail.com> wrote:
Hi,

Is there some plugin to ease me with generation of depreciation transactions?
For every more substantial thing I own I create its own account where I depreciate it over time by manually entering monthly transactions for depreciation. As you can imagine, this is very tedious.


I wrote something similar, except instead of writing a desired final balance you have to enter amount of depreciation over the time period you want.  I use it primarily for things like insurance premiums that are paid annually or every six months so that my expenses are spread out evenly over the year, but also use it to record depreciation on my cars.

The plugin is by no means perfect (it assumes everything is monthly), but it might work for you.  Here it is:


And here's what an example file using the plugin looks like:

plugin "amortize_over"

2017-06-01 open Assets:Bank:Checking
2017-06-01 open Assets:Prepaid-Expenses
2017-06-01 open Expenses:Insurance:Auto

2017-06-01 * "Pay car insurance"
    Assets:Bank:Checking       -600.00 USD
    Assets:Prepaid-Expenses

2017-06-01 * "Amortize car insurance over six months"
    amortize_months: 6
    Assets:Prepaid-Expenses       -600.00 USD
    Expenses:Insurance:Auto

For depreciation, I do something like this, if I think my car will be worth 12k less in three years:

 2017-01-01 * "Car Depreciation"
     amortize_months: 36
     Expenses:Depreciation:Car    12,000.00 USD
     Assets:Auto:Car

Metin Akat

unread,
Sep 7, 2017, 3:16:37 AM9/7/17
to bean...@googlegroups.com
Wow, this seems to be exactly what I need.
Thank you! I'll try it and will report back.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.

Metin Akat

unread,
Sep 7, 2017, 5:23:21 AM9/7/17
to bean...@googlegroups.com
One small bug:

The import statement on line 27 does not work. Instead it should be:
from dateutil.relativedelta import relativedelta

Metin Akat

unread,
Oct 11, 2017, 3:40:52 AM10/11/17
to bean...@googlegroups.com
Hi,

I've been using this plugin for over a month. It's perfect for my needs. I already converted all of my properties, past and present, to this way of tracking. 

Thanks!
Metin

hkt...@gmail.com

unread,
Apr 20, 2020, 10:54:31 PM4/20/20
to Beancount
Dear Metin,

I have written a plugin for depreciation. Pls refer to https://github.com/hktkzyx/auto_depreciation for more details.

在 2017年9月6日星期三 UTC+8下午3:32:51,Metin Akat写道:
Reply all
Reply to author
Forward
0 new messages