slight fix for --sort-amount, don't flip when normal balance unspecified
This commit is contained in:
		
							parent
							
								
									d9d92b3bf1
								
							
						
					
					
						commit
						cd998e7f2f
					
				| @ -110,7 +110,7 @@ balanceReport opts q j = (items, total) | |||||||
|             markboring  = if no_elide_ opts then id else markBoringParentAccounts |             markboring  = if no_elide_ opts then id else markBoringParentAccounts | ||||||
|             maybesort   = if sort_amount_ opts then sortBy (maybeflip $ comparing balance) else id |             maybesort   = if sort_amount_ opts then sortBy (maybeflip $ comparing balance) else id | ||||||
|               where |               where | ||||||
|                 maybeflip = if normalbalance_ opts == Just NormalPositive then flip else id |                 maybeflip = if normalbalance_ opts == Just NormalNegative then id else flip | ||||||
|       items = dbg1 "items" $ map (balanceReportItem opts q) accts' |       items = dbg1 "items" $ map (balanceReportItem opts q) accts' | ||||||
|       total | not (flat_ opts) = dbg1 "total" $ sum [amt | (_,_,indent,amt) <- items, indent == 0] |       total | not (flat_ opts) = dbg1 "total" $ sum [amt | (_,_,indent,amt) <- items, indent == 0] | ||||||
|             | otherwise        = dbg1 "total" $ |             | otherwise        = dbg1 "total" $ | ||||||
|  | |||||||
| @ -186,7 +186,7 @@ multiBalanceReport opts q j = MultiBalanceReport (displayspans, items, totalsrow | |||||||
|           where |           where | ||||||
|             -- reverse the sort if doing a balance report on normally-negative accounts, |             -- reverse the sort if doing a balance report on normally-negative accounts, | ||||||
|             -- so eg a large negative income balance appears at top in income statement |             -- so eg a large negative income balance appears at top in income statement | ||||||
|             maybeflip = if normalbalance_ opts == Just NormalPositive then flip else id |             maybeflip = if normalbalance_ opts == Just NormalNegative then id else flip | ||||||
|             -- sort by average when that is displayed, instead of total.  |             -- sort by average when that is displayed, instead of total.  | ||||||
|             -- Usually equivalent, but perhaps not in future (eg with --percent) |             -- Usually equivalent, but perhaps not in future (eg with --percent) | ||||||
|             sortfield = if average_ opts then sixth6 else fifth6  |             sortfield = if average_ opts then sixth6 else fifth6  | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user