;check: refactor
This commit is contained in:
		
							parent
							
								
									ffb985f1a2
								
							
						
					
					
						commit
						642ad24b0e
					
				| @ -14,15 +14,13 @@ import Hledger.Cli.CliOptions | |||||||
| 
 | 
 | ||||||
| journalCheckOrdereddates :: CliOpts -> Journal -> Either String () | journalCheckOrdereddates :: CliOpts -> Journal -> Either String () | ||||||
| journalCheckOrdereddates CliOpts{reportspec_=rspec} j = do | journalCheckOrdereddates CliOpts{reportspec_=rspec} j = do | ||||||
|   let ropts = (rsOpts rspec){accountlistmode_=ALFlat} |   let  | ||||||
|   let ts = filter (rsQuery rspec `matchesTransaction`) $ |     ropts = (rsOpts rspec){accountlistmode_=ALFlat} | ||||||
|  |     ts = filter (rsQuery rspec `matchesTransaction`) $ | ||||||
|            jtxns $ journalSelectingAmountFromOpts ropts j |            jtxns $ journalSelectingAmountFromOpts ropts j | ||||||
|   let checkunique = False -- boolopt "unique" rawopts  XXX was supported by checkdates command |     checkunique = False -- boolopt "unique" rawopts  XXX was supported by checkdates command | ||||||
|   let getdate = transactionDateFn ropts |     compare a b = if checkunique then getdate a < getdate b else getdate a <= getdate b | ||||||
|   let compare a b = |       where getdate = transactionDateFn ropts | ||||||
|         if checkunique |  | ||||||
|         then getdate a <  getdate b |  | ||||||
|         else getdate a <= getdate b |  | ||||||
|   case checkTransactions compare ts of |   case checkTransactions compare ts of | ||||||
|     FoldAcc{fa_previous=Nothing} -> return () |     FoldAcc{fa_previous=Nothing} -> return () | ||||||
|     FoldAcc{fa_error=Nothing}    -> return () |     FoldAcc{fa_error=Nothing}    -> return () | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user