preserve correct file order when using --auto (fixes #949)
And clarify parseAndFinaliseJournal a bit.
This commit is contained in:
		
							parent
							
								
									a0b0fedd31
								
							
						
					
					
						commit
						228fc9eb3c
					
				| @ -264,14 +264,23 @@ parseAndFinaliseJournal parser iopts f txt = do | |||||||
|         -- time. If we are only running once, we reorder and follow |         -- time. If we are only running once, we reorder and follow | ||||||
|         -- the options for checking assertions. |         -- the options for checking assertions. | ||||||
|         let fj = if auto_ iopts && (not . null . jtxnmodifiers) pj |         let fj = if auto_ iopts && (not . null . jtxnmodifiers) pj | ||||||
|                  then applyTransactionModifiers <$> | 
 | ||||||
|                       (journalBalanceTransactions False $ |                  -- with transaction modifiers | ||||||
|                        journalReverse $ |                  then | ||||||
|                        journalApplyCommodityStyles pj) >>= |                    -- first pass | ||||||
|                       (\j -> journalBalanceTransactions (not $ ignore_assertions_ iopts) $ |                    applyTransactionModifiers <$> | ||||||
|                              journalAddFile (f, txt) $ |                      (journalBalanceTransactions False $ | ||||||
|                              journalSetLastReadTime t $ |                       -- journalReverse $  -- can skip this one | ||||||
|                              j) |                       journalApplyCommodityStyles pj) | ||||||
|  |                    -- second pass | ||||||
|  |                    >>= (\j -> | ||||||
|  |                       journalBalanceTransactions (not $ ignore_assertions_ iopts) $ | ||||||
|  |                       journalReverse $ | ||||||
|  |                       journalAddFile (f, txt) $ | ||||||
|  |                       journalSetLastReadTime t $ | ||||||
|  |                       j) | ||||||
|  | 
 | ||||||
|  |                  -- without transaction modifiers | ||||||
|                  else journalBalanceTransactions (not $ ignore_assertions_ iopts) $ |                  else journalBalanceTransactions (not $ ignore_assertions_ iopts) $ | ||||||
|                       journalReverse $ |                       journalReverse $ | ||||||
|                       journalAddFile (f, txt) $ |                       journalAddFile (f, txt) $ | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user