diff --git a/Ledger/RawTransaction.hs b/Ledger/RawTransaction.hs index 1e6eafbdc..863263ed3 100644 --- a/Ledger/RawTransaction.hs +++ b/Ledger/RawTransaction.hs @@ -16,10 +16,15 @@ import Ledger.AccountName instance Show RawTransaction where show = showRawTransaction showRawTransaction :: RawTransaction -> String -showRawTransaction t = (showaccountname $ taccount t) ++ " " ++ (showamount $ tamount t) +showRawTransaction (RawTransaction a amt _ ttype) = + showaccountname a ++ " " ++ (showamount amt) where - showaccountname = printf "%-22s" . elideAccountName 22 + showaccountname = printf "%-22s" . bracket . elideAccountName width showamount = printf "%12s" . showAmountOrZero + (bracket,width) = case ttype of + BalancedVirtualTransaction -> (\s -> "["++s++"]", 20) + VirtualTransaction -> (\s -> "("++s++")", 20) + otherwise -> (id,22) isReal :: RawTransaction -> Bool isReal t = rttype t == RegularTransaction