/DepreciateForLedger

Depreciation tool to for Ledger

Primary LanguagePython

Depreciate – Create depreciation entries

This tool allows you to create a depreciation schedule appropriate for Ledger.

Options:

-m “straight”, —method=“straight” Define the depreciation methodology to use. Accepts, double declining balance (DDB), sum of the years digits (SUM) or straight-line (straight). Additionally, you can specify ‘mixed’ which will use DDB for the first half of the periods and straight-line for the remainder.
-c “1000”, —cost=“1000” Cost of the asset you want to depreciate
-p “10”, —periods=“10” The number of periods you wish to depreciate over
-t “years”, —periodtype=“years” The type of periods to use (days, months, years)
-r “100”, —residual=“100” The residual (or scrap) value of the asset
-a “Assets:Computers”, —asset=“Assets:Computers” Asset account
-e “Equity:Expenses:Depreciation Expense”, —expense=“Equity:Expenses:Depreciation Expense” Expense account
-o “Assets:Checking”, —payment=“Assets:Checking” Account that you used to buy the asset
-d “2011/04/02”, —date=“2011/04/02” Date of asset purchase
-n “Asset Purchase”, —note=“Asset Purchase” Memo line note
—currency=“$” Currency character in data
-s “<File Path>”, —save=“<File Path>” Save output to a file

Example:

Let’s say you buy a desk on credit that will last nine years. After nine years, the desk will have a small residual value and it depreciates in manor consistent with sum of the years digits.

./depreciate --cost="1000.33" --residual=5.22 --method="sum" --periods=9 -a "Assets:Desks" -o "Liabilities:Credit Card" -n "Purchase of New Desk" --save "~/desktop/depreciate.txt"

Example Output File:

2011/04/02 * Purchase of New Desk
	Assets:Desks		$1000.33
	Liabilities:Credit Card
2012/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$199.02
	Assets:Desks:Accumulated Depreciation
2013/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$176.91
	Assets:Desks:Accumulated Depreciation
2014/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$154.79
	Assets:Desks:Accumulated Depreciation
2015/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$132.68
	Assets:Desks:Accumulated Depreciation
2016/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$110.57
	Assets:Desks:Accumulated Depreciation
2017/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$88.45
	Assets:Desks:Accumulated Depreciation
2018/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$66.34
	Assets:Desks:Accumulated Depreciation
2019/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$44.23
	Assets:Desks:Accumulated Depreciation
2020/04/02 * Purchase of New Desk
	Equity:Expenses:Depreciation Expense		$22.12
	Assets:Desks:Accumulated Depreciation

Example:

You buy a car on loan; it will last 5 years with a scrap value of $1000. However, because you report income monthly, you’ve decided to depreciate it monthly. The car depreciates in a manor consistent with double declining balance for the first half of the periods and straight-line afterwards.

./depreciate --cost=20000 --residual=1000 --method="mixed" --periods=60 -a "Assets:Cars" -o "Liabilities:Car Loan" -n "Purchase of Leaf" --save "~/desktop/depreciate.txt" -t months

Example File:

2011/04/02 * Purchase of Leaf
	Assets:Cars		$20000.0
	Liabilities:Car Loan
2011/05/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$666.67
	Assets:Cars:Accumulated Depreciation
2011/06/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$644.44
	Assets:Cars:Accumulated Depreciation
2011/07/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$622.96
	Assets:Cars:Accumulated Depreciation
2011/08/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$602.2
	Assets:Cars:Accumulated Depreciation
2011/09/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$582.12
	Assets:Cars:Accumulated Depreciation
2011/10/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$562.72
	Assets:Cars:Accumulated Depreciation
2011/11/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$543.96
	Assets:Cars:Accumulated Depreciation
2011/12/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$525.83
	Assets:Cars:Accumulated Depreciation
2012/01/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$508.3
	Assets:Cars:Accumulated Depreciation
2012/02/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$491.36
	Assets:Cars:Accumulated Depreciation
2012/03/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$474.98
	Assets:Cars:Accumulated Depreciation
2012/04/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$459.15
	Assets:Cars:Accumulated Depreciation
2012/05/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$443.84
	Assets:Cars:Accumulated Depreciation
2012/06/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$429.05
	Assets:Cars:Accumulated Depreciation
2012/07/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$414.75
	Assets:Cars:Accumulated Depreciation
2012/08/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$400.92
	Assets:Cars:Accumulated Depreciation
2012/09/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$387.56
	Assets:Cars:Accumulated Depreciation
2012/10/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$374.64
	Assets:Cars:Accumulated Depreciation
2012/11/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$362.15
	Assets:Cars:Accumulated Depreciation
2012/12/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$350.08
	Assets:Cars:Accumulated Depreciation
2013/01/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$338.41
	Assets:Cars:Accumulated Depreciation
2013/02/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$327.13
	Assets:Cars:Accumulated Depreciation
2013/03/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$316.23
	Assets:Cars:Accumulated Depreciation
2013/04/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$305.69
	Assets:Cars:Accumulated Depreciation
2013/05/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$295.5
	Assets:Cars:Accumulated Depreciation
2013/06/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$285.65
	Assets:Cars:Accumulated Depreciation
2013/07/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$276.12
	Assets:Cars:Accumulated Depreciation
2013/08/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$266.92
	Assets:Cars:Accumulated Depreciation
2013/09/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$258.02
	Assets:Cars:Accumulated Depreciation
2013/10/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$249.42
	Assets:Cars:Accumulated Depreciation
2013/11/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2013/12/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/01/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/02/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/03/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/04/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/05/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/06/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/07/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/08/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/09/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/10/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/11/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2014/12/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/01/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/02/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/03/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/04/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/05/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/06/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/07/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/08/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/09/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/10/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/11/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2015/12/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2016/01/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2016/02/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2016/03/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.77
	Assets:Cars:Accumulated Depreciation
2016/04/02 * Purchase of Leaf
	Equity:Expenses:Depreciation Expense		$207.9
	Assets:Cars:Accumulated Depreciation

The Super Easy Way to Install (Macports)

You can install this application using MacPorts! Type the following:

sudo port -v selfupdate
sudo port install DepreciateForLedger

This method takes care of all dependancies and can manage updates for you. For information on installing MacPorts, please visit their site.

Installing:

Installing depreciate is pretty easy. Because Macs and Linux already include Python, all you need to do is download the depreciate source, decompress it, and move it wherever you want. Of course, if you use depreciate a lot you might want to add your installation location to your PATH variable.

On Windows, you need to download Python 2.x and install it before installing depreciate. Or install the version of depreciate containing Python.

Download:

Windows (Zip file, Contains Python):https://github.com/tazzben/DepreciateForLedger/blob/master/dist/depreciate_dist.zip
Windows (Zip file): https://github.com/tazzben/DepreciateForLedger/blob/master/dist/depreciate.zip
Max/Linux/Etc (tar.gz file): https://github.com/tazzben/DepreciateForLedger/blob/master/dist/depreciate.tar.gz