;refactor balance report column headings
This commit is contained in:
		
							parent
							
								
									09b1736d5a
								
							
						
					
					
						commit
						0a9b05f3fd
					
				@ -602,12 +602,13 @@ balanceReportAsTable opts@ReportOpts{average_, row_total_, balancetype_}
 | 
				
			|||||||
     (map rowvals items)
 | 
					     (map rowvals items)
 | 
				
			||||||
  where
 | 
					  where
 | 
				
			||||||
    totalscolumn = row_total_ && balancetype_ `notElem` [CumulativeChange, HistoricalBalance]
 | 
					    totalscolumn = row_total_ && balancetype_ `notElem` [CumulativeChange, HistoricalBalance]
 | 
				
			||||||
    mkDate = case balancetype_ of
 | 
					    colheadings = map mkheading colspans
 | 
				
			||||||
       PeriodChange -> showDateSpanMonthAbbrev
 | 
					 | 
				
			||||||
       _            -> maybe "" (showDate . prevday) . spanEnd
 | 
					 | 
				
			||||||
    colheadings = map mkDate colspans
 | 
					 | 
				
			||||||
                  ++ ["  Total" | totalscolumn]
 | 
					                  ++ ["  Total" | totalscolumn]
 | 
				
			||||||
                  ++ ["Average" | average_]
 | 
					                  ++ ["Average" | average_]
 | 
				
			||||||
 | 
					      where
 | 
				
			||||||
 | 
					        mkheading = case balancetype_ of
 | 
				
			||||||
 | 
					          PeriodChange -> showDateSpanMonthAbbrev
 | 
				
			||||||
 | 
					          _            -> maybe "" (showDate . prevday) . spanEnd
 | 
				
			||||||
    accts = map renderacct items
 | 
					    accts = map renderacct items
 | 
				
			||||||
    renderacct row =
 | 
					    renderacct row =
 | 
				
			||||||
        replicate ((prrDepth row - 1) * 2) ' ' ++ T.unpack (prrDisplayName row)
 | 
					        replicate ((prrDepth row - 1) * 2) ' ' ++ T.unpack (prrDisplayName row)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user