mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
;lib: reader cleanups
This commit is contained in:
parent
74ce7be556
commit
0eddbe7a4b
@ -1006,7 +1006,8 @@ commodityStylesFromAmounts amts =
|
||||
commamts = groupSort [(acommodity as, as) | as <- amts]
|
||||
commstyles = [(c, canonicalStyleFrom $ map astyle as) | (c,as) <- commamts]
|
||||
|
||||
-- TODO: should probably detect and report inconsistencies here
|
||||
-- TODO: should probably detect and report inconsistencies here.
|
||||
-- Though, we don't have the info for a good error message, so maybe elsewhere.
|
||||
-- | Given a list of amount styles (assumed to be from parsed amounts
|
||||
-- in a single commodity), in parse order, choose a canonical style.
|
||||
-- Traditionally it's "the style of the first, with the maximum precision of all".
|
||||
|
@ -305,11 +305,11 @@ parseAndFinaliseJournal' parser iopts f txt = do
|
||||
--
|
||||
-- - infer transaction-implied market prices from transaction prices
|
||||
--
|
||||
journalFinalise :: InputOpts -> FilePath -> Text -> Journal -> ExceptT String IO Journal
|
||||
journalFinalise :: InputOpts -> FilePath -> Text -> ParsedJournal -> ExceptT String IO Journal
|
||||
journalFinalise iopts f txt pj = do
|
||||
t <- liftIO getClockTime
|
||||
d <- liftIO getCurrentDay
|
||||
-- Infer and apply canonical styles for each commodity (or fail).
|
||||
-- Infer and apply canonical styles for each commodity (or throw an error).
|
||||
-- This affects transaction balancing/assertions/assignments, so needs to be done early.
|
||||
-- (TODO: since #903's refactoring for hledger 1.12,
|
||||
-- journalApplyCommodityStyles here is seeing the
|
||||
|
Loading…
Reference in New Issue
Block a user