imp: lib: Hledger.Data.Amount: showMixedAmountOneLine now shows costs
This commit is contained in:
parent
de5a97600c
commit
3a4f23df95
@ -781,11 +781,11 @@ mixedAmountUnstyled = mapMixedAmountUnsafe amountUnstyled
|
|||||||
showMixedAmount :: MixedAmount -> String
|
showMixedAmount :: MixedAmount -> String
|
||||||
showMixedAmount = wbUnpack . showMixedAmountB noColour
|
showMixedAmount = wbUnpack . showMixedAmountB noColour
|
||||||
|
|
||||||
-- | Get the one-line string representation of a mixed amount.
|
-- | Get the one-line string representation of a mixed amount (also showing any costs).
|
||||||
--
|
--
|
||||||
-- > showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine
|
-- > showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine
|
||||||
showMixedAmountOneLine :: MixedAmount -> String
|
showMixedAmountOneLine :: MixedAmount -> String
|
||||||
showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine
|
showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine{displayPrice=True}
|
||||||
|
|
||||||
-- | Like showMixedAmount, but zero amounts are shown with their
|
-- | Like showMixedAmount, but zero amounts are shown with their
|
||||||
-- commodity if they have one.
|
-- commodity if they have one.
|
||||||
|
|||||||
@ -118,11 +118,11 @@ transactionCheckBalanced BalancingOpts{commodity_styles_} t = errs
|
|||||||
rmsg
|
rmsg
|
||||||
| rsumok = ""
|
| rsumok = ""
|
||||||
| not rsignsok = "The real postings all have the same sign. Consider negating some of them."
|
| not rsignsok = "The real postings all have the same sign. Consider negating some of them."
|
||||||
| otherwise = "The real postings' sum should be 0 but is: " ++ showMixedAmountOneLine rsumcost
|
| otherwise = "The real postings' sum should be 0 but is: " ++ showMixedAmountOneLineWithoutPrice False rsumcost
|
||||||
bvmsg
|
bvmsg
|
||||||
| bvsumok = ""
|
| bvsumok = ""
|
||||||
| not bvsignsok = "The balanced virtual postings all have the same sign. Consider negating some of them."
|
| not bvsignsok = "The balanced virtual postings all have the same sign. Consider negating some of them."
|
||||||
| otherwise = "The balanced virtual postings' sum should be 0 but is: " ++ showMixedAmountOneLine bvsumcost
|
| otherwise = "The balanced virtual postings' sum should be 0 but is: " ++ showMixedAmountOneLineWithoutPrice False bvsumcost
|
||||||
|
|
||||||
-- | Legacy form of transactionCheckBalanced.
|
-- | Legacy form of transactionCheckBalanced.
|
||||||
isTransactionBalanced :: BalancingOpts -> Transaction -> Bool
|
isTransactionBalanced :: BalancingOpts -> Transaction -> Bool
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user