mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 10:17:35 +03:00
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
|
||||
(items,_total) = report ropts' q j
|
||||
where
|
||||
-- XXX in historical mode, --forecast throws off the starting balances
|
||||
report | balancetype_ ropts == HistoricalBalance = balanceReportFromMultiBalanceReport
|
||||
| otherwise = balanceReport
|
||||
-- still using the old balanceReport for change reports as it
|
||||
|
@ -71,19 +71,21 @@ main = do
|
||||
| otherwise = withJournalDoUICommand opts runBrickUi
|
||||
|
||||
-- TODO fix nasty duplication of withJournalDo
|
||||
-- | hledger-ui's version of withJournalDo. Enables --auto and --forecast.
|
||||
withJournalDoUICommand :: UIOpts -> (UIOpts -> Journal -> IO ()) -> IO ()
|
||||
withJournalDoUICommand uopts@UIOpts{cliopts_=copts} cmd = do
|
||||
journalpath <- journalFilePathFromOpts copts
|
||||
ej <- readJournalFiles (inputopts_ copts) journalpath
|
||||
withJournalDoUICommand uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=iopts,reportopts_=ropts}} cmd = do
|
||||
let copts' = copts{inputopts_=iopts{auto_=True}, reportopts_=ropts{forecast_=True}}
|
||||
journalpath <- journalFilePathFromOpts copts'
|
||||
ej <- readJournalFiles (inputopts_ copts') journalpath
|
||||
let fn = cmd uopts
|
||||
. pivotByOpts copts
|
||||
. anonymiseByOpts copts
|
||||
<=< journalApplyValue (reportopts_ copts)
|
||||
<=< journalAddForecast copts
|
||||
. pivotByOpts copts'
|
||||
. anonymiseByOpts copts'
|
||||
<=< journalApplyValue (reportopts_ copts')
|
||||
<=< journalAddForecast copts'
|
||||
either error' fn ej
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
It is easier than hledger's command-line interface, and
|
||||
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_
|
||||
For more about this see hledger(1), hledger_journal(5) etc.
|
||||
|
Loading…
Reference in New Issue
Block a user