hledger-irr 0.1 → 0.1.1
raw patch · 3 files changed
+12/−12 lines, 3 filesdep ~hledger-lib
Dependency ranges changed: hledger-lib
Files
- LICENSE +2/−2
- Main.hs +6/−6
- hledger-irr.cabal +4/−4
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2011 Peter Simons <simons@cryp.to>+Copyright (c) 2012 Joachim Breitner All rights reserved. Redistribution and use in source and binary forms, with or without@@ -12,7 +12,7 @@ disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Peter Simons nor the names of other+ * Neither the name of Joachim Breitner nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
Main.hs view
@@ -113,8 +113,8 @@ exitFailure thisDay <- getCurrentDay- let firstDay = minimum $ map transactionEffectiveDate ts- let lastDay = maximum $ map transactionEffectiveDate ts+ let firstDay = minimum $ map transactionDate2 ts+ let lastDay = maximum $ map transactionDate2 ts let existingSpan = DateSpan (Just firstDay) (Just lastDay) let begin = maybe firstDay (fixSmartDateStr' thisDay) (optBegin opts)@@ -129,16 +129,16 @@ forM_ spans $ \(DateSpan (Just ibegin) (Just iend)) -> do let preQuery = And [ Acct (optInvAcc opts),- EDate (openClosedSpan Nothing (Just ibegin))]+ Date (openClosedSpan Nothing (Just ibegin))] pre_amount = negate $ unMix $ accountAmount preQuery ts let prefix = (ibegin, pre_amount) - let eQuery = And [Acct (optInvAcc opts), EDate (openClosedSpan Nothing (Just iend))]+ let eQuery = And [Acct (optInvAcc opts), Date (openClosedSpan Nothing (Just iend))] let final = unMix $ accountAmount eQuery ts let postfix = (iend, final) let cfQuery = And [ Not (Or [Acct (optInvAcc opts), Acct (optInterestAcc opts)]), - EDate (openClosedSpan (Just ibegin) (Just iend)) ] + Date (openClosedSpan (Just ibegin) (Just iend)) ] let cf = calculateCashFlow cfQuery ts let totalCF = sortBy (comparing fst) $ filter ((/=0) . aquantity . snd) $ prefix : cf ++ [postfix]@@ -180,7 +180,7 @@ calculateCashFlow :: Query -> [Transaction] -> CashFlow calculateCashFlow query = map go where- go t = (transactionEffectiveDate t, amt)+ go t = (transactionDate2 t, amt) where amt = sum $ map (unMix . pamount) $ filter (matchesPosting query) $
hledger-irr.cabal view
@@ -1,5 +1,5 @@ Name: hledger-irr-Version: 0.1+Version: 0.1.1 Synopsis: computes the internal rate of return of an investment License: BSD3 License-file: LICENSE@@ -64,11 +64,11 @@ > 2011/04/01: €-50.00 > 2011/05/01: €47.00 > 2011/06/01: €90.00- > 2011/01/01 - 2012/12/07: 17.72%+ > 2011/01/01 - 2013/05/02: 17.72% > $ hledger-irr -f speculation.ledger -t "Rate Gain" -i Speculation -e 2011-03-01 > 2011/01/01 - 2011/03/01: 26.11% > $ hledger-irr -f speculation.ledger -t "Rate Gain" -i Speculation -b 2011-03-01- > 2011/03/01 - 2012/12/07: 12.28%+ > 2011/03/01 - 2013/05/02: 12.27% > $ hledger-irr -f speculation.ledger -t "Rate Gain" -i Speculation --monthly > 2011/01/01 - 2011/02/01: 12.43% > 2011/02/01 - 2011/03/01: 41.57%@@ -104,7 +104,7 @@ Executable hledger-irr Main-is: Main.hs- Build-depends: base >= 3 && < 5, hledger-lib >= 0.19.3, time, Cabal, statistics >= 0.10+ Build-depends: base >= 3 && < 5, hledger-lib == 0.20 || == 0.20.0.*, time, Cabal, statistics >= 0.10 Ghc-Options: -Wall source-repository head