mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
extra: fix hledger-equity, hledger-rewrite compilation
This commit is contained in:
parent
35fb60d773
commit
5d1ea71568
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user