File: hledger-interest.cabal

package info (click to toggle)
haskell-hledger-interest 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 96 kB
  • ctags: 10
  • sloc: haskell: 290; makefile: 48
file content (119 lines) | stat: -rw-r--r-- 4,650 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Name:                   hledger-interest
Version:                1.4.3
Synopsis:               computes interest for a given account
License:                BSD3
License-file:           LICENSE
Author:                 Peter Simons <simons@cryp.to>
Maintainer:             Peter Simons <simons@cryp.to>
Homepage:               http://github.com/peti/hledger-interest
Category:               Finance
Build-type:             Simple
Cabal-version:          >= 1.6
Tested-with:            GHC >= 7.0.4 && <= 7.6.3
Data-files:             README.md
Description:
 hledger-interest is a small command-line utility based on Simon
 Michael's hleder library. Its purpose is to compute interest for a
 given ledger account. Using command line flags, the program can be
 configured to use various schemes for day-counting, such as act\/act,
 30\/360, 30E\/360, and 30\/360isda. Furthermore, it supports a (small)
 number of interest schemes, i.e. annual interest with a fixed rate and
 the scheme mandated by the German BGB288 (Basiszins fuer
 Verbrauchergeschaefte). Extending support for other schemes is fairly
 easy, but currently requires changes to the source code.
 .
 As an example, consider the following loan, stored in a file called
 @test.ledger@:
 .
 > 2008/09/26 Loan
 >     Assets:Bank          EUR 10000.00
 >     Liabilities:Loan
 >
 > 2008/11/27 Payment
 >     Assets:Bank          EUR -3771.12
 >     Liabilities:Loan
 >
 > 2009/05/03 Payment
 >     Assets:Bank          EUR -1200.00
 >     Liabilities:Loan
 >
 > 2010/12/10 Payment
 >     Assets:Bank          EUR -3700.00
 >     Liabilities:Loan
 .
 Suppose that loan earns 5% interest per year, and payments amortize
 interest before amortizing the principal claim, then the resulting
 ledger would look like this:
 .
 > $ hledger-interest --file=test.ledger --source=Expenses:Interest --target=Liabilities:Loan --30-360 --annual=0.05 Liabilities:Loan
 > 2008/09/26 Loan
 >     Assets:Bank              EUR  10000.00
 >     Liabilities:Loan
 >
 > 2008/11/27 Payment
 >     Assets:Bank              EUR  -3771.12
 >     Liabilities:Loan
 >
 > 2008/11/27 5.00% interest for EUR -10000.00 over 61 days
 >     Liabilities:Loan         EUR    -84.72
 >     Expenses:Interest
 >
 > 2008/12/31 5.00% interest for EUR -6313.60 over 34 days
 >     Liabilities:Loan         EUR    -29.81
 >     Expenses:Interest
 >
 > 2009/05/03 Payment
 >     Assets:Bank              EUR  -1200.00
 >     Liabilities:Loan
 >
 > 2009/05/03 5.00% interest for EUR -6343.42 over 123 days
 >     Liabilities:Loan         EUR   -108.37
 >     Expenses:Interest
 >
 > 2009/12/31 5.00% interest for EUR -5251.78 over 238 days
 >     Liabilities:Loan         EUR   -173.60
 >     Expenses:Interest
 >
 > 2010/12/10 Payment
 >     Assets:Bank              EUR  -3700.00
 >     Liabilities:Loan
 >
 > 2010/12/10 5.00% interest for EUR -5425.38 over 340 days
 >     Liabilities:Loan         EUR   -256.20
 >     Expenses:Interest
 >
 > 2010/12/31 5.00% interest for EUR -1981.58 over 21 days
 >     Liabilities:Loan         EUR     -5.78
 >     Expenses:Interest
 .
 Running the utility with @--help@ gives a brief overview over the
 available options:
 .
 > Usage: hledger-interest [OPTION...] ACCOUNT
 >   -h          --help            print this message and exit
 >   -V          --version         show version number and exit
 >   -v          --verbose         echo input ledger to stdout (default)
 >   -q          --quiet           don't echo input ledger to stdout
 >               --today           update account until today
 >   -f FILE     --file=FILE       input ledger file
 >   -s ACCOUNT  --source=ACCOUNT  interest source account
 >   -t ACCOUNT  --target=ACCOUNT  interest target account
 >               --act             use 'act' day counting convention
 >               --30-360          use '30/360' day counting convention
 >               --30E-360         use '30E/360' day counting convention
 >               --30E-360isda     use '30E/360isda' day counting convention
 >               --constant=RATE   constant interest rate
 >               --annual=RATE     annual interest rate
 >               --bgb288          compute interest according to German BGB288

Source-Repository head
  Type:                 git
  Location:             git://github.com/peti/hledger-interest.git

Executable hledger-interest
  Main-is:              Main.hs
  Build-depends:        base >= 3 && < 5, hledger-lib >= 0.20, time, mtl, Cabal
  other-modules:        Hledger.Interest
                        Hledger.Interest.DayCountConvention
                        Hledger.Interest.Rate
  Ghc-Options:          -Wall