ui: always enable periodic transactions and transaction modifiers
Rule-based transactions and postings are always generated (--forecast and --auto are always on). Experimental.
This commit is contained in:
		
							parent
							
								
									b85bbbb095
								
							
						
					
					
						commit
						2edb1f2705
					
				| @ -90,6 +90,7 @@ asInit d reset ui@UIState{ | |||||||
|     -- run the report |     -- run the report | ||||||
|     (items,_total) = report ropts' q j |     (items,_total) = report ropts' q j | ||||||
|       where |       where | ||||||
|  |                  -- XXX in historical mode, --forecast throws off the starting balances | ||||||
|         report | balancetype_ ropts == HistoricalBalance = balanceReportFromMultiBalanceReport |         report | balancetype_ ropts == HistoricalBalance = balanceReportFromMultiBalanceReport | ||||||
|                | otherwise                               = balanceReport |                | otherwise                               = balanceReport | ||||||
|                     -- still using the old balanceReport for change reports as it |                     -- still using the old balanceReport for change reports as it | ||||||
|  | |||||||
| @ -71,19 +71,21 @@ main = do | |||||||
|         | otherwise                                                = withJournalDoUICommand opts runBrickUi |         | otherwise                                                = withJournalDoUICommand opts runBrickUi | ||||||
| 
 | 
 | ||||||
| -- TODO fix nasty duplication of withJournalDo | -- TODO fix nasty duplication of withJournalDo | ||||||
|  | -- | hledger-ui's version of withJournalDo. Enables --auto and --forecast. | ||||||
| withJournalDoUICommand :: UIOpts -> (UIOpts -> Journal -> IO ()) -> IO () | withJournalDoUICommand :: UIOpts -> (UIOpts -> Journal -> IO ()) -> IO () | ||||||
| withJournalDoUICommand uopts@UIOpts{cliopts_=copts} cmd = do | withJournalDoUICommand uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=iopts,reportopts_=ropts}} cmd = do | ||||||
|   journalpath <- journalFilePathFromOpts copts |   let copts' = copts{inputopts_=iopts{auto_=True}, reportopts_=ropts{forecast_=True}} | ||||||
|   ej <- readJournalFiles (inputopts_ copts) journalpath |   journalpath <- journalFilePathFromOpts copts' | ||||||
|  |   ej <- readJournalFiles (inputopts_ copts') journalpath | ||||||
|   let fn = cmd uopts |   let fn = cmd uopts | ||||||
|          . pivotByOpts copts |          . pivotByOpts copts' | ||||||
|          . anonymiseByOpts copts |          . anonymiseByOpts copts' | ||||||
|        <=< journalApplyValue (reportopts_ copts) |        <=< journalApplyValue (reportopts_ copts') | ||||||
|        <=< journalAddForecast copts |        <=< journalAddForecast copts' | ||||||
|   either error' fn ej |   either error' fn ej | ||||||
| 
 | 
 | ||||||
| runBrickUi :: UIOpts -> Journal -> IO () | runBrickUi :: UIOpts -> Journal -> IO () | ||||||
| runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do | runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=_iopts,reportopts_=ropts}} j = do | ||||||
|   d <- getCurrentDay |   d <- getCurrentDay | ||||||
| 
 | 
 | ||||||
|   let |   let | ||||||
|  | |||||||
| @ -44,7 +44,11 @@ hledger-ui is hledger's curses-style interface, providing an efficient full-wind | |||||||
| for viewing accounts and transactions, and some limited data entry capability. | for viewing accounts and transactions, and some limited data entry capability. | ||||||
| It is easier than hledger's command-line interface, and  | It is easier than hledger's command-line interface, and  | ||||||
| sometimes quicker and more convenient than the web interface. | sometimes quicker and more convenient than the web interface. | ||||||
| Note hledger-ui hides transactions dated in the future, by default. | 
 | ||||||
|  | Note hledger-ui has some different defaults: | ||||||
|  | - it generates rule-based transactions and postings by default (--forecast and --auto are always on).  | ||||||
|  | - it hides transactions dated in the future by default (change this with --future or the F key). | ||||||
|  | Experimental. | ||||||
| 
 | 
 | ||||||
| Like hledger, it reads _files_ | Like hledger, it reads _files_ | ||||||
| For more about this see hledger(1), hledger_journal(5) etc. | For more about this see hledger(1), hledger_journal(5) etc. | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user