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
 | 
					            accttree = ledgerAccountTree (depthFromOpts opts) l
 | 
				
			||||||
      totalstr | NoTotal `elem` opts = ""
 | 
					      totalstr | NoTotal `elem` opts = ""
 | 
				
			||||||
               | not (Empty `elem` opts) && isZeroMixedAmount total = ""
 | 
					               | 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
 | 
					          where
 | 
				
			||||||
            total = sum $ map abalance $ ledgerTopAccounts l
 | 
					            total = sum $ map abalance $ ledgerTopAccounts l
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -131,11 +131,11 @@ showBalanceReport opts _ l = acctsstr ++ totalstr
 | 
				
			|||||||
showInterestingAccount :: Ledger -> [AccountName] -> AccountName -> String
 | 
					showInterestingAccount :: Ledger -> [AccountName] -> AccountName -> String
 | 
				
			||||||
showInterestingAccount l interestingaccts a = concatTopPadded [amt, "  ", depthspacer ++ partialname]
 | 
					showInterestingAccount l interestingaccts a = concatTopPadded [amt, "  ", depthspacer ++ partialname]
 | 
				
			||||||
    where
 | 
					    where
 | 
				
			||||||
      amt = padleft 20 $ showMixedAmount $ abalance $ ledgerAccount l a
 | 
					      amt = padleft 20 $ showMixedAmountWithoutPrice $ abalance $ ledgerAccount l a
 | 
				
			||||||
      -- the depth spacer (indent) is two spaces for each interesting parent
 | 
					 | 
				
			||||||
      parents = parentAccountNames a
 | 
					      parents = parentAccountNames a
 | 
				
			||||||
      interestingparents = filter (`elem` interestingaccts) parents
 | 
					      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
 | 
					      -- the partial name is the account's leaf name, prefixed by the
 | 
				
			||||||
      -- names of any boring parents immediately above
 | 
					      -- names of any boring parents immediately above
 | 
				
			||||||
      partialname = accountNameFromComponents $ reverse (map accountLeafName ps) ++ [accountLeafName a]
 | 
					      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
 | 
					      entrydesc = if omitdesc then replicate 32 ' ' else printf "%s %s " date desc
 | 
				
			||||||
      date = showDate da
 | 
					      date = showDate da
 | 
				
			||||||
      desc = printf "%-20s" $ elideRight 20 de :: String
 | 
					      desc = printf "%-20s" $ elideRight 20 de :: String
 | 
				
			||||||
      p = showPosting $ Posting s a amt "" tt
 | 
					      p = showPostingWithoutPrice $ Posting s a amt "" tt
 | 
				
			||||||
      bal = padleft 12 (showMixedAmountOrZero b)
 | 
					      bal = padleft 12 (showMixedAmountOrZeroWithoutPrice b)
 | 
				
			||||||
      Transaction{tstatus=s,tdate=da,tdescription=de,taccount=a,tamount=amt,ttype=tt} = t
 | 
					      Transaction{tstatus=s,tdate=da,tdescription=de,taccount=a,tamount=amt,ttype=tt} = t
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user