register: fix a regression, register should not show posting comments
This commit is contained in:
		
							parent
							
								
									1698592706
								
							
						
					
					
						commit
						298d192678
					
				| @ -135,7 +135,7 @@ showposting withtxninfo p b = concatBottomPadded [txninfo ++ pstr ++ " ", bal] + | ||||
|       datewidth = 10 | ||||
|       descwidth = datedescwidth - datewidth - 2 | ||||
|       desc = printf ("%-"++(show descwidth)++"s") $ elideRight descwidth de :: String | ||||
|       pstr = showPostingWithoutPrice p | ||||
|       pstr = showPostingForRegister p | ||||
|       bal = padleft 12 (showMixedAmountOrZeroWithoutPrice b) | ||||
|       (da,de) = case ptransaction p of Just (Transaction{tdate=da',tdescription=de'}) -> (da',de') | ||||
|                                        Nothing -> (nulldate,"") | ||||
|  | ||||
| @ -34,8 +34,8 @@ showPosting (Posting{paccount=a,pamount=amt,pcomment=com,ptype=t}) = | ||||
|       showamount = padleft 12 . showMixedAmountOrZero | ||||
|       comment = if null com then "" else "  ; " ++ com | ||||
| -- XXX refactor | ||||
| showPostingWithoutPrice (Posting{paccount=a,pamount=amt,pcomment=com,ptype=t}) = | ||||
|     concatTopPadded [showaccountname a ++ " ", showamount amt, comment] | ||||
| showPostingForRegister (Posting{paccount=a,pamount=amt,ptype=t}) = | ||||
|     concatTopPadded [showaccountname a ++ " ", showamount amt] | ||||
|     where | ||||
|       ledger3ishlayout = False | ||||
|       acctnamewidth = if ledger3ishlayout then 25 else 22 | ||||
| @ -45,7 +45,6 @@ showPostingWithoutPrice (Posting{paccount=a,pamount=amt,pcomment=com,ptype=t}) = | ||||
|                           VirtualPosting -> (\s -> "("++s++")", acctnamewidth-2) | ||||
|                           _ -> (id,acctnamewidth) | ||||
|       showamount = padleft 12 . showMixedAmountOrZeroWithoutPrice | ||||
|       comment = if null com then "" else "  ; " ++ com | ||||
| 
 | ||||
| isReal :: Posting -> Bool | ||||
| isReal p = ptype p == RegularPosting | ||||
|  | ||||
							
								
								
									
										13
									
								
								tests/print-posting-comment.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								tests/print-posting-comment.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | ||||
| # a posting comment should appear in print | ||||
| -f - print | ||||
| <<< | ||||
| 2010/01/01 x | ||||
|     a             1  ; comment | ||||
|     b            -1 | ||||
| 
 | ||||
| >>> | ||||
| 2010/01/01 x | ||||
|     a             1  ; comment | ||||
|     b            -1 | ||||
| 
 | ||||
| >>>2 | ||||
							
								
								
									
										11
									
								
								tests/register-posting-comment.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								tests/register-posting-comment.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| # a posting comment should not appear in register | ||||
| -f - register | ||||
| <<< | ||||
| 2010/1/1 x | ||||
|     a  1 ; comment | ||||
|     b | ||||
| 
 | ||||
| >>> | ||||
| 2010/01/01 x                    a                                 1            1 | ||||
|                                 b                                -1            0 | ||||
| >>>2 | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user