don't show trailing spaces on amountless postings
This commit is contained in:
		
							parent
							
								
									18e9f826d6
								
							
						
					
					
						commit
						3e6943e5f6
					
				@ -71,14 +71,13 @@ showLedgerTransaction' elide t =
 | 
			
		||||
          | otherwise = map showposting ps
 | 
			
		||||
          where
 | 
			
		||||
            showposting p = showacct p ++ "  " ++ (showamount $ pamount p) ++ (showcomment $ pcomment p)
 | 
			
		||||
            showpostingnoamt p = showacct p ++ "              " ++ (showcomment $ pcomment p)
 | 
			
		||||
            showpostingnoamt p = rstrip $ showacct p ++ "              " ++ (showcomment $ pcomment p)
 | 
			
		||||
            showacct p = "    " ++ showstatus p ++ (showaccountname $ paccount p)
 | 
			
		||||
            showamount = printf "%12s" . showMixedAmount
 | 
			
		||||
            showaccountname s = printf "%-34s" s
 | 
			
		||||
            showcomment s = if (length s) > 0 then "  ; "++s else ""
 | 
			
		||||
            showstatus p = case pstatus p of
 | 
			
		||||
                       True -> "* "
 | 
			
		||||
                       False -> ""
 | 
			
		||||
            showstatus p = if pstatus p then "* " else ""
 | 
			
		||||
            rstrip = reverse . dropWhile (== ' ') . reverse
 | 
			
		||||
 | 
			
		||||
isLedgerTransactionBalanced :: LedgerTransaction -> Bool
 | 
			
		||||
isLedgerTransactionBalanced (LedgerTransaction {ltpostings=ps}) = 
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								Tests.hs
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Tests.hs
									
									
									
									
									
								
							@ -748,6 +748,9 @@ tests = [
 | 
			
		||||
 | 
			
		||||
  ,"show hours" ~: show (hours 1) ~?= "1.0h"
 | 
			
		||||
 | 
			
		||||
  ,"showLedgerTransaction" ~: do
 | 
			
		||||
     showLedgerTransaction entry1 `is` entry1_str
 | 
			
		||||
 | 
			
		||||
  ,"smart dates" ~: do
 | 
			
		||||
    let str `gives` datestr = fixSmartDateStr (parsedate "2008/11/26") str `is` datestr
 | 
			
		||||
    "1999-12-02"   `gives` "1999/12/02"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user