balance, register: don't show amount prices any more, like c++ ledger
Note print still shows all amount prices, unlike ledger (and supports -B); it looks useful.
This commit is contained in:
parent
f924cbbd4a
commit
984da9c504
@ -123,7 +123,7 @@ showBalanceReport opts _ l = acctsstr ++ totalstr
|
||||
accttree = ledgerAccountTree (depthFromOpts opts) l
|
||||
totalstr | NoTotal `elem` opts = ""
|
||||
| not (Empty `elem` opts) && isZeroMixedAmount total = ""
|
||||
| otherwise = printf "--------------------\n%s\n" $ padleft 20 $ showMixedAmount total
|
||||
| otherwise = printf "--------------------\n%s\n" $ padleft 20 $ showMixedAmountWithoutPrice total
|
||||
where
|
||||
total = sum $ map abalance $ ledgerTopAccounts l
|
||||
|
||||
@ -131,11 +131,11 @@ showBalanceReport opts _ l = acctsstr ++ totalstr
|
||||
showInterestingAccount :: Ledger -> [AccountName] -> AccountName -> String
|
||||
showInterestingAccount l interestingaccts a = concatTopPadded [amt, " ", depthspacer ++ partialname]
|
||||
where
|
||||
amt = padleft 20 $ showMixedAmount $ abalance $ ledgerAccount l a
|
||||
-- the depth spacer (indent) is two spaces for each interesting parent
|
||||
amt = padleft 20 $ showMixedAmountWithoutPrice $ abalance $ ledgerAccount l a
|
||||
parents = parentAccountNames a
|
||||
interestingparents = filter (`elem` interestingaccts) parents
|
||||
depthspacer = replicate (2 * length interestingparents) ' '
|
||||
depthspacer = replicate (indentperlevel * length interestingparents) ' '
|
||||
indentperlevel = 2
|
||||
-- the partial name is the account's leaf name, prefixed by the
|
||||
-- names of any boring parents immediately above
|
||||
partialname = accountNameFromComponents $ reverse (map accountLeafName ps) ++ [accountLeafName a]
|
||||
|
||||
@ -109,7 +109,7 @@ showtxn omitdesc t b = concatBottomPadded [entrydesc ++ p ++ " ", bal] ++ "\n"
|
||||
entrydesc = if omitdesc then replicate 32 ' ' else printf "%s %s " date desc
|
||||
date = showDate da
|
||||
desc = printf "%-20s" $ elideRight 20 de :: String
|
||||
p = showPosting $ Posting s a amt "" tt
|
||||
bal = padleft 12 (showMixedAmountOrZero b)
|
||||
p = showPostingWithoutPrice $ Posting s a amt "" tt
|
||||
bal = padleft 12 (showMixedAmountOrZeroWithoutPrice b)
|
||||
Transaction{tstatus=s,tdate=da,tdescription=de,taccount=a,tamount=amt,ttype=tt} = t
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user