bal: cleanup

[ci skip]
This commit is contained in:
Simon Michael 2017-04-25 19:39:09 -07:00
parent 02eb809348
commit 6c2d2c0a6a

View File

@ -428,17 +428,11 @@ renderComponent opts (acctname, depth, total) (FormatField ljust min max field)
Just m -> depth * m Just m -> depth * m
Nothing -> depth Nothing -> depth
AccountField -> formatString ljust min max (T.unpack acctname) AccountField -> formatString ljust min max (T.unpack acctname)
TotalField -> TotalField -> fitStringMulti min max True False $ showamt total
-- TODO: does not color multicommodity amounts where
-- setamtcolor $ fitStringMulti min max True False $ showMixedAmountWithoutPrice total showamt | color_ opts = cshowMixedAmountWithoutPrice
fitStringMulti min max True False $ showamt total | otherwise = showMixedAmountWithoutPrice
_ -> "" _ -> ""
where
showamt | color_ opts = cshowMixedAmountWithoutPrice
| otherwise = showMixedAmountWithoutPrice
-- setamtcolor
-- | color_ opts && isNegativeMixedAmount total == Just True = color Dull Red
-- | otherwise = id
-- | Render one StringFormat component for a balance report item. -- | Render one StringFormat component for a balance report item.
-- This variant is for use with OneLine string formats; it squashes -- This variant is for use with OneLine string formats; it squashes
@ -452,16 +446,11 @@ renderComponent1 opts (acctname, depth, total) (FormatField ljust min max field)
-- better to indent the account name here rather than use a DepthField component -- better to indent the account name here rather than use a DepthField component
-- so that it complies with width spec. Uses a fixed indent step size. -- so that it complies with width spec. Uses a fixed indent step size.
indented = ((replicate (depth*2) ' ')++) indented = ((replicate (depth*2) ' ')++)
TotalField -> TotalField -> fitStringMulti min max True False $ ((intercalate ", " . map strip . lines) (showamt total))
-- setamtcolor $ fitStringMulti min max True False $ ((intercalate ", " . map strip . lines) (showMixedAmountWithoutPrice total)) where
fitStringMulti min max True False $ ((intercalate ", " . map strip . lines) (showamt total)) showamt | color_ opts = cshowMixedAmountWithoutPrice
| otherwise = showMixedAmountWithoutPrice
_ -> "" _ -> ""
where
showamt | color_ opts = cshowMixedAmountWithoutPrice
| otherwise = showMixedAmountWithoutPrice
-- setamtcolor
-- | color_ opts && isNegativeMixedAmount total == Just True = color Dull Red
-- | otherwise = id
-- multi-column balance reports -- multi-column balance reports