hledger-interest 1.4.4 → 1.5
raw patch · 4 files changed
+15/−11 lines, 4 filesdep +textdep ~hledger-lib
Dependencies added: text
Dependency ranges changed: hledger-lib
Files
- Hledger/Interest.hs +4/−2
- Main.hs +5/−4
- README.md +2/−2
- hledger-interest.cabal +4/−3
Hledger/Interest.hs view
@@ -12,11 +12,13 @@ import Hledger.Data import Hledger.Interest.DayCountConvention import Hledger.Interest.Rate+ import Control.Monad.RWS+import Data.Decimal import Data.Maybe+import qualified Data.Text as T import Data.Time.Calendar import Data.Time.Calendar.OrdinalDate-import Data.Decimal type Computer = RWS Config [Transaction] InterestState @@ -82,7 +84,7 @@ perDayScalar <- daysInYear day let t = nulltransaction { tdate = day- , tdescription = showPercent ratePerAnno ++ " interest for " ++ showMixedAmount bal ++ " over " ++ show days ++ " days"+ , tdescription = T.pack $ showPercent ratePerAnno ++ " interest for " ++ showMixedAmount bal ++ " over " ++ show days ++ " days" , tpostings = [pTarget,pSource] } pTarget = nullposting
Main.hs view
@@ -1,14 +1,15 @@ module Main ( main ) where import Hledger.Interest-import Hledger.Read import Hledger.Query+import Hledger.Read import Control.Exception ( bracket ) import Control.Monad import Data.List import Data.Maybe import Data.Ord+import qualified Data.Text as T import Distribution.Text ( display ) import System.Console.GetOpt import System.Environment@@ -92,9 +93,9 @@ jnl = filterJournalTransactions (Acct interestAcc) jnl' ts = sortBy (comparing tdate) (jtxns jnl) cfg = Config- { interestAccount = interestAcc- , sourceAccount = optSourceAcc opts- , targetAccount = optTargetAcc opts+ { interestAccount = T.pack interestAcc+ , sourceAccount = T.pack (optSourceAcc opts)+ , targetAccount = T.pack (optTargetAcc opts) , dayCountConvention = fromJust (optDCC opts) , interestRate = fromJust (optRate opts) }
README.md view
@@ -2,7 +2,7 @@ ================ hledger-interest is a small command-line utility based on [Simon-Michael's hleder library](http://hledger.org/). Its purpose is to+Michael's hlegder library](http://hledger.org/). Its purpose is to compute interest for a given ledger account. Using command line flags, the program can be configured to use various [day counting conventions](http://en.wikipedia.org/wiki/Day_count_convention), such as@@ -147,7 +147,7 @@ 2010/09/15, but the money actually arrives almost half a year late: 2010/09/15 Services rendered to Customer ACME- ACME EUR -35.00 ; 1 hour @ EUR 35.00+ ACME 1 hour @ EUR 35.00 Receivable:ACME 2011/03/17 ACME
hledger-interest.cabal view
@@ -1,5 +1,5 @@ Name: hledger-interest-Version: 1.4.4+Version: 1.5 Synopsis: computes interest for a given account License: BSD3 License-file: LICENSE@@ -9,8 +9,9 @@ Category: Finance Build-type: Simple Cabal-version: >= 1.6-Tested-with: GHC >= 7.4.2 && <= 7.8.3+Tested-with: GHC > 7.10 && < 8.1 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@@ -112,7 +113,7 @@ Executable hledger-interest Main-is: Main.hs- Build-depends: base >= 3 && < 5, hledger-lib >= 0.23.98, time, mtl, Cabal, Decimal+ Build-depends: base >= 3 && < 5, hledger-lib > 1, time, mtl, Cabal, Decimal, text other-modules: Hledger.Interest Hledger.Interest.DayCountConvention Hledger.Interest.Rate