From 3a4f23df950ea76f7ddf2f47ef8ed2a6bea60d1b Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 1 Oct 2022 18:33:29 -1000 Subject: [PATCH] imp: lib: Hledger.Data.Amount: showMixedAmountOneLine now shows costs --- hledger-lib/Hledger/Data/Amount.hs | 4 ++-- hledger-lib/Hledger/Data/Balancing.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hledger-lib/Hledger/Data/Amount.hs b/hledger-lib/Hledger/Data/Amount.hs index f38071ea6..94b603127 100644 --- a/hledger-lib/Hledger/Data/Amount.hs +++ b/hledger-lib/Hledger/Data/Amount.hs @@ -781,11 +781,11 @@ mixedAmountUnstyled = mapMixedAmountUnsafe amountUnstyled showMixedAmount :: MixedAmount -> String 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 :: MixedAmount -> String -showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine +showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine{displayPrice=True} -- | Like showMixedAmount, but zero amounts are shown with their -- commodity if they have one. diff --git a/hledger-lib/Hledger/Data/Balancing.hs b/hledger-lib/Hledger/Data/Balancing.hs index 3e3e25f66..086cae68d 100644 --- a/hledger-lib/Hledger/Data/Balancing.hs +++ b/hledger-lib/Hledger/Data/Balancing.hs @@ -118,11 +118,11 @@ transactionCheckBalanced BalancingOpts{commodity_styles_} t = errs rmsg | rsumok = "" | 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 | bvsumok = "" | 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. isTransactionBalanced :: BalancingOpts -> Transaction -> Bool