balance: fix partially-visible totals row
With --no-total in a periodic (non-cumulative, non-historical) balance report, hide the totals row completely, as in the other modes.
This commit is contained in:
		
							parent
							
								
									6da4942633
								
							
						
					
					
						commit
						95ced2da80
					
				| @ -422,16 +422,12 @@ periodBalanceReportAsText opts r@(MultiBalanceReport (colspans, items, (coltotal | ||||
|   unlines $ | ||||
|   ([printf "Balance changes in %s:" (showDateSpan $ multiBalanceReportSpan r)] ++) $ | ||||
|   trimborder $ lines $ | ||||
|    render | ||||
|     id | ||||
|     (" "++) | ||||
|     showMixedAmountOneLineWithoutPrice | ||||
|     $ Table | ||||
|    render id (" "++) showMixedAmountOneLineWithoutPrice $ | ||||
|     addtotalrow $ | ||||
|      Table | ||||
|      (T.Group NoLine $ map (Header . padright acctswidth) accts) | ||||
|      (T.Group NoLine $ map Header colheadings) | ||||
|      (map rowvals items') | ||||
|     +----+ | ||||
|     totalrow | ||||
|   where | ||||
|     trimborder = ("":) . (++[""]) . drop 1 . init . map (drop 1 . init) | ||||
|     colheadings = map showDateSpan colspans | ||||
| @ -447,11 +443,12 @@ periodBalanceReportAsText opts r@(MultiBalanceReport (colspans, items, (coltotal | ||||
|     rowvals (_,as,rowtot,rowavg) = as | ||||
|                                    ++ (if row_total_ opts then [rowtot] else []) | ||||
|                                    ++ (if average_ opts then [rowavg] else []) | ||||
|     totalrow | no_total_ opts = row "" [] | ||||
|              | otherwise      = row "" $ | ||||
|     addtotalrow | no_total_ opts = id | ||||
|                 | otherwise      = (+----+ (row "" $ | ||||
|                                     coltotals | ||||
|                                     ++ (if row_total_ opts then [tot] else []) | ||||
|                                     ++ (if average_ opts then [avg] else []) | ||||
|                                     )) | ||||
| 
 | ||||
| -- | Render a multi-column cumulative balance report as plain text suitable for console output. | ||||
| cumulativeBalanceReportAsText :: ReportOpts -> MultiBalanceReport -> String | ||||
|  | ||||
| @ -21,8 +21,6 @@ Balance changes in 2013q1: | ||||
|  assets          ||        0        1        0  | ||||
|  assets:cash     ||        0        1        0  | ||||
|  assets:checking ||        0        0        1  | ||||
| -----------------++---------------------------- | ||||
|                  ||                             | ||||
| 
 | ||||
| >>>=0 | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user