extra: fix hledger-equity, hledger-rewrite compilation

This commit is contained in:
Simon Michael 2015-05-25 08:39:50 -07:00
parent 35fb60d773
commit 5d1ea71568
2 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ main = do
withJournalDo opts $
\CliOpts{reportopts_=ropts} j -> do
today <- getCurrentDay
let ropts_ = ropts{flat_=True}
let ropts_ = ropts{accountlistmode_=ALFlat}
q = queryFromOpts today ropts_
(acctbals,_) = balanceReport ropts_ q j
balancingamt = negate $ sum $ map (\((_,_,_),b) -> b) acctbals

View File

@ -1,5 +1,5 @@
#!/usr/bin/env runhaskell
{-# LANGUAGE CPP #-}
-- {-# LANGUAGE CPP #-}
{-|
hledger-rewrite [PATTERNS] --add-posting "ACCT AMTEXPR" ...
@ -23,9 +23,9 @@ Tested-with: hledger HEAD ~ 2014/2/4
-- hledger lib, cli and cmdargs utils
import Hledger.Cli
-- more utils for parsing
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative.Compat ((<*))
#endif
-- #if !MIN_VERSION_base(4,8,0)
-- import Control.Applicative.Compat ((<*))
-- #endif
import Text.Parsec
@ -70,7 +70,7 @@ amountexprp =
amountExprRenderer :: Query -> AmountExpr -> (Transaction -> MixedAmount)
amountExprRenderer q aex =
case aex of
AmountLiteral s -> either parseerror (const . mixed) $ runParser (amountp <* eof) nullctx "" s
AmountLiteral s -> mamountp' s -- either parseerror (const . mixed) $ runParser (amountp <* eof) nullctx "" s
AmountMultiplier n -> (`divideMixedAmount` (1 / n)) . (`firstAmountMatching` q)
where
firstAmountMatching :: Transaction -> Query -> MixedAmount