Discussion:
Depreciation plugin?
Metin Akat
2017-09-06 07:32:50 UTC
Permalink
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
--
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 post to this group, send email to ***@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.
Martin Blais
2017-09-06 21:21:14 UTC
Permalink
Post by Metin Akat
Hi,
Is there some plugin to ease me with generation of depreciation
transactions?
No, but you could be the one to create it.
Post by Metin Akat
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
Post by Metin Akat
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.
Post by Metin Akat
1. Does such a thing already exist?
Not AFAIK
Post by Metin Akat
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.
Post by Metin Akat
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
To view this discussion on the web visit https://groups.google.com/d/
msgid/beancount/CAEk80bmR%3DGubRNQDh4nSuR01pHy3W_LjYXj1s%2BGMRw4MiDW3%3DA%
40mail.gmail.com
<https://groups.google.com/d/msgid/beancount/CAEk80bmR%3DGubRNQDh4nSuR01pHy3W_LjYXj1s%2BGMRw4MiDW3%3DA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhMdO6sUD_a0YfbQPP0AQkOwmPq6D9D3U2JU7C3VCynwMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Cary Kempston
2017-09-06 23:00:27 UTC
Permalink
Post by Metin Akat
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:

https://gist.github.com/cdjk/0b8da9e2cc2dee5f3887ab5160970faa

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
--
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 post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAN3-EDXm-0M-WHKGy6n-Jd%3DKDz3Jz5izsqdOd4ExY0RD7v_7pQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Metin Akat
2017-09-07 07:16:35 UTC
Permalink
Wow, this seems to be exactly what I need.
Thank you! I'll try it and will report back.
Post by Cary Kempston
Post by Metin Akat
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
https://gist.github.com/cdjk/0b8da9e2cc2dee5f3887ab5160970faa
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
2017-01-01 * "Car Depreciation"
amortize_months: 36
Expenses:Depreciation:Car 12,000.00 USD
Assets:Auto:Car
--
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
To view this discussion on the web visit https://groups.google.com/d/
msgid/beancount/CAN3-EDXm-0M-WHKGy6n-Jd%3DKDz3Jz5izsqdOd4ExY0RD7v_7pQ%
40mail.gmail.com
<https://groups.google.com/d/msgid/beancount/CAN3-EDXm-0M-WHKGy6n-Jd%3DKDz3Jz5izsqdOd4ExY0RD7v_7pQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAEk80bmqcPi0PCU%2BHM0JUmNWWtJcKG8Rh-Rxnqv_9EAHtJjyTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Metin Akat
2017-09-07 09:23:20 UTC
Permalink
One small bug:

The import statement on line 27 does not work. Instead it should be:
from dateutil.relativedelta import relativedelta
Post by Metin Akat
Wow, this seems to be exactly what I need.
Thank you! I'll try it and will report back.
Post by Cary Kempston
Post by Metin Akat
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
https://gist.github.com/cdjk/0b8da9e2cc2dee5f3887ab5160970faa
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
2017-01-01 * "Car Depreciation"
amortize_months: 36
Expenses:Depreciation:Car 12,000.00 USD
Assets:Auto:Car
--
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
To view this discussion on the web visit https://groups.google.com/d/ms
gid/beancount/CAN3-EDXm-0M-WHKGy6n-Jd%3DKDz3Jz5izsqdOd4ExY0R
D7v_7pQ%40mail.gmail.com
<https://groups.google.com/d/msgid/beancount/CAN3-EDXm-0M-WHKGy6n-Jd%3DKDz3Jz5izsqdOd4ExY0RD7v_7pQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAEk80b%3D%2BHnU6Y6uywKFAz0hgOPW0CPZOLPbOTfTk6pUGynpj8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Metin Akat
2017-10-11 07:40:51 UTC
Permalink
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
Post by Metin Akat
from dateutil.relativedelta import relativedelta
Post by Metin Akat
Wow, this seems to be exactly what I need.
Thank you! I'll try it and will report back.
Post by Cary Kempston
Post by Metin Akat
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),
https://gist.github.com/cdjk/0b8da9e2cc2dee5f3887ab5160970faa
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
2017-01-01 * "Car Depreciation"
amortize_months: 36
Expenses:Depreciation:Car 12,000.00 USD
Assets:Auto:Car
--
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
To view this discussion on the web visit https://groups.google.com/d/ms
gid/beancount/CAN3-EDXm-0M-WHKGy6n-Jd%3DKDz3Jz5izsqdOd4ExY0R
D7v_7pQ%40mail.gmail.com
<https://groups.google.com/d/msgid/beancount/CAN3-EDXm-0M-WHKGy6n-Jd%3DKDz3Jz5izsqdOd4ExY0RD7v_7pQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAEk80bnP8oy1Z756hPhXp1Xde%2B%2BSMHEZQ4x6r_Jh6uLpOy5RSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...