;update manuals
This commit is contained in:
		
							parent
							
								
									f4c8b52885
								
							
						
					
					
						commit
						b92a842728
					
				| @ -155,8 +155,9 @@ convert amounts to their market value in commodity COMM | |||||||
| \f[B]\f[CB]--value\f[B]\f[R] | \f[B]\f[CB]--value\f[B]\f[R] | ||||||
| convert amounts to cost or market value, more flexibly than -B/-V/-X | convert amounts to cost or market value, more flexibly than -B/-V/-X | ||||||
| .TP | .TP | ||||||
| \f[B]\f[CB]--infer-value\f[B]\f[R] | \f[B]\f[CB]--infer-market-prices\f[B]\f[R] | ||||||
| with -V/-X/--value, also infer market prices from transactions | use transaction prices (recorded with \[at] or \[at]\[at]) as additional | ||||||
|  | market prices, as if they were P directives | ||||||
| .TP | .TP | ||||||
| \f[B]\f[CB]--auto\f[B]\f[R] | \f[B]\f[CB]--auto\f[B]\f[R] | ||||||
| apply automated posting rules to modify transactions. | apply automated posting rules to modify transactions. | ||||||
|  | |||||||
| @ -1,7 +1,8 @@ | |||||||
| This is hledger-ui.info, produced by makeinfo version 6.7 from stdin. | This is hledger-ui/hledger-ui.info, produced by makeinfo version 4.8 | ||||||
|  | from stdin. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-ui.info,  Node: Top,  Next: OPTIONS,  Up: (dir) | File: hledger-ui.info,  Node: Top,  Up: (dir) | ||||||
| 
 | 
 | ||||||
| hledger-ui(1) | hledger-ui(1) | ||||||
| ************* | ************* | ||||||
| @ -9,8 +10,8 @@ hledger-ui(1) | |||||||
| hledger-ui is a terminal interface (TUI) for the hledger accounting | hledger-ui is a terminal interface (TUI) for the hledger accounting | ||||||
| tool. This manual is for hledger-ui 1.20.99. | tool. This manual is for hledger-ui 1.20.99. | ||||||
| 
 | 
 | ||||||
|    'hledger-ui [OPTIONS] [QUERYARGS]' |    `hledger-ui [OPTIONS] [QUERYARGS]' | ||||||
| 'hledger ui -- [OPTIONS] [QUERYARGS]' | `hledger ui -- [OPTIONS] [QUERYARGS]' | ||||||
| 
 | 
 | ||||||
|    hledger is a reliable, cross-platform set of programs for tracking |    hledger is a reliable, cross-platform set of programs for tracking | ||||||
| money, time, or any other commodity, using double-entry accounting and a | money, time, or any other commodity, using double-entry accounting and a | ||||||
| @ -24,9 +25,9 @@ interface, and sometimes quicker and more convenient than the web | |||||||
| interface. | interface. | ||||||
| 
 | 
 | ||||||
|    Like hledger, it reads data from one or more files in hledger |    Like hledger, it reads data from one or more files in hledger | ||||||
| journal, timeclock, timedot, or CSV format specified with '-f', or | journal, timeclock, timedot, or CSV format specified with `-f', or | ||||||
| '$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps | `$LEDGER_FILE', or `$HOME/.hledger.journal' (on windows, perhaps | ||||||
| 'C:/Users/USER/.hledger.journal').  For more about this see hledger(1), | `C:/Users/USER/.hledger.journal'). For more about this see hledger(1), | ||||||
| hledger_journal(5) etc. | hledger_journal(5) etc. | ||||||
| 
 | 
 | ||||||
|    Unlike hledger, hledger-ui hides all future-dated transactions by |    Unlike hledger, hledger-ui hides all future-dated transactions by | ||||||
| @ -49,139 +50,137 @@ File: hledger-ui.info,  Node: OPTIONS,  Next: KEYS,  Prev: Top,  Up: Top | |||||||
| 1 OPTIONS | 1 OPTIONS | ||||||
| ********* | ********* | ||||||
| 
 | 
 | ||||||
| Note: if invoking hledger-ui as a hledger subcommand, write '--' before | Note: if invoking hledger-ui as a hledger subcommand, write `--' before | ||||||
| options as shown above. | options as shown above. | ||||||
| 
 | 
 | ||||||
|    Any QUERYARGS are interpreted as a hledger search query which filters |    Any QUERYARGS are interpreted as a hledger search query which filters | ||||||
| the data. | the data. | ||||||
| 
 | 
 | ||||||
| '--watch' | `--watch' | ||||||
| 
 |  | ||||||
|      watch for data and date changes and reload automatically |      watch for data and date changes and reload automatically | ||||||
| '--theme=default|terminal|greenterm' |  | ||||||
| 
 | 
 | ||||||
|  | `--theme=default|terminal|greenterm' | ||||||
|      use this custom display theme |      use this custom display theme | ||||||
| '--register=ACCTREGEX' |  | ||||||
| 
 | 
 | ||||||
|  | `--register=ACCTREGEX' | ||||||
|      start in the (first) matched account's register screen |      start in the (first) matched account's register screen | ||||||
| '--change' |  | ||||||
| 
 | 
 | ||||||
|  | `--change' | ||||||
|      show period balances (changes) at startup instead of historical |      show period balances (changes) at startup instead of historical | ||||||
|      balances |      balances | ||||||
| '-l --flat' |  | ||||||
| 
 | 
 | ||||||
|  | `-l --flat' | ||||||
|      show accounts as a flat list (default) |      show accounts as a flat list (default) | ||||||
| '-t --tree' |  | ||||||
| 
 | 
 | ||||||
|  | `-t --tree' | ||||||
|      show accounts as a tree |      show accounts as a tree | ||||||
| 
 | 
 | ||||||
|    hledger input options: |    hledger input options: | ||||||
| 
 | 
 | ||||||
| '-f FILE --file=FILE' | `-f FILE --file=FILE' | ||||||
| 
 |  | ||||||
|      use a different input file. For stdin, use - (default: |      use a different input file. For stdin, use - (default: | ||||||
|      '$LEDGER_FILE' or '$HOME/.hledger.journal') |      `$LEDGER_FILE' or `$HOME/.hledger.journal') | ||||||
| '--rules-file=RULESFILE' |  | ||||||
| 
 | 
 | ||||||
|  | `--rules-file=RULESFILE' | ||||||
|      Conversion rules file to use when reading CSV (default: FILE.rules) |      Conversion rules file to use when reading CSV (default: FILE.rules) | ||||||
| '--separator=CHAR' |  | ||||||
| 
 | 
 | ||||||
|  | `--separator=CHAR' | ||||||
|      Field separator to expect when reading CSV (default: ',') |      Field separator to expect when reading CSV (default: ',') | ||||||
| '--alias=OLD=NEW' |  | ||||||
| 
 | 
 | ||||||
|  | `--alias=OLD=NEW' | ||||||
|      rename accounts named OLD to NEW |      rename accounts named OLD to NEW | ||||||
| '--anon' |  | ||||||
| 
 | 
 | ||||||
|  | `--anon' | ||||||
|      anonymize accounts and payees |      anonymize accounts and payees | ||||||
| '--pivot FIELDNAME' |  | ||||||
| 
 | 
 | ||||||
|  | `--pivot FIELDNAME' | ||||||
|      use some other field or tag for the account name |      use some other field or tag for the account name | ||||||
| '-I --ignore-assertions' |  | ||||||
| 
 | 
 | ||||||
|  | `-I --ignore-assertions' | ||||||
|      disable balance assertion checks (note: does not disable balance |      disable balance assertion checks (note: does not disable balance | ||||||
|      assignments) |      assignments) | ||||||
| '-s --strict' |  | ||||||
| 
 | 
 | ||||||
|  | `-s --strict' | ||||||
|      do extra error checking (check that all posted accounts are |      do extra error checking (check that all posted accounts are | ||||||
|      declared) |      declared) | ||||||
| 
 | 
 | ||||||
|    hledger reporting options: |    hledger reporting options: | ||||||
| 
 | 
 | ||||||
| '-b --begin=DATE' | `-b --begin=DATE' | ||||||
| 
 |  | ||||||
|      include postings/txns on or after this date |      include postings/txns on or after this date | ||||||
| '-e --end=DATE' |  | ||||||
| 
 | 
 | ||||||
|  | `-e --end=DATE' | ||||||
|      include postings/txns before this date |      include postings/txns before this date | ||||||
| '-D --daily' |  | ||||||
| 
 | 
 | ||||||
|  | `-D --daily' | ||||||
|      multiperiod/multicolumn report by day |      multiperiod/multicolumn report by day | ||||||
| '-W --weekly' |  | ||||||
| 
 | 
 | ||||||
|  | `-W --weekly' | ||||||
|      multiperiod/multicolumn report by week |      multiperiod/multicolumn report by week | ||||||
| '-M --monthly' |  | ||||||
| 
 | 
 | ||||||
|  | `-M --monthly' | ||||||
|      multiperiod/multicolumn report by month |      multiperiod/multicolumn report by month | ||||||
| '-Q --quarterly' |  | ||||||
| 
 | 
 | ||||||
|  | `-Q --quarterly' | ||||||
|      multiperiod/multicolumn report by quarter |      multiperiod/multicolumn report by quarter | ||||||
| '-Y --yearly' |  | ||||||
| 
 | 
 | ||||||
|  | `-Y --yearly' | ||||||
|      multiperiod/multicolumn report by year |      multiperiod/multicolumn report by year | ||||||
| '-p --period=PERIODEXP' |  | ||||||
| 
 | 
 | ||||||
|  | `-p --period=PERIODEXP' | ||||||
|      set start date, end date, and/or reporting interval all at once |      set start date, end date, and/or reporting interval all at once | ||||||
|      using period expressions syntax |      using period expressions syntax | ||||||
| '--date2' |  | ||||||
| 
 | 
 | ||||||
|  | `--date2' | ||||||
|      match the secondary date instead (see command help for other |      match the secondary date instead (see command help for other | ||||||
|      effects) |      effects) | ||||||
| '-U --unmarked' |  | ||||||
| 
 | 
 | ||||||
|  | `-U --unmarked' | ||||||
|      include only unmarked postings/txns (can combine with -P or -C) |      include only unmarked postings/txns (can combine with -P or -C) | ||||||
| '-P --pending' |  | ||||||
| 
 | 
 | ||||||
|  | `-P --pending' | ||||||
|      include only pending postings/txns |      include only pending postings/txns | ||||||
| '-C --cleared' |  | ||||||
| 
 | 
 | ||||||
|  | `-C --cleared' | ||||||
|      include only cleared postings/txns |      include only cleared postings/txns | ||||||
| '-R --real' |  | ||||||
| 
 | 
 | ||||||
|  | `-R --real' | ||||||
|      include only non-virtual postings |      include only non-virtual postings | ||||||
| '-NUM --depth=NUM' |  | ||||||
| 
 | 
 | ||||||
|  | `-NUM --depth=NUM' | ||||||
|      hide/aggregate accounts or postings more than NUM levels deep |      hide/aggregate accounts or postings more than NUM levels deep | ||||||
| '-E --empty' |  | ||||||
| 
 | 
 | ||||||
|  | `-E --empty' | ||||||
|      show items with zero amount, normally hidden (and vice-versa in |      show items with zero amount, normally hidden (and vice-versa in | ||||||
|      hledger-ui/hledger-web) |      hledger-ui/hledger-web) | ||||||
| '-B --cost' |  | ||||||
| 
 | 
 | ||||||
|  | `-B --cost' | ||||||
|      convert amounts to their cost/selling amount at transaction time |      convert amounts to their cost/selling amount at transaction time | ||||||
| '-V --market' |  | ||||||
| 
 | 
 | ||||||
|  | `-V --market' | ||||||
|      convert amounts to their market value in default valuation |      convert amounts to their market value in default valuation | ||||||
|      commodities |      commodities | ||||||
| '-X --exchange=COMM' |  | ||||||
| 
 | 
 | ||||||
|  | `-X --exchange=COMM' | ||||||
|      convert amounts to their market value in commodity COMM |      convert amounts to their market value in commodity COMM | ||||||
| '--value' |  | ||||||
| 
 | 
 | ||||||
|  | `--value' | ||||||
|      convert amounts to cost or market value, more flexibly than |      convert amounts to cost or market value, more flexibly than | ||||||
|      -B/-V/-X |      -B/-V/-X | ||||||
| '--infer-value' |  | ||||||
| 
 | 
 | ||||||
|      with -V/-X/-value, also infer market prices from transactions | `--infer-market-prices' | ||||||
| '--auto' |      use transaction prices (recorded with @ or @@) as additional market | ||||||
|  |      prices, as if they were P directives | ||||||
| 
 | 
 | ||||||
|  | `--auto' | ||||||
|      apply automated posting rules to modify transactions. |      apply automated posting rules to modify transactions. | ||||||
| '--forecast' |  | ||||||
| 
 | 
 | ||||||
|  | `--forecast' | ||||||
|      generate future transactions from periodic transaction rules, for |      generate future transactions from periodic transaction rules, for | ||||||
|      the next 6 months or till report end date. In hledger-ui, also |      the next 6 months or till report end date. In hledger-ui, also | ||||||
|      make ordinary future transactions visible. |      make ordinary future transactions visible. | ||||||
| '--color=WHEN (or --colour=WHEN)' |  | ||||||
| 
 | 
 | ||||||
|  | `--color=WHEN (or --colour=WHEN)' | ||||||
|      Should color-supporting commands use ANSI color codes in text |      Should color-supporting commands use ANSI color codes in text | ||||||
|      output.  'auto' (default): whenever stdout seems to be a |      output.  'auto' (default): whenever stdout seems to be a | ||||||
|      color-supporting terminal.  'always' or 'yes': always, useful eg |      color-supporting terminal.  'always' or 'yes': always, useful eg | ||||||
| @ -195,25 +194,24 @@ the last one takes precedence. | |||||||
| 
 | 
 | ||||||
|    hledger help options: |    hledger help options: | ||||||
| 
 | 
 | ||||||
| '-h --help' | `-h --help' | ||||||
| 
 |  | ||||||
|      show general or COMMAND help |      show general or COMMAND help | ||||||
| '--man' |  | ||||||
| 
 | 
 | ||||||
|  | `--man' | ||||||
|      show general or COMMAND user manual with man |      show general or COMMAND user manual with man | ||||||
| '--info' |  | ||||||
| 
 | 
 | ||||||
|  | `--info' | ||||||
|      show general or COMMAND user manual with info |      show general or COMMAND user manual with info | ||||||
| '--version' |  | ||||||
| 
 | 
 | ||||||
|  | `--version' | ||||||
|      show general or ADDONCMD version |      show general or ADDONCMD version | ||||||
| '--debug[=N]' |  | ||||||
| 
 | 
 | ||||||
|  | `--debug[=N]' | ||||||
|      show debug output (levels 1-9, default: 1) |      show debug output (levels 1-9, default: 1) | ||||||
| 
 | 
 | ||||||
|    A @FILE argument will be expanded to the contents of FILE, which |    A @FILE argument will be expanded to the contents of FILE, which | ||||||
| should contain one command line option/argument per line. (To prevent | should contain one command line option/argument per line. (To prevent | ||||||
| this, insert a '--' argument before.) | this, insert a `--' argument before.) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-ui.info,  Node: KEYS,  Next: SCREENS,  Prev: OPTIONS,  Up: Top | File: hledger-ui.info,  Node: KEYS,  Next: SCREENS,  Prev: OPTIONS,  Up: Top | ||||||
| @ -221,15 +219,15 @@ File: hledger-ui.info,  Node: KEYS,  Next: SCREENS,  Prev: OPTIONS,  Up: Top | |||||||
| 2 KEYS | 2 KEYS | ||||||
| ****** | ****** | ||||||
| 
 | 
 | ||||||
| '?' shows a help dialog listing all keys.  (Some of these also appear in | `?' shows a help dialog listing all keys. (Some of these also appear in | ||||||
| the quick help at the bottom of each screen.)  Press '?' again (or | the quick help at the bottom of each screen.) Press `?' again (or | ||||||
| 'ESCAPE', or 'LEFT', or 'q') to close it.  The following keys work on | `ESCAPE', or `LEFT', or `q') to close it. The following keys work on | ||||||
| most screens: | most screens: | ||||||
| 
 | 
 | ||||||
|    The cursor keys navigate: 'right' (or 'enter') goes deeper, 'left' |    The cursor keys navigate: `right' (or `enter') goes deeper, `left' | ||||||
| returns to the previous screen, 'up'/'down'/'page up'/'page | returns to the previous screen, `up'/`down'/`page up'/`page | ||||||
| down'/'home'/'end' move up and down through lists.  Emacs-style | down'/`home'/`end' move up and down through lists. Emacs-style | ||||||
| ('ctrl-p'/'ctrl-n'/'ctrl-f'/'ctrl-b') movement keys are also supported | (`ctrl-p'/`ctrl-n'/`ctrl-f'/`ctrl-b') movement keys are also supported | ||||||
| (but not vi-style keys, since hledger-1.19, sorry!).  A tip: movement | (but not vi-style keys, since hledger-1.19, sorry!).  A tip: movement | ||||||
| speed is limited by your keyboard repeat rate, to move faster you may | speed is limited by your keyboard repeat rate, to move faster you may | ||||||
| want to adjust it. (If you're on a mac, the karabiner app is one way to | want to adjust it. (If you're on a mac, the karabiner app is one way to | ||||||
| @ -237,78 +235,78 @@ do that.) | |||||||
| 
 | 
 | ||||||
|    With shift pressed, the cursor keys adjust the report period, |    With shift pressed, the cursor keys adjust the report period, | ||||||
| limiting the transactions to be shown (by default, all are shown). | limiting the transactions to be shown (by default, all are shown). | ||||||
| 'shift-down/up' steps downward and upward through these standard report | `shift-down/up' steps downward and upward through these standard report | ||||||
| period durations: year, quarter, month, week, day. Then, | period durations: year, quarter, month, week, day. Then, | ||||||
| 'shift-left/right' moves to the previous/next period.  'T' sets the | `shift-left/right' moves to the previous/next period. `T' sets the | ||||||
| report period to today.  With the '--watch' option, when viewing a | report period to today. With the `--watch' option, when viewing a | ||||||
| "current" period (the current day, week, month, quarter, or year), the | "current" period (the current day, week, month, quarter, or year), the | ||||||
| period will move automatically to track the current date. To set a | period will move automatically to track the current date. To set a | ||||||
| non-standard period, you can use '/' and a 'date:' query. | non-standard period, you can use `/' and a `date:' query. | ||||||
| 
 | 
 | ||||||
|    '/' lets you set a general filter query limiting the data shown, |    `/' lets you set a general filter query limiting the data shown, | ||||||
| using the same query terms as in hledger and hledger-web. While editing | using the same query terms as in hledger and hledger-web. While editing | ||||||
| the query, you can use CTRL-a/e/d/k, BS, cursor keys; press 'ENTER' to | the query, you can use CTRL-a/e/d/k, BS, cursor keys; press `ENTER' to | ||||||
| set it, or 'ESCAPE'to cancel.  There are also keys for quickly adjusting | set it, or `ESCAPE'to cancel. There are also keys for quickly adjusting | ||||||
| some common filters like account depth and transaction status (see | some common filters like account depth and transaction status (see | ||||||
| below).  'BACKSPACE' or 'DELETE' removes all filters, showing all | below). `BACKSPACE' or `DELETE' removes all filters, showing all | ||||||
| transactions. | transactions. | ||||||
| 
 | 
 | ||||||
|    As mentioned above, by default hledger-ui hides future transactions - |    As mentioned above, by default hledger-ui hides future transactions - | ||||||
| both ordinary transactions recorded in the journal, and periodic | both ordinary transactions recorded in the journal, and periodic | ||||||
| transactions generated by rule.  'F' toggles forecast mode, in which | transactions generated by rule. `F' toggles forecast mode, in which | ||||||
| future/forecasted transactions are shown. | future/forecasted transactions are shown. | ||||||
| 
 | 
 | ||||||
|    'ESCAPE' resets the UI state and jumps back to the top screen, |    `ESCAPE' resets the UI state and jumps back to the top screen, | ||||||
| restoring the app's initial state at startup. Or, it cancels minibuffer | restoring the app's initial state at startup. Or, it cancels minibuffer | ||||||
| data entry or the help dialog. | data entry or the help dialog. | ||||||
| 
 | 
 | ||||||
|    'CTRL-l' redraws the screen and centers the selection if possible |    `CTRL-l' redraws the screen and centers the selection if possible | ||||||
| (selections near the top won't be centered, since we don't scroll above | (selections near the top won't be centered, since we don't scroll above | ||||||
| the top). | the top). | ||||||
| 
 | 
 | ||||||
|    'g' reloads from the data file(s) and updates the current screen and |    `g' reloads from the data file(s) and updates the current screen and | ||||||
| any previous screens. (With large files, this could cause a noticeable | any previous screens. (With large files, this could cause a noticeable | ||||||
| pause.) | pause.) | ||||||
| 
 | 
 | ||||||
|    'I' toggles balance assertion checking.  Disabling balance assertions |    `I' toggles balance assertion checking. Disabling balance assertions | ||||||
| temporarily can be useful for troubleshooting. | temporarily can be useful for troubleshooting. | ||||||
| 
 | 
 | ||||||
|    'a' runs command-line hledger's add command, and reloads the updated |    `a' runs command-line hledger's add command, and reloads the updated | ||||||
| file. This allows some basic data entry. | file. This allows some basic data entry. | ||||||
| 
 | 
 | ||||||
|    'A' is like 'a', but runs the hledger-iadd tool, which provides a |    `A' is like `a', but runs the hledger-iadd tool, which provides a | ||||||
| terminal interface.  This key will be available if 'hledger-iadd' is | terminal interface. This key will be available if `hledger-iadd' is | ||||||
| installed in $path. | installed in $path. | ||||||
| 
 | 
 | ||||||
|    'E' runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default ('emacsclient |    `E' runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default (`emacsclient | ||||||
| -a "" -nw') on the journal file. With some editors (emacs, vi), the | -a "" -nw') on the journal file. With some editors (emacs, vi), the | ||||||
| cursor will be positioned at the current transaction when invoked from | cursor will be positioned at the current transaction when invoked from | ||||||
| the register and transaction screens, and at the error location (if | the register and transaction screens, and at the error location (if | ||||||
| possible) when invoked from the error screen. | possible) when invoked from the error screen. | ||||||
| 
 | 
 | ||||||
|    'B' toggles cost mode, showing amounts in their transaction price's |    `B' toggles cost mode, showing amounts in their transaction price's | ||||||
| commodity (like toggling the '-B/--cost' flag). | commodity (like toggling the `-B/--cost' flag). | ||||||
| 
 | 
 | ||||||
|    'V' toggles value mode, showing amounts' current market value in |    `V' toggles value mode, showing amounts' current market value in | ||||||
| their default valuation commodity (like toggling the '-V/--market' | their default valuation commodity (like toggling the `-V/--market' | ||||||
| flag). Note, "current market value" means the value on the report end | flag). Note, "current market value" means the value on the report end | ||||||
| date if specified, otherwise today. To see the value on another date, | date if specified, otherwise today. To see the value on another date, | ||||||
| you can temporarily set that as the report end date. Eg: to see a | you can temporarily set that as the report end date. Eg: to see a | ||||||
| transaction as it was valued on july 30, go to the accounts or register | transaction as it was valued on july 30, go to the accounts or register | ||||||
| screen, press '/', and add 'date:-7/30' to the query. | screen, press `/', and add `date:-7/30' to the query. | ||||||
| 
 | 
 | ||||||
|    At most one of cost or value mode can be active at once. |    At most one of cost or value mode can be active at once. | ||||||
| 
 | 
 | ||||||
|    There's not yet any visual reminder when cost or value mode is |    There's not yet any visual reminder when cost or value mode is | ||||||
| active; for now pressing 'b' 'b' 'v' should reliably reset to normal | active; for now pressing `b' `b' `v' should reliably reset to normal | ||||||
| mode. | mode. | ||||||
| 
 | 
 | ||||||
|    With '--watch' active, if you save an edit to the journal file while |    With `--watch' active, if you save an edit to the journal file while | ||||||
| viewing the transaction screen in cost or value mode, the 'B'/'V' keys | viewing the transaction screen in cost or value mode, the `B'/`V' keys | ||||||
| will stop working.  To work around, press 'g' to force a manual reload, | will stop working. To work around, press `g' to force a manual reload, | ||||||
| or exit the transaction screen. | or exit the transaction screen. | ||||||
| 
 | 
 | ||||||
|    'q' quits the application. |    `q' quits the application. | ||||||
| 
 | 
 | ||||||
|    Additional screen-specific keys are described below. |    Additional screen-specific keys are described below. | ||||||
| 
 | 
 | ||||||
| @ -331,48 +329,47 @@ File: hledger-ui.info,  Node: Accounts screen,  Next: Register screen,  Up: SCRE | |||||||
| 3.1 Accounts screen | 3.1 Accounts screen | ||||||
| =================== | =================== | ||||||
| 
 | 
 | ||||||
| This is normally the first screen displayed.  It lists accounts and | This is normally the first screen displayed. It lists accounts and their | ||||||
| their balances, like hledger's balance command.  By default, it shows | balances, like hledger's balance command. By default, it shows all | ||||||
| all accounts and their latest ending balances (including the balances of | accounts and their latest ending balances (including the balances of | ||||||
| subaccounts). If you specify a query on the command line, it shows just | subaccounts). If you specify a query on the command line, it shows just | ||||||
| the matched accounts and the balances from matched transactions. | the matched accounts and the balances from matched transactions. | ||||||
| 
 | 
 | ||||||
|    Account names are shown as a flat list by default; press 't' to |    Account names are shown as a flat list by default; press `t' to | ||||||
| toggle tree mode. In list mode, account balances are exclusive of | toggle tree mode. In list mode, account balances are exclusive of | ||||||
| subaccounts, except where subaccounts are hidden by a depth limit (see | subaccounts, except where subaccounts are hidden by a depth limit (see | ||||||
| below).  In tree mode, all account balances are inclusive of | below). In tree mode, all account balances are inclusive of subaccounts. | ||||||
| subaccounts. |  | ||||||
| 
 | 
 | ||||||
|    To see less detail, press a number key, '1' to '9', to set a depth |    To see less detail, press a number key, `1' to `9', to set a depth | ||||||
| limit.  Or use '-' to decrease and '+'/'=' to increase the depth limit. | limit. Or use `-' to decrease and `+'/`=' to increase the depth limit. | ||||||
| '0' shows even less detail, collapsing all accounts to a single total. | `0' shows even less detail, collapsing all accounts to a single total. | ||||||
| To remove the depth limit, set it higher than the maximum account depth, | To remove the depth limit, set it higher than the maximum account | ||||||
| or press 'ESCAPE'. | depth, or press `ESCAPE'. | ||||||
| 
 | 
 | ||||||
|    'H' toggles between showing historical balances or period balances. |    `H' toggles between showing historical balances or period balances. | ||||||
| Historical balances (the default) are ending balances at the end of the | Historical balances (the default) are ending balances at the end of the | ||||||
| report period, taking into account all transactions before that date | report period, taking into account all transactions before that date | ||||||
| (filtered by the filter query if any), including transactions before the | (filtered by the filter query if any), including transactions before the | ||||||
| start of the report period.  In other words, historical balances are | start of the report period. In other words, historical balances are what | ||||||
| what you would see on a bank statement for that account (unless | you would see on a bank statement for that account (unless disturbed by | ||||||
| disturbed by a filter query).  Period balances ignore transactions | a filter query). Period balances ignore transactions before the report | ||||||
| before the report start date, so they show the change in balance during | start date, so they show the change in balance during the report period. | ||||||
| the report period.  They are more useful eg when viewing a time log. | They are more useful eg when viewing a time log. | ||||||
| 
 | 
 | ||||||
|    'U' toggles filtering by unmarked status, including or excluding |    `U' toggles filtering by unmarked status, including or excluding | ||||||
| unmarked postings in the balances.  Similarly, 'P' toggles pending | unmarked postings in the balances. Similarly, `P' toggles pending | ||||||
| postings, and 'C' toggles cleared postings.  (By default, balances | postings, and `C' toggles cleared postings. (By default, balances | ||||||
| include all postings; if you activate one or two status filters, only | include all postings; if you activate one or two status filters, only | ||||||
| those postings are included; and if you activate all three, the filter | those postings are included; and if you activate all three, the filter | ||||||
| is removed.) | is removed.) | ||||||
| 
 | 
 | ||||||
|    'R' toggles real mode, in which virtual postings are ignored. |    `R' toggles real mode, in which virtual postings are ignored. | ||||||
| 
 | 
 | ||||||
|    'Z' toggles nonzero mode, in which only accounts with nonzero |    `Z' toggles nonzero mode, in which only accounts with nonzero | ||||||
| balances are shown (hledger-ui shows zero items by default, unlike | balances are shown (hledger-ui shows zero items by default, unlike | ||||||
| command-line hledger). | command-line hledger). | ||||||
| 
 | 
 | ||||||
|    Press 'right' or 'enter' to view an account's transactions register. |    Press `right' or `enter' to view an account's transactions register. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-ui.info,  Node: Register screen,  Next: Transaction screen,  Prev: Accounts screen,  Up: SCREENS | File: hledger-ui.info,  Node: Register screen,  Next: Transaction screen,  Prev: Accounts screen,  Up: SCREENS | ||||||
| @ -384,41 +381,43 @@ This screen shows the transactions affecting a particular account, like | |||||||
| a check register. Each line represents one transaction and shows: | a check register. Each line represents one transaction and shows: | ||||||
| 
 | 
 | ||||||
|    * the other account(s) involved, in abbreviated form. (If there are |    * the other account(s) involved, in abbreviated form. (If there are | ||||||
|      both real and virtual postings, it shows only the accounts affected |      both real and virtual postings, it shows only the accounts | ||||||
|      by real postings.) |      affected by real postings.) | ||||||
| 
 | 
 | ||||||
|    * the overall change to the current account's balance; positive for |    * the overall change to the current account's balance; positive for | ||||||
|      an inflow to this account, negative for an outflow. |      an inflow to this account, negative for an outflow. | ||||||
| 
 | 
 | ||||||
|    * the running historical total or period total for the current |    * the running historical total or period total for the current | ||||||
|      account, after the transaction.  This can be toggled with 'H'. |      account, after the transaction. This can be toggled with `H'. | ||||||
|      Similar to the accounts screen, the historical total is affected by |      Similar to the accounts screen, the historical total is affected | ||||||
|      transactions (filtered by the filter query) before the report start |      by transactions (filtered by the filter query) before the report | ||||||
|      date, while the period total is not.  If the historical total is |      start date, while the period total is not. If the historical total | ||||||
|      not disturbed by a filter query, it will be the running historical |      is not disturbed by a filter query, it will be the running | ||||||
|      balance you would see on a bank register for the current account. |      historical balance you would see on a bank register for the | ||||||
|  |      current account. | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|    Transactions affecting this account's subaccounts will be included in |    Transactions affecting this account's subaccounts will be included in | ||||||
| the register if the accounts screen is in tree mode, or if it's in list | the register if the accounts screen is in tree mode, or if it's in list | ||||||
| mode but this account has subaccounts which are not shown due to a depth | mode but this account has subaccounts which are not shown due to a depth | ||||||
| limit. In other words, the register always shows the transactions | limit. In other words, the register always shows the transactions | ||||||
| contributing to the balance shown on the accounts screen.  Tree | contributing to the balance shown on the accounts screen. Tree mode/list | ||||||
| mode/list mode can be toggled with 't' here also. | mode can be toggled with `t' here also. | ||||||
| 
 | 
 | ||||||
|    'U' toggles filtering by unmarked status, showing or hiding unmarked |    `U' toggles filtering by unmarked status, showing or hiding unmarked | ||||||
| transactions.  Similarly, 'P' toggles pending transactions, and 'C' | transactions. Similarly, `P' toggles pending transactions, and `C' | ||||||
| toggles cleared transactions. (By default, transactions with all | toggles cleared transactions. (By default, transactions with all | ||||||
| statuses are shown; if you activate one or two status filters, only | statuses are shown; if you activate one or two status filters, only | ||||||
| those transactions are shown; and if you activate all three, the filter | those transactions are shown; and if you activate all three, the filter | ||||||
| is removed.) | is removed.) | ||||||
| 
 | 
 | ||||||
|    'R' toggles real mode, in which virtual postings are ignored. |    `R' toggles real mode, in which virtual postings are ignored. | ||||||
| 
 | 
 | ||||||
|    'Z' toggles nonzero mode, in which only transactions posting a |    `Z' toggles nonzero mode, in which only transactions posting a | ||||||
| nonzero change are shown (hledger-ui shows zero items by default, unlike | nonzero change are shown (hledger-ui shows zero items by default, unlike | ||||||
| command-line hledger). | command-line hledger). | ||||||
| 
 | 
 | ||||||
|    Press 'right' (or 'enter') to view the selected transaction in |    Press `right' (or `enter') to view the selected transaction in | ||||||
| detail. | detail. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| @ -436,7 +435,7 @@ description, comments, along with all of its account postings are shown. | |||||||
| Simple transactions have two postings, but there can be more (or in | Simple transactions have two postings, but there can be more (or in | ||||||
| certain cases, fewer). | certain cases, fewer). | ||||||
| 
 | 
 | ||||||
|    'up' and 'down' will step through all transactions listed in the |    `up' and `down' will step through all transactions listed in the | ||||||
| previous account register screen. In the title bar, the numbers in | previous account register screen. In the title bar, the numbers in | ||||||
| parentheses show your position within that account register. They will | parentheses show your position within that account register. They will | ||||||
| vary depending on which account register you came from (remember most | vary depending on which account register you came from (remember most | ||||||
| @ -464,25 +463,26 @@ File: hledger-ui.info,  Node: ENVIRONMENT,  Next: FILES,  Prev: SCREENS,  Up: To | |||||||
| 
 | 
 | ||||||
| *COLUMNS* The screen width to use. Default: the full terminal width. | *COLUMNS* The screen width to use. Default: the full terminal width. | ||||||
| 
 | 
 | ||||||
|    *LEDGER_FILE* The journal file path when not specified with '-f'. |    *LEDGER_FILE* The journal file path when not specified with `-f'. | ||||||
| Default: '~/.hledger.journal' (on windows, perhaps | Default: `~/.hledger.journal' (on windows, perhaps | ||||||
| 'C:/Users/USER/.hledger.journal'). | `C:/Users/USER/.hledger.journal'). | ||||||
| 
 | 
 | ||||||
|    A typical value is '~/DIR/YYYY.journal', where DIR is a |    A typical value is `~/DIR/YYYY.journal', where DIR is a | ||||||
| version-controlled finance directory and YYYY is the current year. Or | version-controlled finance directory and YYYY is the current year. Or | ||||||
| '~/DIR/current.journal', where current.journal is a symbolic link to | `~/DIR/current.journal', where current.journal is a symbolic link to | ||||||
| YYYY.journal. | YYYY.journal. | ||||||
| 
 | 
 | ||||||
|    On Mac computers, you can set this and other environment variables in |    On Mac computers, you can set this and other environment variables | ||||||
| a more thorough way that also affects applications started from the GUI | in a more thorough way that also affects applications started from the | ||||||
| (say, an Emacs dock icon).  Eg on MacOS Catalina I have a | GUI (say, an Emacs dock icon). Eg on MacOS Catalina I have a | ||||||
| '~/.MacOSX/environment.plist' file containing | `~/.MacOSX/environment.plist' file containing | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| { | { | ||||||
|   "LEDGER_FILE" : "~/finance/current.journal" |   "LEDGER_FILE" : "~/finance/current.journal" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|    To see the effect you may need to 'killall Dock', or reboot. |    To see the effect you may need to `killall Dock', or reboot. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-ui.info,  Node: FILES,  Next: BUGS,  Prev: ENVIRONMENT,  Up: Top | File: hledger-ui.info,  Node: FILES,  Next: BUGS,  Prev: ENVIRONMENT,  Up: Top | ||||||
| @ -491,9 +491,9 @@ File: hledger-ui.info,  Node: FILES,  Next: BUGS,  Prev: ENVIRONMENT,  Up: Top | |||||||
| ******* | ******* | ||||||
| 
 | 
 | ||||||
| Reads data from one or more files in hledger journal, timeclock, | Reads data from one or more files in hledger journal, timeclock, | ||||||
| timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or | timedot, or CSV format specified with `-f', or `$LEDGER_FILE', or | ||||||
| '$HOME/.hledger.journal' (on windows, perhaps | `$HOME/.hledger.journal' (on windows, perhaps | ||||||
| 'C:/Users/USER/.hledger.journal'). | `C:/Users/USER/.hledger.journal'). | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-ui.info,  Node: BUGS,  Prev: FILES,  Up: Top | File: hledger-ui.info,  Node: BUGS,  Prev: FILES,  Up: Top | ||||||
| @ -501,18 +501,18 @@ File: hledger-ui.info,  Node: BUGS,  Prev: FILES,  Up: Top | |||||||
| 6 BUGS | 6 BUGS | ||||||
| ****** | ****** | ||||||
| 
 | 
 | ||||||
| The need to precede options with '--' when invoked from hledger is | The need to precede options with `--' when invoked from hledger is | ||||||
| awkward. | awkward. | ||||||
| 
 | 
 | ||||||
|    '-f-' doesn't work (hledger-ui can't read from stdin). |    `-f-' doesn't work (hledger-ui can't read from stdin). | ||||||
| 
 | 
 | ||||||
|    '-V' affects only the accounts screen. |    `-V' affects only the accounts screen. | ||||||
| 
 | 
 | ||||||
|    When you press 'g', the current and all previous screens are |    When you press `g', the current and all previous screens are | ||||||
| regenerated, which may cause a noticeable pause with large files. Also | regenerated, which may cause a noticeable pause with large files. Also | ||||||
| there is no visual indication that this is in progress. | there is no visual indication that this is in progress. | ||||||
| 
 | 
 | ||||||
|    '--watch' is not yet fully robust.  It works well for normal usage, |    `--watch' is not yet fully robust. It works well for normal usage, | ||||||
| but many file changes in a short time (eg saving the file thousands of | but many file changes in a short time (eg saving the file thousands of | ||||||
| times with an editor macro) can cause problems at least on OSX. Symptoms | times with an editor macro) can cause problems at least on OSX. Symptoms | ||||||
| include: unresponsive UI, periodic resetting of the cursor position, | include: unresponsive UI, periodic resetting of the cursor position, | ||||||
| @ -521,30 +521,31 @@ and possibly a small but persistent build-up of CPU usage until the | |||||||
| program is restarted. | program is restarted. | ||||||
| 
 | 
 | ||||||
|    Also, if you are viewing files mounted from another machine, |    Also, if you are viewing files mounted from another machine, | ||||||
| '--watch' requires that both machine clocks are roughly in step. | `--watch' requires that both machine clocks are roughly in step. | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| Tag Table: | Tag Table: | ||||||
| Node: Top71 | Node: Top82 | ||||||
| Node: OPTIONS1488 | Node: OPTIONS1478 | ||||||
| Ref: #options1585 | Ref: #options1575 | ||||||
| Node: KEYS5768 | Node: KEYS5808 | ||||||
| Ref: #keys5863 | Ref: #keys5903 | ||||||
| Node: SCREENS10182 | Node: SCREENS10199 | ||||||
| Ref: #screens10287 | Ref: #screens10304 | ||||||
| Node: Accounts screen10377 | Node: Accounts screen10394 | ||||||
| Ref: #accounts-screen10505 | Ref: #accounts-screen10522 | ||||||
| Node: Register screen12720 | Node: Register screen12726 | ||||||
| Ref: #register-screen12875 | Ref: #register-screen12881 | ||||||
| Node: Transaction screen14872 | Node: Transaction screen14876 | ||||||
| Ref: #transaction-screen15030 | Ref: #transaction-screen15034 | ||||||
| Node: Error screen15900 | Node: Error screen15901 | ||||||
| Ref: #error-screen16022 | Ref: #error-screen16023 | ||||||
| Node: ENVIRONMENT16266 | Node: ENVIRONMENT16265 | ||||||
| Ref: #environment16380 | Ref: #environment16379 | ||||||
| Node: FILES17187 | Node: FILES17184 | ||||||
| Ref: #files17286 | Ref: #files17283 | ||||||
| Node: BUGS17499 | Node: BUGS17496 | ||||||
| Ref: #bugs17576 | Ref: #bugs17573 | ||||||
|  |  | ||||||
| End Tag Table | End Tag Table | ||||||
|  | |||||||
| @ -29,8 +29,8 @@ DESCRIPTION | |||||||
|        C:/Users/USER/.hledger.journal).  For more about this  see  hledger(1), |        C:/Users/USER/.hledger.journal).  For more about this  see  hledger(1), | ||||||
|        hledger_journal(5) etc. |        hledger_journal(5) etc. | ||||||
| 
 | 
 | ||||||
|        Unlike  hledger,  hledger-ui hides all future-dated transactions by de- |        Unlike  hledger,  hledger-ui  hides  all  future-dated  transactions by | ||||||
|        fault.  They can be revealed, along with  any  rule-generated  periodic |        default.  They can be revealed, along with any rule-generated  periodic | ||||||
|        transactions,  by  pressing  the F key (or starting with --forecast) to |        transactions,  by  pressing  the F key (or starting with --forecast) to | ||||||
|        enable "forecast mode". |        enable "forecast mode". | ||||||
| 
 | 
 | ||||||
| @ -86,8 +86,8 @@ OPTIONS | |||||||
|               assignments) |               assignments) | ||||||
| 
 | 
 | ||||||
|        -s --strict |        -s --strict | ||||||
|               do extra error checking (check that all posted accounts are  de- |               do extra error checking (check  that  all  posted  accounts  are | ||||||
|               clared) |               declared) | ||||||
| 
 | 
 | ||||||
|        hledger reporting options: |        hledger reporting options: | ||||||
| 
 | 
 | ||||||
| @ -117,8 +117,8 @@ OPTIONS | |||||||
|               using period expressions syntax |               using period expressions syntax | ||||||
| 
 | 
 | ||||||
|        --date2 |        --date2 | ||||||
|               match the secondary date instead (see command help for other ef- |               match the secondary date instead (see  command  help  for  other | ||||||
|               fects) |               effects) | ||||||
| 
 | 
 | ||||||
|        -U --unmarked |        -U --unmarked | ||||||
|               include only unmarked postings/txns (can combine with -P or -C) |               include only unmarked postings/txns (can combine with -P or -C) | ||||||
| @ -153,8 +153,9 @@ OPTIONS | |||||||
|               convert amounts to cost or  market  value,  more  flexibly  than |               convert amounts to cost or  market  value,  more  flexibly  than | ||||||
|               -B/-V/-X |               -B/-V/-X | ||||||
| 
 | 
 | ||||||
|        --infer-value |        --infer-market-prices | ||||||
|               with -V/-X/--value, also infer market prices from transactions |               use  transaction  prices  (recorded  with @ or @@) as additional | ||||||
|  |               market prices, as if they were P directives | ||||||
| 
 | 
 | ||||||
|        --auto apply automated posting rules to modify transactions. |        --auto apply automated posting rules to modify transactions. | ||||||
| 
 | 
 | ||||||
| @ -226,12 +227,12 @@ KEYS | |||||||
| 
 | 
 | ||||||
|        As mentioned above, by default hledger-ui hides future  transactions  - |        As mentioned above, by default hledger-ui hides future  transactions  - | ||||||
|        both ordinary transactions recorded in the journal, and periodic trans- |        both ordinary transactions recorded in the journal, and periodic trans- | ||||||
|        actions generated by rule.  F  toggles  forecast  mode,  in  which  fu- |        actions  generated  by  rule.   F  toggles  forecast  mode,  in   which | ||||||
|        ture/forecasted transactions are shown. |        future/forecasted transactions are shown. | ||||||
| 
 | 
 | ||||||
|        ESCAPE  resets the UI state and jumps back to the top screen, restoring |        ESCAPE  resets the UI state and jumps back to the top screen, restoring | ||||||
|        the app's initial state at startup.  Or, it cancels minibuffer data en- |        the app's initial state at startup.  Or,  it  cancels  minibuffer  data | ||||||
|        try or the help dialog. |        entry or the help dialog. | ||||||
| 
 | 
 | ||||||
|        CTRL-l redraws the screen and centers the selection if possible (selec- |        CTRL-l redraws the screen and centers the selection if possible (selec- | ||||||
|        tions near the top won't be centered, since we don't scroll  above  the |        tions near the top won't be centered, since we don't scroll  above  the | ||||||
| @ -292,14 +293,15 @@ SCREENS | |||||||
| 
 | 
 | ||||||
|        Account names are shown as a flat list by default; press  t  to  toggle |        Account names are shown as a flat list by default; press  t  to  toggle | ||||||
|        tree  mode.   In  list  mode,  account balances are exclusive of subac- |        tree  mode.   In  list  mode,  account balances are exclusive of subac- | ||||||
|        counts, except where subaccounts are hidden by a depth limit  (see  be- |        counts, except where subaccounts are  hidden  by  a  depth  limit  (see | ||||||
|        low).  In tree mode, all account balances are inclusive of subaccounts. |        below).   In  tree  mode,  all account balances are inclusive of subac- | ||||||
|  |        counts. | ||||||
| 
 | 
 | ||||||
|        To see less detail, press a number key, 1 to 9, to set a  depth  limit. |        To see less detail, press a number key, 1 to 9, to set a  depth  limit. | ||||||
|        Or use - to decrease and +/= to increase the depth limit.  0 shows even |        Or use - to decrease and +/= to increase the depth limit.  0 shows even | ||||||
|        less detail, collapsing all accounts to a single total.  To remove  the |        less detail, collapsing all accounts to a single total.  To remove  the | ||||||
|        depth limit, set it higher than the maximum account depth, or press ES- |        depth  limit,  set  it  higher than the maximum account depth, or press | ||||||
|        CAPE. |        ESCAPE. | ||||||
| 
 | 
 | ||||||
|        H toggles between showing historical balances or period balances.  His- |        H toggles between showing historical balances or period balances.  His- | ||||||
|        torical  balances  (the  default) are ending balances at the end of the |        torical  balances  (the  default) are ending balances at the end of the | ||||||
| @ -307,15 +309,15 @@ SCREENS | |||||||
|        (filtered  by  the  filter query if any), including transactions before |        (filtered  by  the  filter query if any), including transactions before | ||||||
|        the start of the report period.  In other  words,  historical  balances |        the start of the report period.  In other  words,  historical  balances | ||||||
|        are  what  you  would  see on a bank statement for that account (unless |        are  what  you  would  see on a bank statement for that account (unless | ||||||
|        disturbed  by a filter query).  Period balances ignore transactions be- |        disturbed by a filter  query).   Period  balances  ignore  transactions | ||||||
|        fore the report start date, so they show the change in  balance  during |        before the report start date, so they show the change in balance during | ||||||
|        the report period.  They are more useful eg when viewing a time log. |        the report period.  They are more useful eg when viewing a time log. | ||||||
| 
 | 
 | ||||||
|        U toggles filtering by unmarked status, including or excluding unmarked |        U toggles filtering by unmarked status, including or excluding unmarked | ||||||
|        postings in the balances.  Similarly, P toggles pending postings, and C |        postings in the balances.  Similarly, P toggles pending postings, and C | ||||||
|        toggles cleared postings.  (By default, balances include all  postings; |        toggles cleared postings.  (By default, balances include all  postings; | ||||||
|        if you activate one or two status filters, only those postings are  in- |        if  you  activate  one  or  two status filters, only those postings are | ||||||
|        cluded; and if you activate all three, the filter is removed.) |        included; and if you activate all three, the filter is removed.) | ||||||
| 
 | 
 | ||||||
|        R toggles real mode, in which virtual postings are ignored. |        R toggles real mode, in which virtual postings are ignored. | ||||||
| 
 | 
 | ||||||
| @ -370,16 +372,16 @@ SCREENS | |||||||
|        similar  to  hledger's  print command and journal format (hledger_jour- |        similar  to  hledger's  print command and journal format (hledger_jour- | ||||||
|        nal(5)). |        nal(5)). | ||||||
| 
 | 
 | ||||||
|        The transaction's date(s) and any cleared flag, transaction  code,  de- |        The transaction's date(s)  and  any  cleared  flag,  transaction  code, | ||||||
|        scription,  comments, along with all of its account postings are shown. |        description,  comments,  along  with  all  of  its account postings are | ||||||
|        Simple transactions have two postings, but there can  be  more  (or  in |        shown.  Simple transactions have two postings, but there  can  be  more | ||||||
|        certain cases, fewer). |        (or in certain cases, fewer). | ||||||
| 
 | 
 | ||||||
|        up  and  down will step through all transactions listed in the previous |        up  and  down will step through all transactions listed in the previous | ||||||
|        account register screen.  In the title bar, the numbers in  parentheses |        account register screen.  In the title bar, the numbers in  parentheses | ||||||
|        show  your  position  within that account register.  They will vary de- |        show  your  position  within  that  account  register.   They will vary | ||||||
|        pending on which account register you came from (remember most transac- |        depending on which account register you came from (remember most trans- | ||||||
|        tions  appear  in multiple account registers).  The #N number preceding |        actions appear in multiple account registers).  The #N number preceding | ||||||
|        them is the transaction's position within the complete unfiltered jour- |        them is the transaction's position within the complete unfiltered jour- | ||||||
|        nal, which is a more stable id (at least until the next reload). |        nal, which is a more stable id (at least until the next reload). | ||||||
| 
 | 
 | ||||||
| @ -402,8 +404,8 @@ ENVIRONMENT | |||||||
| 
 | 
 | ||||||
|        On Mac computers, you can set this and other environment variables in a |        On Mac computers, you can set this and other environment variables in a | ||||||
|        more thorough way that also affects applications started from  the  GUI |        more thorough way that also affects applications started from  the  GUI | ||||||
|        (say, an Emacs dock icon).  Eg on MacOS Catalina I have a ~/.MacOSX/en- |        (say,   an   Emacs   dock  icon).   Eg  on  MacOS  Catalina  I  have  a | ||||||
|        vironment.plist file containing |        ~/.MacOSX/environment.plist file containing | ||||||
| 
 | 
 | ||||||
|               { |               { | ||||||
|                 "LEDGER_FILE" : "~/finance/current.journal" |                 "LEDGER_FILE" : "~/finance/current.journal" | ||||||
|  | |||||||
| @ -184,8 +184,9 @@ convert amounts to their market value in commodity COMM | |||||||
| \f[B]\f[CB]--value\f[B]\f[R] | \f[B]\f[CB]--value\f[B]\f[R] | ||||||
| convert amounts to cost or market value, more flexibly than -B/-V/-X | convert amounts to cost or market value, more flexibly than -B/-V/-X | ||||||
| .TP | .TP | ||||||
| \f[B]\f[CB]--infer-value\f[B]\f[R] | \f[B]\f[CB]--infer-market-prices\f[B]\f[R] | ||||||
| with -V/-X/--value, also infer market prices from transactions | use transaction prices (recorded with \[at] or \[at]\[at]) as additional | ||||||
|  | market prices, as if they were P directives | ||||||
| .TP | .TP | ||||||
| \f[B]\f[CB]--auto\f[B]\f[R] | \f[B]\f[CB]--auto\f[B]\f[R] | ||||||
| apply automated posting rules to modify transactions. | apply automated posting rules to modify transactions. | ||||||
|  | |||||||
| @ -1,7 +1,8 @@ | |||||||
| This is hledger-web.info, produced by makeinfo version 6.7 from stdin. | This is hledger-web/hledger-web.info, produced by makeinfo version 4.8 | ||||||
|  | from stdin. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-web.info,  Node: Top,  Next: OPTIONS,  Up: (dir) | File: hledger-web.info,  Node: Top,  Up: (dir) | ||||||
| 
 | 
 | ||||||
| hledger-web(1) | hledger-web(1) | ||||||
| ************** | ************** | ||||||
| @ -9,8 +10,8 @@ hledger-web(1) | |||||||
| hledger-web is a web interface (WUI) for the hledger accounting tool. | hledger-web is a web interface (WUI) for the hledger accounting tool. | ||||||
| This manual is for hledger-web 1.20.99. | This manual is for hledger-web 1.20.99. | ||||||
| 
 | 
 | ||||||
|    'hledger-web [OPTIONS]' |    `hledger-web [OPTIONS]' | ||||||
| 'hledger web -- [OPTIONS]' | `hledger web -- [OPTIONS]' | ||||||
| 
 | 
 | ||||||
|    hledger is a reliable, cross-platform set of programs for tracking |    hledger is a reliable, cross-platform set of programs for tracking | ||||||
| money, time, or any other commodity, using double-entry accounting and a | money, time, or any other commodity, using double-entry accounting and a | ||||||
| @ -19,22 +20,21 @@ compatible with ledger(1). | |||||||
| 
 | 
 | ||||||
|    hledger-web is hledger's web interface. It starts a simple web |    hledger-web is hledger's web interface. It starts a simple web | ||||||
| application for browsing and adding transactions, and optionally opens | application for browsing and adding transactions, and optionally opens | ||||||
| it in a web browser window if possible.  It provides a more | it in a web browser window if possible. It provides a more user-friendly | ||||||
| user-friendly UI than the hledger CLI or hledger-ui interface, showing | UI than the hledger CLI or hledger-ui interface, showing more at once | ||||||
| more at once (accounts, the current account register, balance charts) | (accounts, the current account register, balance charts) and allowing | ||||||
| and allowing history-aware data entry, interactive searching, and | history-aware data entry, interactive searching, and bookmarking. | ||||||
| bookmarking. |  | ||||||
| 
 | 
 | ||||||
|    hledger-web also lets you share a ledger with multiple users, or even |    hledger-web also lets you share a ledger with multiple users, or even | ||||||
| the public web. There is no access control, so if you need that you | the public web. There is no access control, so if you need that you | ||||||
| should put it behind a suitable web proxy.  As a small protection | should put it behind a suitable web proxy. As a small protection against | ||||||
| against data loss when running an unprotected instance, it writes a | data loss when running an unprotected instance, it writes a numbered | ||||||
| numbered backup of the main journal file (only ?)  on every edit. | backup of the main journal file (only ?) on every edit. | ||||||
| 
 | 
 | ||||||
|    Like hledger, it reads data from one or more files in hledger |    Like hledger, it reads data from one or more files in hledger | ||||||
| journal, timeclock, timedot, or CSV format specified with '-f', or | journal, timeclock, timedot, or CSV format specified with `-f', or | ||||||
| '$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps | `$LEDGER_FILE', or `$HOME/.hledger.journal' (on windows, perhaps | ||||||
| 'C:/Users/USER/.hledger.journal').  For more about this see hledger(1), | `C:/Users/USER/.hledger.journal'). For more about this see hledger(1), | ||||||
| hledger_journal(5) etc. | hledger_journal(5) etc. | ||||||
| 
 | 
 | ||||||
| * Menu: | * Menu: | ||||||
| @ -58,158 +58,156 @@ Command-line options and arguments may be used to set an initial filter | |||||||
| on the data. These filter options are not shown in the web UI, but it | on the data. These filter options are not shown in the web UI, but it | ||||||
| will be applied in addition to any search query entered there. | will be applied in addition to any search query entered there. | ||||||
| 
 | 
 | ||||||
|    Note: if invoking hledger-web as a hledger subcommand, write '--' |    Note: if invoking hledger-web as a hledger subcommand, write `--' | ||||||
| before options, as shown in the synopsis above. | before options, as shown in the synopsis above. | ||||||
| 
 | 
 | ||||||
| '--serve' | `--serve' | ||||||
| 
 |  | ||||||
|      serve and log requests, don't browse or auto-exit |      serve and log requests, don't browse or auto-exit | ||||||
| '--serve-api' |  | ||||||
| 
 | 
 | ||||||
|  | `--serve-api' | ||||||
|      like -serve, but serve only the JSON web API, without the |      like -serve, but serve only the JSON web API, without the | ||||||
|      server-side web UI |      server-side web UI | ||||||
| '--host=IPADDR' |  | ||||||
| 
 | 
 | ||||||
|  | `--host=IPADDR' | ||||||
|      listen on this IP address (default: 127.0.0.1) |      listen on this IP address (default: 127.0.0.1) | ||||||
| '--port=PORT' |  | ||||||
| 
 | 
 | ||||||
|  | `--port=PORT' | ||||||
|      listen on this TCP port (default: 5000) |      listen on this TCP port (default: 5000) | ||||||
| '--socket=SOCKETFILE' |  | ||||||
| 
 | 
 | ||||||
|  | `--socket=SOCKETFILE' | ||||||
|      use a unix domain socket file to listen for requests instead of a |      use a unix domain socket file to listen for requests instead of a | ||||||
|      TCP socket.  Implies '--serve'.  It can only be used if the |      TCP socket. Implies `--serve'. It can only be used if the operating | ||||||
|      operating system can provide this type of socket. |      system can provide this type of socket. | ||||||
| '--base-url=URL' |  | ||||||
| 
 | 
 | ||||||
|  | `--base-url=URL' | ||||||
|      set the base url (default: http://IPADDR:PORT). You would change |      set the base url (default: http://IPADDR:PORT). You would change | ||||||
|      this when sharing over the network, or integrating within a larger |      this when sharing over the network, or integrating within a larger | ||||||
|      website. |      website. | ||||||
| '--file-url=URL' |  | ||||||
| 
 | 
 | ||||||
|  | `--file-url=URL' | ||||||
|      set the static files url (default: BASEURL/static). hledger-web |      set the static files url (default: BASEURL/static). hledger-web | ||||||
|      normally serves static files itself, but if you wanted to serve |      normally serves static files itself, but if you wanted to serve | ||||||
|      them from another server for efficiency, you would set the url with |      them from another server for efficiency, you would set the url | ||||||
|      this. |      with this. | ||||||
| '--capabilities=CAP[,CAP..]' |  | ||||||
| 
 | 
 | ||||||
|  | `--capabilities=CAP[,CAP..]' | ||||||
|      enable the view, add, and/or manage capabilities (default: |      enable the view, add, and/or manage capabilities (default: | ||||||
|      view,add) |      view,add) | ||||||
| '--capabilities-header=HTTPHEADER' |  | ||||||
| 
 | 
 | ||||||
|  | `--capabilities-header=HTTPHEADER' | ||||||
|      read capabilities to enable from a HTTP header, like |      read capabilities to enable from a HTTP header, like | ||||||
|      X-Sandstorm-Permissions (default: disabled) |      X-Sandstorm-Permissions (default: disabled) | ||||||
| '--test' |  | ||||||
| 
 | 
 | ||||||
|  | `--test' | ||||||
|      run hledger-web's tests and exit. hspec test runner args may |      run hledger-web's tests and exit. hspec test runner args may | ||||||
|      follow a -, eg: hledger-web -test - -help |      follow a -, eg: hledger-web -test - -help | ||||||
| 
 | 
 | ||||||
|    hledger input options: |    hledger input options: | ||||||
| 
 | 
 | ||||||
| '-f FILE --file=FILE' | `-f FILE --file=FILE' | ||||||
| 
 |  | ||||||
|      use a different input file. For stdin, use - (default: |      use a different input file. For stdin, use - (default: | ||||||
|      '$LEDGER_FILE' or '$HOME/.hledger.journal') |      `$LEDGER_FILE' or `$HOME/.hledger.journal') | ||||||
| '--rules-file=RULESFILE' |  | ||||||
| 
 | 
 | ||||||
|  | `--rules-file=RULESFILE' | ||||||
|      Conversion rules file to use when reading CSV (default: FILE.rules) |      Conversion rules file to use when reading CSV (default: FILE.rules) | ||||||
| '--separator=CHAR' |  | ||||||
| 
 | 
 | ||||||
|  | `--separator=CHAR' | ||||||
|      Field separator to expect when reading CSV (default: ',') |      Field separator to expect when reading CSV (default: ',') | ||||||
| '--alias=OLD=NEW' |  | ||||||
| 
 | 
 | ||||||
|  | `--alias=OLD=NEW' | ||||||
|      rename accounts named OLD to NEW |      rename accounts named OLD to NEW | ||||||
| '--anon' |  | ||||||
| 
 | 
 | ||||||
|  | `--anon' | ||||||
|      anonymize accounts and payees |      anonymize accounts and payees | ||||||
| '--pivot FIELDNAME' |  | ||||||
| 
 | 
 | ||||||
|  | `--pivot FIELDNAME' | ||||||
|      use some other field or tag for the account name |      use some other field or tag for the account name | ||||||
| '-I --ignore-assertions' |  | ||||||
| 
 | 
 | ||||||
|  | `-I --ignore-assertions' | ||||||
|      disable balance assertion checks (note: does not disable balance |      disable balance assertion checks (note: does not disable balance | ||||||
|      assignments) |      assignments) | ||||||
| '-s --strict' |  | ||||||
| 
 | 
 | ||||||
|  | `-s --strict' | ||||||
|      do extra error checking (check that all posted accounts are |      do extra error checking (check that all posted accounts are | ||||||
|      declared) |      declared) | ||||||
| 
 | 
 | ||||||
|    hledger reporting options: |    hledger reporting options: | ||||||
| 
 | 
 | ||||||
| '-b --begin=DATE' | `-b --begin=DATE' | ||||||
| 
 |  | ||||||
|      include postings/txns on or after this date |      include postings/txns on or after this date | ||||||
| '-e --end=DATE' |  | ||||||
| 
 | 
 | ||||||
|  | `-e --end=DATE' | ||||||
|      include postings/txns before this date |      include postings/txns before this date | ||||||
| '-D --daily' |  | ||||||
| 
 | 
 | ||||||
|  | `-D --daily' | ||||||
|      multiperiod/multicolumn report by day |      multiperiod/multicolumn report by day | ||||||
| '-W --weekly' |  | ||||||
| 
 | 
 | ||||||
|  | `-W --weekly' | ||||||
|      multiperiod/multicolumn report by week |      multiperiod/multicolumn report by week | ||||||
| '-M --monthly' |  | ||||||
| 
 | 
 | ||||||
|  | `-M --monthly' | ||||||
|      multiperiod/multicolumn report by month |      multiperiod/multicolumn report by month | ||||||
| '-Q --quarterly' |  | ||||||
| 
 | 
 | ||||||
|  | `-Q --quarterly' | ||||||
|      multiperiod/multicolumn report by quarter |      multiperiod/multicolumn report by quarter | ||||||
| '-Y --yearly' |  | ||||||
| 
 | 
 | ||||||
|  | `-Y --yearly' | ||||||
|      multiperiod/multicolumn report by year |      multiperiod/multicolumn report by year | ||||||
| '-p --period=PERIODEXP' |  | ||||||
| 
 | 
 | ||||||
|  | `-p --period=PERIODEXP' | ||||||
|      set start date, end date, and/or reporting interval all at once |      set start date, end date, and/or reporting interval all at once | ||||||
|      using period expressions syntax |      using period expressions syntax | ||||||
| '--date2' |  | ||||||
| 
 | 
 | ||||||
|  | `--date2' | ||||||
|      match the secondary date instead (see command help for other |      match the secondary date instead (see command help for other | ||||||
|      effects) |      effects) | ||||||
| '-U --unmarked' |  | ||||||
| 
 | 
 | ||||||
|  | `-U --unmarked' | ||||||
|      include only unmarked postings/txns (can combine with -P or -C) |      include only unmarked postings/txns (can combine with -P or -C) | ||||||
| '-P --pending' |  | ||||||
| 
 | 
 | ||||||
|  | `-P --pending' | ||||||
|      include only pending postings/txns |      include only pending postings/txns | ||||||
| '-C --cleared' |  | ||||||
| 
 | 
 | ||||||
|  | `-C --cleared' | ||||||
|      include only cleared postings/txns |      include only cleared postings/txns | ||||||
| '-R --real' |  | ||||||
| 
 | 
 | ||||||
|  | `-R --real' | ||||||
|      include only non-virtual postings |      include only non-virtual postings | ||||||
| '-NUM --depth=NUM' |  | ||||||
| 
 | 
 | ||||||
|  | `-NUM --depth=NUM' | ||||||
|      hide/aggregate accounts or postings more than NUM levels deep |      hide/aggregate accounts or postings more than NUM levels deep | ||||||
| '-E --empty' |  | ||||||
| 
 | 
 | ||||||
|  | `-E --empty' | ||||||
|      show items with zero amount, normally hidden (and vice-versa in |      show items with zero amount, normally hidden (and vice-versa in | ||||||
|      hledger-ui/hledger-web) |      hledger-ui/hledger-web) | ||||||
| '-B --cost' |  | ||||||
| 
 | 
 | ||||||
|  | `-B --cost' | ||||||
|      convert amounts to their cost/selling amount at transaction time |      convert amounts to their cost/selling amount at transaction time | ||||||
| '-V --market' |  | ||||||
| 
 | 
 | ||||||
|  | `-V --market' | ||||||
|      convert amounts to their market value in default valuation |      convert amounts to their market value in default valuation | ||||||
|      commodities |      commodities | ||||||
| '-X --exchange=COMM' |  | ||||||
| 
 | 
 | ||||||
|  | `-X --exchange=COMM' | ||||||
|      convert amounts to their market value in commodity COMM |      convert amounts to their market value in commodity COMM | ||||||
| '--value' |  | ||||||
| 
 | 
 | ||||||
|  | `--value' | ||||||
|      convert amounts to cost or market value, more flexibly than |      convert amounts to cost or market value, more flexibly than | ||||||
|      -B/-V/-X |      -B/-V/-X | ||||||
| '--infer-value' |  | ||||||
| 
 | 
 | ||||||
|      with -V/-X/-value, also infer market prices from transactions | `--infer-market-prices' | ||||||
| '--auto' |      use transaction prices (recorded with @ or @@) as additional market | ||||||
|  |      prices, as if they were P directives | ||||||
| 
 | 
 | ||||||
|  | `--auto' | ||||||
|      apply automated posting rules to modify transactions. |      apply automated posting rules to modify transactions. | ||||||
| '--forecast' |  | ||||||
| 
 | 
 | ||||||
|  | `--forecast' | ||||||
|      generate future transactions from periodic transaction rules, for |      generate future transactions from periodic transaction rules, for | ||||||
|      the next 6 months or till report end date. In hledger-ui, also |      the next 6 months or till report end date. In hledger-ui, also | ||||||
|      make ordinary future transactions visible. |      make ordinary future transactions visible. | ||||||
| '--color=WHEN (or --colour=WHEN)' |  | ||||||
| 
 | 
 | ||||||
|  | `--color=WHEN (or --colour=WHEN)' | ||||||
|      Should color-supporting commands use ANSI color codes in text |      Should color-supporting commands use ANSI color codes in text | ||||||
|      output.  'auto' (default): whenever stdout seems to be a |      output.  'auto' (default): whenever stdout seems to be a | ||||||
|      color-supporting terminal.  'always' or 'yes': always, useful eg |      color-supporting terminal.  'always' or 'yes': always, useful eg | ||||||
| @ -223,62 +221,62 @@ the last one takes precedence. | |||||||
| 
 | 
 | ||||||
|    hledger help options: |    hledger help options: | ||||||
| 
 | 
 | ||||||
| '-h --help' | `-h --help' | ||||||
| 
 |  | ||||||
|      show general or COMMAND help |      show general or COMMAND help | ||||||
| '--man' |  | ||||||
| 
 | 
 | ||||||
|  | `--man' | ||||||
|      show general or COMMAND user manual with man |      show general or COMMAND user manual with man | ||||||
| '--info' |  | ||||||
| 
 | 
 | ||||||
|  | `--info' | ||||||
|      show general or COMMAND user manual with info |      show general or COMMAND user manual with info | ||||||
| '--version' |  | ||||||
| 
 | 
 | ||||||
|  | `--version' | ||||||
|      show general or ADDONCMD version |      show general or ADDONCMD version | ||||||
| '--debug[=N]' |  | ||||||
| 
 | 
 | ||||||
|  | `--debug[=N]' | ||||||
|      show debug output (levels 1-9, default: 1) |      show debug output (levels 1-9, default: 1) | ||||||
| 
 | 
 | ||||||
|    A @FILE argument will be expanded to the contents of FILE, which |    A @FILE argument will be expanded to the contents of FILE, which | ||||||
| should contain one command line option/argument per line. (To prevent | should contain one command line option/argument per line. (To prevent | ||||||
| this, insert a '--' argument before.) | this, insert a `--' argument before.) | ||||||
| 
 | 
 | ||||||
|    By default, hledger-web starts the web app in "transient mode" and |    By default, hledger-web starts the web app in "transient mode" and | ||||||
| also opens it in your default web browser if possible. In this mode the | also opens it in your default web browser if possible. In this mode the | ||||||
| web app will keep running for as long as you have it open in a browser | web app will keep running for as long as you have it open in a browser | ||||||
| window, and will exit after two minutes of inactivity (no requests and | window, and will exit after two minutes of inactivity (no requests and | ||||||
| no browser windows viewing it).  With '--serve', it just runs the web | no browser windows viewing it). With `--serve', it just runs the web | ||||||
| app without exiting, and logs requests to the console. With | app without exiting, and logs requests to the console. With | ||||||
| '--serve-api', only the JSON web api (see below) is served, with the | `--serve-api', only the JSON web api (see below) is served, with the | ||||||
| usual HTML server-side web UI disabled. | usual HTML server-side web UI disabled. | ||||||
| 
 | 
 | ||||||
|    By default the server listens on IP address 127.0.0.1, accessible |    By default the server listens on IP address 127.0.0.1, accessible | ||||||
| only to local requests.  You can use '--host' to change this, eg '--host | only to local requests. You can use `--host' to change this, eg `--host | ||||||
| 0.0.0.0' to listen on all configured addresses. | 0.0.0.0' to listen on all configured addresses. | ||||||
| 
 | 
 | ||||||
|    Similarly, use '--port' to set a TCP port other than 5000, eg if you |    Similarly, use `--port' to set a TCP port other than 5000, eg if you | ||||||
| are running multiple hledger-web instances. | are running multiple hledger-web instances. | ||||||
| 
 | 
 | ||||||
|    Both of these options are ignored when '--socket' is used.  In this |    Both of these options are ignored when `--socket' is used. In this | ||||||
| case, it creates an 'AF_UNIX' socket file at the supplied path and uses | case, it creates an `AF_UNIX' socket file at the supplied path and uses | ||||||
| that for communication. This is an alternative way of running multiple | that for communication. This is an alternative way of running multiple | ||||||
| hledger-web instances behind a reverse proxy that handles authentication | hledger-web instances behind a reverse proxy that handles | ||||||
| for different users.  The path can be derived in a predictable way, eg | authentication for different users. The path can be derived in a | ||||||
| by using the username within the path.  As an example, 'nginx' as | predictable way, eg by using the username within the path. As an | ||||||
| reverse proxy can use the variable '$remote_user' to derive a path from | example, `nginx' as reverse proxy can use the variable `$remote_user' | ||||||
| the username used in a HTTP basic authentication.  The following | to derive a path from the username used in a HTTP basic authentication. | ||||||
| 'proxy_pass' directive allows access to all 'hledger-web' instances that | The following `proxy_pass' directive allows access to all `hledger-web' | ||||||
| created a socket in '/tmp/hledger/': | instances that created a socket in `/tmp/hledger/': | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|   proxy_pass http://unix:/tmp/hledger/${remote_user}.socket; |   proxy_pass http://unix:/tmp/hledger/${remote_user}.socket; | ||||||
| 
 | 
 | ||||||
|    You can use '--base-url' to change the protocol, hostname, port and |    You can use `--base-url' to change the protocol, hostname, port and | ||||||
| path that appear in hyperlinks, useful eg for integrating hledger-web | path that appear in hyperlinks, useful eg for integrating hledger-web | ||||||
| within a larger website.  The default is 'http://HOST:PORT/' using the | within a larger website. The default is `http://HOST:PORT/' using the | ||||||
| server's configured host address and TCP port (or 'http://HOST' if PORT | server's configured host address and TCP port (or `http://HOST' if PORT | ||||||
| is 80). | is 80). | ||||||
| 
 | 
 | ||||||
|    With '--file-url' you can set a different base url for static files, |    With `--file-url' you can set a different base url for static files, | ||||||
| eg for better caching or cookie-less serving on high performance | eg for better caching or cookie-less serving on high performance | ||||||
| websites. | websites. | ||||||
| 
 | 
 | ||||||
| @ -293,25 +291,29 @@ journal and to add new transactions, but not to change existing data. | |||||||
| 
 | 
 | ||||||
|    You can restrict who can reach it by |    You can restrict who can reach it by | ||||||
| 
 | 
 | ||||||
|    * setting the IP address it listens on (see '--host' above).  By |    * setting the IP address it listens on (see `--host' above). By | ||||||
|      default it listens on 127.0.0.1, accessible to all users on the |      default it listens on 127.0.0.1, accessible to all users on the | ||||||
|      local machine. |      local machine. | ||||||
|  | 
 | ||||||
|    * putting it behind an authenticating proxy, using eg apache or nginx |    * putting it behind an authenticating proxy, using eg apache or nginx | ||||||
|  | 
 | ||||||
|    * custom firewall rules |    * custom firewall rules | ||||||
| 
 | 
 | ||||||
|    You can restrict what the users who reach it can do, by |    You can restrict what the users who reach it can do, by | ||||||
| 
 | 
 | ||||||
|    * using the '--capabilities=CAP[,CAP..]' flag when you start it, |    * using the `--capabilities=CAP[,CAP..]' flag when you start it, | ||||||
|      enabling one or more of the following capabilities. The default |      enabling one or more of the following capabilities. The default | ||||||
|      value is 'view,add': |      value is `view,add': | ||||||
|         * 'view' - allows viewing the journal file and all included |         * `view' - allows viewing the journal file and all included | ||||||
|           files |           files | ||||||
|         * 'add' - allows adding new transactions to the main journal | 
 | ||||||
|  |         * `add' - allows adding new transactions to the main journal | ||||||
|           file |           file | ||||||
|         * 'manage' - allows editing, uploading or downloading the main | 
 | ||||||
|  |         * `manage' - allows editing, uploading or downloading the main | ||||||
|           or included files |           or included files | ||||||
| 
 | 
 | ||||||
|    * using the '--capabilities-header=HTTPHEADER' flag to specify a HTTP |    * using the `--capabilities-header=HTTPHEADER' flag to specify a HTTP | ||||||
|      header from which it will read capabilities to enable. hledger-web |      header from which it will read capabilities to enable. hledger-web | ||||||
|      on Sandstorm uses the X-Sandstorm-Permissions header to integrate |      on Sandstorm uses the X-Sandstorm-Permissions header to integrate | ||||||
|      with Sandstorm's permissions. This is disabled by default. |      with Sandstorm's permissions. This is disabled by default. | ||||||
| @ -322,7 +324,7 @@ File: hledger-web.info,  Node: EDITING UPLOADING DOWNLOADING,  Next: RELOADING, | |||||||
| 3 EDITING, UPLOADING, DOWNLOADING | 3 EDITING, UPLOADING, DOWNLOADING | ||||||
| ********************************* | ********************************* | ||||||
| 
 | 
 | ||||||
| If you enable the 'manage' capability mentioned above, you'll see a new | If you enable the `manage' capability mentioned above, you'll see a new | ||||||
| "spanner" button to the right of the search form. Clicking this will | "spanner" button to the right of the search form. Clicking this will | ||||||
| let you edit, upload, or download the journal file or any files it | let you edit, upload, or download the journal file or any files it | ||||||
| includes. | includes. | ||||||
| @ -363,13 +365,15 @@ File: hledger-web.info,  Node: JSON API,  Next: ENVIRONMENT,  Prev: RELOADING, | |||||||
| 
 | 
 | ||||||
| In addition to the web UI, hledger-web also serves a JSON API that can | In addition to the web UI, hledger-web also serves a JSON API that can | ||||||
| be used to get data or add new transactions. If you want the JSON API | be used to get data or add new transactions. If you want the JSON API | ||||||
| only, you can use the '--serve-api' flag.  Eg: | only, you can use the `--serve-api' flag. Eg: | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| $ hledger-web -f examples/sample.journal --serve-api | $ hledger-web -f examples/sample.journal --serve-api | ||||||
| ... | ... | ||||||
| 
 | 
 | ||||||
|    You can get JSON data from these routes: |    You can get JSON data from these routes: | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| /version | /version | ||||||
| /accountnames | /accountnames | ||||||
| /transactions | /transactions | ||||||
| @ -382,6 +386,7 @@ $ hledger-web -f examples/sample.journal --serve-api | |||||||
| command).  (hledger-web's JSON does not include newlines, here we use | command).  (hledger-web's JSON does not include newlines, here we use | ||||||
| python to prettify it): | python to prettify it): | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool | $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool | ||||||
| [ | [ | ||||||
|     "assets", |     "assets", | ||||||
| @ -401,6 +406,7 @@ $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool | |||||||
| 
 | 
 | ||||||
|    Or all transactions: |    Or all transactions: | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| $ curl -s http://127.0.0.1:5000/transactions | python -m json.tool | $ curl -s http://127.0.0.1:5000/transactions | python -m json.tool | ||||||
| [ | [ | ||||||
|     { |     { | ||||||
| @ -426,20 +432,21 @@ on the various data types, eg Transaction.  And for a higher level | |||||||
| understanding, see the journal manual. | understanding, see the journal manual. | ||||||
| 
 | 
 | ||||||
|    In some cases there is outer JSON corresponding to a "Report" type. |    In some cases there is outer JSON corresponding to a "Report" type. | ||||||
| To understand that, go to the Hledger.Web.Handler.MiscR haddock and look | To understand that, go to the Hledger.Web.Handler.MiscR haddock and | ||||||
| at the source for the appropriate handler to see what it returns.  Eg | look at the source for the appropriate handler to see what it returns. | ||||||
| for '/accounttransactions' it's getAccounttransactionsR, returning a | Eg for `/accounttransactions' it's getAccounttransactionsR, returning a | ||||||
| "'accountTransactionsReport ...'".  Looking up the haddock for that we | "`accountTransactionsReport ...'". Looking up the haddock for that we | ||||||
| can see that /accounttransactions returns an AccountTransactionsReport, | can see that /accounttransactions returns an AccountTransactionsReport, | ||||||
| which consists of a report title and a list of | which consists of a report title and a list of | ||||||
| AccountTransactionsReportItem (etc). | AccountTransactionsReportItem (etc). | ||||||
| 
 | 
 | ||||||
|    You can add a new transaction to the journal with a PUT request to |    You can add a new transaction to the journal with a PUT request to | ||||||
| '/add', if hledger-web was started with the 'add' capability (enabled by | `/add', if hledger-web was started with the `add' capability (enabled | ||||||
| default).  The payload must be the full, exact JSON representation of a | by default). The payload must be the full, exact JSON representation of | ||||||
| hledger transaction (partial data won't do).  You can get sample JSON | a hledger transaction (partial data won't do). You can get sample JSON | ||||||
| from hledger-web's '/transactions' or '/accounttransactions', or you can | from hledger-web's `/transactions' or `/accounttransactions', or you | ||||||
| export it with hledger-lib, eg like so: | can export it with hledger-lib, eg like so: | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| .../hledger$ stack ghci hledger-lib | .../hledger$ stack ghci hledger-lib | ||||||
| >>> writeJsonFile "txn.json" (head $ jtxns samplejournal) | >>> writeJsonFile "txn.json" (head $ jtxns samplejournal) | ||||||
| @ -448,6 +455,7 @@ export it with hledger-lib, eg like so: | |||||||
|    Here's how it looks as of hledger-1.17 (remember, this JSON |    Here's how it looks as of hledger-1.17 (remember, this JSON | ||||||
| corresponds to hledger's Transaction and related data types): | corresponds to hledger's Transaction and related data types): | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| { | { | ||||||
|     "tcomment": "", |     "tcomment": "", | ||||||
|     "tpostings": [ |     "tpostings": [ | ||||||
| @ -537,6 +545,7 @@ corresponds to hledger's Transaction and related data types): | |||||||
|    And here's how to test adding it with curl. This should add a new |    And here's how to test adding it with curl. This should add a new | ||||||
| entry to your journal: | entry to your journal: | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json | $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| @ -545,25 +554,26 @@ File: hledger-web.info,  Node: ENVIRONMENT,  Next: FILES,  Prev: JSON API,  Up: | |||||||
| 6 ENVIRONMENT | 6 ENVIRONMENT | ||||||
| ************* | ************* | ||||||
| 
 | 
 | ||||||
| *LEDGER_FILE* The journal file path when not specified with '-f'. | *LEDGER_FILE* The journal file path when not specified with `-f'. | ||||||
| Default: '~/.hledger.journal' (on windows, perhaps | Default: `~/.hledger.journal' (on windows, perhaps | ||||||
| 'C:/Users/USER/.hledger.journal'). | `C:/Users/USER/.hledger.journal'). | ||||||
| 
 | 
 | ||||||
|    A typical value is '~/DIR/YYYY.journal', where DIR is a |    A typical value is `~/DIR/YYYY.journal', where DIR is a | ||||||
| version-controlled finance directory and YYYY is the current year. Or | version-controlled finance directory and YYYY is the current year. Or | ||||||
| '~/DIR/current.journal', where current.journal is a symbolic link to | `~/DIR/current.journal', where current.journal is a symbolic link to | ||||||
| YYYY.journal. | YYYY.journal. | ||||||
| 
 | 
 | ||||||
|    On Mac computers, you can set this and other environment variables in |    On Mac computers, you can set this and other environment variables | ||||||
| a more thorough way that also affects applications started from the GUI | in a more thorough way that also affects applications started from the | ||||||
| (say, an Emacs dock icon).  Eg on MacOS Catalina I have a | GUI (say, an Emacs dock icon). Eg on MacOS Catalina I have a | ||||||
| '~/.MacOSX/environment.plist' file containing | `~/.MacOSX/environment.plist' file containing | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| { | { | ||||||
|   "LEDGER_FILE" : "~/finance/current.journal" |   "LEDGER_FILE" : "~/finance/current.journal" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|    To see the effect you may need to 'killall Dock', or reboot. |    To see the effect you may need to `killall Dock', or reboot. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-web.info,  Node: FILES,  Next: BUGS,  Prev: ENVIRONMENT,  Up: Top | File: hledger-web.info,  Node: FILES,  Next: BUGS,  Prev: ENVIRONMENT,  Up: Top | ||||||
| @ -572,9 +582,9 @@ File: hledger-web.info,  Node: FILES,  Next: BUGS,  Prev: ENVIRONMENT,  Up: Top | |||||||
| ******* | ******* | ||||||
| 
 | 
 | ||||||
| Reads data from one or more files in hledger journal, timeclock, | Reads data from one or more files in hledger journal, timeclock, | ||||||
| timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or | timedot, or CSV format specified with `-f', or `$LEDGER_FILE', or | ||||||
| '$HOME/.hledger.journal' (on windows, perhaps | `$HOME/.hledger.journal' (on windows, perhaps | ||||||
| 'C:/Users/USER/.hledger.journal'). | `C:/Users/USER/.hledger.journal'). | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| File: hledger-web.info,  Node: BUGS,  Prev: FILES,  Up: Top | File: hledger-web.info,  Node: BUGS,  Prev: FILES,  Up: Top | ||||||
| @ -582,10 +592,10 @@ File: hledger-web.info,  Node: BUGS,  Prev: FILES,  Up: Top | |||||||
| 8 BUGS | 8 BUGS | ||||||
| ****** | ****** | ||||||
| 
 | 
 | ||||||
| The need to precede options with '--' when invoked from hledger is | The need to precede options with `--' when invoked from hledger is | ||||||
| awkward. | awkward. | ||||||
| 
 | 
 | ||||||
|    '-f-' doesn't work (hledger-web can't read from stdin). |    `-f-' doesn't work (hledger-web can't read from stdin). | ||||||
| 
 | 
 | ||||||
|    Query arguments and some hledger options are ignored. |    Query arguments and some hledger options are ignored. | ||||||
| 
 | 
 | ||||||
| @ -593,24 +603,25 @@ awkward. | |||||||
| 
 | 
 | ||||||
|    Does not work well on small screens. |    Does not work well on small screens. | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  |  | ||||||
| Tag Table: | Tag Table: | ||||||
| Node: Top72 | Node: Top84 | ||||||
| Node: OPTIONS1762 | Node: OPTIONS1751 | ||||||
| Ref: #options1867 | Ref: #options1856 | ||||||
| Node: PERMISSIONS9082 | Node: PERMISSIONS9107 | ||||||
| Ref: #permissions9221 | Ref: #permissions9246 | ||||||
| Node: EDITING UPLOADING DOWNLOADING10433 | Node: EDITING UPLOADING DOWNLOADING10458 | ||||||
| Ref: #editing-uploading-downloading10614 | Ref: #editing-uploading-downloading10639 | ||||||
| Node: RELOADING11448 | Node: RELOADING11470 | ||||||
| Ref: #reloading11582 | Ref: #reloading11604 | ||||||
| Node: JSON API12015 | Node: JSON API12036 | ||||||
| Ref: #json-api12129 | Ref: #json-api12150 | ||||||
| Node: ENVIRONMENT17619 | Node: ENVIRONMENT17639 | ||||||
| Ref: #environment17735 | Ref: #environment17755 | ||||||
| Node: FILES18468 | Node: FILES18487 | ||||||
| Ref: #files18568 | Ref: #files18587 | ||||||
| Node: BUGS18781 | Node: BUGS18800 | ||||||
| Ref: #bugs18859 | Ref: #bugs18878 | ||||||
|  |  | ||||||
| End Tag Table | End Tag Table | ||||||
|  | |||||||
| @ -20,9 +20,9 @@ DESCRIPTION | |||||||
|        hledger-web  is hledger's web interface.  It starts a simple web appli- |        hledger-web  is hledger's web interface.  It starts a simple web appli- | ||||||
|        cation for browsing and adding transactions, and optionally opens it in |        cation for browsing and adding transactions, and optionally opens it in | ||||||
|        a  web browser window if possible.  It provides a more user-friendly UI |        a  web browser window if possible.  It provides a more user-friendly UI | ||||||
|        than the hledger CLI or hledger-ui interface, showing more at once (ac- |        than the hledger CLI or hledger-ui  interface,  showing  more  at  once | ||||||
|        counts, the current account register, balance charts) and allowing his- |        (accounts,  the  current account register, balance charts) and allowing | ||||||
|        tory-aware data entry, interactive searching, and bookmarking. |        history-aware data entry, interactive searching, and bookmarking. | ||||||
| 
 | 
 | ||||||
|        hledger-web also lets you share a ledger with multiple users,  or  even |        hledger-web also lets you share a ledger with multiple users,  or  even | ||||||
|        the  public  web.   There is no access control, so if you need that you |        the  public  web.   There is no access control, so if you need that you | ||||||
| @ -59,8 +59,8 @@ OPTIONS | |||||||
| 
 | 
 | ||||||
|        --socket=SOCKETFILE |        --socket=SOCKETFILE | ||||||
|               use a unix domain socket file to listen for requests instead  of |               use a unix domain socket file to listen for requests instead  of | ||||||
|               a  TCP socket.  Implies --serve.  It can only be used if the op- |               a  TCP  socket.   Implies  --serve.   It can only be used if the | ||||||
|               erating system can provide this type of socket. |               operating system can provide this type of socket. | ||||||
| 
 | 
 | ||||||
|        --base-url=URL |        --base-url=URL | ||||||
|               set the  base  url  (default:  http://IPADDR:PORT).   You  would |               set the  base  url  (default:  http://IPADDR:PORT).   You  would | ||||||
| @ -110,8 +110,8 @@ OPTIONS | |||||||
|               assignments) |               assignments) | ||||||
| 
 | 
 | ||||||
|        -s --strict |        -s --strict | ||||||
|               do  extra error checking (check that all posted accounts are de- |               do  extra  error  checking  (check  that all posted accounts are | ||||||
|               clared) |               declared) | ||||||
| 
 | 
 | ||||||
|        hledger reporting options: |        hledger reporting options: | ||||||
| 
 | 
 | ||||||
| @ -141,8 +141,8 @@ OPTIONS | |||||||
|               using period expressions syntax |               using period expressions syntax | ||||||
| 
 | 
 | ||||||
|        --date2 |        --date2 | ||||||
|               match the secondary date instead (see command help for other ef- |               match  the  secondary  date  instead (see command help for other | ||||||
|               fects) |               effects) | ||||||
| 
 | 
 | ||||||
|        -U --unmarked |        -U --unmarked | ||||||
|               include only unmarked postings/txns (can combine with -P or -C) |               include only unmarked postings/txns (can combine with -P or -C) | ||||||
| @ -177,8 +177,9 @@ OPTIONS | |||||||
|               convert  amounts  to  cost  or  market value, more flexibly than |               convert  amounts  to  cost  or  market value, more flexibly than | ||||||
|               -B/-V/-X |               -B/-V/-X | ||||||
| 
 | 
 | ||||||
|        --infer-value |        --infer-market-prices | ||||||
|               with -V/-X/--value, also infer market prices from transactions |               use transaction prices (recorded with @  or  @@)  as  additional | ||||||
|  |               market prices, as if they were P directives | ||||||
| 
 | 
 | ||||||
|        --auto apply automated posting rules to modify transactions. |        --auto apply automated posting rules to modify transactions. | ||||||
| 
 | 
 | ||||||
| @ -262,8 +263,8 @@ PERMISSIONS | |||||||
|        You can restrict who can reach it by |        You can restrict who can reach it by | ||||||
| 
 | 
 | ||||||
|        o setting  the IP address it listens on (see --host above).  By default |        o setting  the IP address it listens on (see --host above).  By default | ||||||
|          it  listens  on  127.0.0.1,  accessible to all users on the local ma- |          it listens on  127.0.0.1,  accessible  to  all  users  on  the  local | ||||||
|          chine. |          machine. | ||||||
| 
 | 
 | ||||||
|        o putting it behind an authenticating proxy, using eg apache or nginx |        o putting it behind an authenticating proxy, using eg apache or nginx | ||||||
| 
 | 
 | ||||||
| @ -279,8 +280,8 @@ PERMISSIONS | |||||||
| 
 | 
 | ||||||
|          o add - allows adding new transactions to the main journal file |          o add - allows adding new transactions to the main journal file | ||||||
| 
 | 
 | ||||||
|          o manage - allows editing, uploading or downloading the main  or  in- |          o manage  -  allows  editing,  uploading  or  downloading the main or | ||||||
|            cluded files |            included files | ||||||
| 
 | 
 | ||||||
|        o using the --capabilities-header=HTTPHEADER flag  to  specify  a  HTTP |        o using the --capabilities-header=HTTPHEADER flag  to  specify  a  HTTP | ||||||
|          header  from  which it will read capabilities to enable.  hledger-web |          header  from  which it will read capabilities to enable.  hledger-web | ||||||
| @ -290,8 +291,8 @@ PERMISSIONS | |||||||
| EDITING, UPLOADING, DOWNLOADING | EDITING, UPLOADING, DOWNLOADING | ||||||
|        If  you  enable the manage capability mentioned above, you'll see a new |        If  you  enable the manage capability mentioned above, you'll see a new | ||||||
|        "spanner" button to the right of the search form.  Clicking  this  will |        "spanner" button to the right of the search form.  Clicking  this  will | ||||||
|        let you edit, upload, or download the journal file or any files it  in- |        let  you  edit,  upload,  or  download the journal file or any files it | ||||||
|        cludes. |        includes. | ||||||
| 
 | 
 | ||||||
|        Note, unlike any other hledger command, in this mode you (or any  visi- |        Note, unlike any other hledger command, in this mode you (or any  visi- | ||||||
|        tor) can alter or wipe the data files. |        tor) can alter or wipe the data files. | ||||||
| @ -310,8 +311,8 @@ RELOADING | |||||||
|        hledger-web detects changes made to the files by other means (eg if you |        hledger-web detects changes made to the files by other means (eg if you | ||||||
|        edit it directly, outside of hledger-web), and it  will  show  the  new |        edit it directly, outside of hledger-web), and it  will  show  the  new | ||||||
|        data  when  you reload the page or navigate to a new page.  If a change |        data  when  you reload the page or navigate to a new page.  If a change | ||||||
|        makes a file unparseable, hledger-web will display an error message un- |        makes a file unparseable, hledger-web will  display  an  error  message | ||||||
|        til the file has been fixed. |        until the file has been fixed. | ||||||
| 
 | 
 | ||||||
|        (Note: if you are viewing files mounted from another machine, make sure |        (Note: if you are viewing files mounted from another machine, make sure | ||||||
|        that both machine clocks are roughly in step.) |        that both machine clocks are roughly in step.) | ||||||
| @ -378,15 +379,15 @@ JSON API | |||||||
| 
 | 
 | ||||||
|        Most of the JSON corresponds to hledger's data types;  for  details  of |        Most of the JSON corresponds to hledger's data types;  for  details  of | ||||||
|        what  the fields mean, see the Hledger.Data.Json haddock docs and click |        what  the fields mean, see the Hledger.Data.Json haddock docs and click | ||||||
|        on  the various data types, eg Transaction.  And for a higher level un- |        on the various data types, eg Transaction.   And  for  a  higher  level | ||||||
|        derstanding, see the journal manual. |        understanding, see the journal manual. | ||||||
| 
 | 
 | ||||||
|        In some cases there is outer JSON corresponding to a "Report" type.  To |        In some cases there is outer JSON corresponding to a "Report" type.  To | ||||||
|        understand that, go to the Hledger.Web.Handler.MiscR haddock  and  look |        understand that, go to the Hledger.Web.Handler.MiscR haddock  and  look | ||||||
|        at  the  source for the appropriate handler to see what it returns.  Eg |        at  the  source for the appropriate handler to see what it returns.  Eg | ||||||
|        for /accounttransactions it's getAccounttransactionsR, returning a "ac- |        for  /accounttransactions  it's  getAccounttransactionsR,  returning  a | ||||||
|        countTransactionsReport ...".  Looking up the haddock for that  we  can |        "accountTransactionsReport  ...".   Looking  up the haddock for that we | ||||||
|        see  that  /accounttransactions  returns  an AccountTransactionsReport, |        can see that /accounttransactions returns an AccountTransactionsReport, | ||||||
|        which  consists  of a report title and a list of AccountTransactionsRe- |        which  consists  of a report title and a list of AccountTransactionsRe- | ||||||
|        portItem (etc). |        portItem (etc). | ||||||
| 
 | 
 | ||||||
| @ -490,8 +491,8 @@ JSON API | |||||||
|                   "tstatus": "Unmarked" |                   "tstatus": "Unmarked" | ||||||
|               } |               } | ||||||
| 
 | 
 | ||||||
|        And  here's how to test adding it with curl.  This should add a new en- |        And here's how to test adding it with curl.   This  should  add  a  new | ||||||
|        try to your journal: |        entry to your journal: | ||||||
| 
 | 
 | ||||||
|               $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json |               $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json | ||||||
| 
 | 
 | ||||||
| @ -506,8 +507,8 @@ ENVIRONMENT | |||||||
| 
 | 
 | ||||||
|        On Mac computers, you can set this and other environment variables in a |        On Mac computers, you can set this and other environment variables in a | ||||||
|        more  thorough  way that also affects applications started from the GUI |        more  thorough  way that also affects applications started from the GUI | ||||||
|        (say, an Emacs dock icon).  Eg on MacOS Catalina I have a ~/.MacOSX/en- |        (say,  an  Emacs  dock  icon).   Eg  on  MacOS  Catalina   I   have   a | ||||||
|        vironment.plist file containing |        ~/.MacOSX/environment.plist file containing | ||||||
| 
 | 
 | ||||||
|               { |               { | ||||||
|                 "LEDGER_FILE" : "~/finance/current.journal" |                 "LEDGER_FILE" : "~/finance/current.journal" | ||||||
|  | |||||||
| @ -179,8 +179,9 @@ convert amounts to their market value in commodity COMM | |||||||
| \f[B]\f[CB]--value\f[B]\f[R] | \f[B]\f[CB]--value\f[B]\f[R] | ||||||
| convert amounts to cost or market value, more flexibly than -B/-V/-X | convert amounts to cost or market value, more flexibly than -B/-V/-X | ||||||
| .TP | .TP | ||||||
| \f[B]\f[CB]--infer-value\f[B]\f[R] | \f[B]\f[CB]--infer-market-prices\f[B]\f[R] | ||||||
| with -V/-X/--value, also infer market prices from transactions | use transaction prices (recorded with \[at] or \[at]\[at]) as additional | ||||||
|  | market prices, as if they were P directives | ||||||
| .TP | .TP | ||||||
| \f[B]\f[CB]--auto\f[B]\f[R] | \f[B]\f[CB]--auto\f[B]\f[R] | ||||||
| apply automated posting rules to modify transactions. | apply automated posting rules to modify transactions. | ||||||
| @ -1226,19 +1227,22 @@ Some of these can also be expressed as command-line options (eg | |||||||
| Generally you can mix options and query arguments, and the resulting | Generally you can mix options and query arguments, and the resulting | ||||||
| query will be their intersection (perhaps excluding the | query will be their intersection (perhaps excluding the | ||||||
| \f[C]-p/--period\f[R] option). | \f[C]-p/--period\f[R] option). | ||||||
|  | .SH COSTING | ||||||
|  | .PP | ||||||
|  | The \f[C]-B/--cost\f[R] flag converts amounts to their cost or sale | ||||||
|  | amount at transaction time, if they have a transaction price specified. | ||||||
|  | If this flag is supplied, hledger will perform cost conversion first, | ||||||
|  | and will apply any market price valuations (if requested) afterwards. | ||||||
| .SH VALUATION | .SH VALUATION | ||||||
| .PP | .PP | ||||||
| Instead of reporting amounts in their original commodity, hledger can | Instead of reporting amounts in their original commodity, hledger can | ||||||
| convert them to cost/sale amount (using the conversion rate recorded in | convert them to cost/sale amount (using the conversion rate recorded in | ||||||
| the transaction), or to market value (using some market price on a | the transaction), and/or to market value (using some market price on a | ||||||
| certain date). | certain date). | ||||||
| This is controlled by the \f[C]--value=TYPE[,COMMODITY]\f[R] option, but | This is controlled by the \f[C]--cost\f[R] and | ||||||
| we also provide the simpler \f[C]-B\f[R]/\f[C]-V\f[R]/\f[C]-X\f[R] | \f[C]--value=TYPE[,COMMODITY]\f[R] options, but we also provide the | ||||||
| flags, and usually one of those is all you need. | simpler \f[C]-V\f[R]/\f[C]-X\f[R] flags, and usually one of those is all | ||||||
| .SS -B: Cost | you need. | ||||||
| .PP |  | ||||||
| The \f[C]-B/--cost\f[R] flag converts amounts to their cost or sale |  | ||||||
| amount at transaction time, if they have a transaction price specified. |  | ||||||
| .SS -V: Value | .SS -V: Value | ||||||
| .PP | .PP | ||||||
| The \f[C]-V/--market\f[R] flag converts amounts to market value in their | The \f[C]-V/--market\f[R] flag converts amounts to market value in their | ||||||
| @ -1270,17 +1274,17 @@ this order of preference : | |||||||
| .IP "1." 3 | .IP "1." 3 | ||||||
| A \f[I]declared market price\f[R] or \f[I]inferred market price\f[R]: | A \f[I]declared market price\f[R] or \f[I]inferred market price\f[R]: | ||||||
| A\[aq]s latest market price in B on or before the valuation date as | A\[aq]s latest market price in B on or before the valuation date as | ||||||
| declared by a P directive, or (with the \f[C]--infer-value\f[R] flag) | declared by a P directive, or (with the \f[C]--infer-market-price\f[R] | ||||||
| inferred from transaction prices. | flag) inferred from transaction prices. | ||||||
| .IP "2." 3 | .IP "2." 3 | ||||||
| A \f[I]reverse market price\f[R]: the inverse of a declared or inferred | A \f[I]reverse market price\f[R]: the inverse of a declared or inferred | ||||||
| market price from B to A. | market price from B to A. | ||||||
| .IP "3." 3 | .IP "3." 3 | ||||||
| A \f[I]a forward chain of market prices\f[R]: a synthetic price formed | A \f[I]forward chain of market prices\f[R]: a synthetic price formed by | ||||||
| by combining the shortest chain of \[dq]forward\[dq] (only 1 above) | combining the shortest chain of \[dq]forward\[dq] (only 1 above) market | ||||||
| market prices, leading from A to B. | prices, leading from A to B. | ||||||
| .IP "4." 3 | .IP "4." 3 | ||||||
| A \f[I]any chain of market prices\f[R]: a chain of any market prices, | \f[I]Any chain of market prices\f[R]: a chain of any market prices, | ||||||
| including both forward and reverse prices (1 and 2 above), leading from | including both forward and reverse prices (1 and 2 above), leading from | ||||||
| A to B. | A to B. | ||||||
| .PP | .PP | ||||||
| @ -1292,7 +1296,7 @@ That limit is currently 1000. | |||||||
| .PP | .PP | ||||||
| Amounts for which no suitable market price can be found, are not | Amounts for which no suitable market price can be found, are not | ||||||
| converted. | converted. | ||||||
| .SS --infer-value: market prices from transactions | .SS --infer-market-price: market prices from transactions | ||||||
| .PP | .PP | ||||||
| Normally, market value in hledger is fully controlled by, and requires, | Normally, market value in hledger is fully controlled by, and requires, | ||||||
| P directives in your journal. | P directives in your journal. | ||||||
| @ -1301,17 +1305,18 @@ usually take place at close to market value, why not use the recorded | |||||||
| transaction prices as additional market prices (as Ledger does) ? | transaction prices as additional market prices (as Ledger does) ? | ||||||
| We could produce value reports without needing P directives at all. | We could produce value reports without needing P directives at all. | ||||||
| .PP | .PP | ||||||
| Adding the \f[C]--infer-value\f[R] flag to \f[C]-V\f[R], \f[C]-X\f[R] or | Adding the \f[C]--infer-market-price\f[R] flag to \f[C]-V\f[R], | ||||||
| \f[C]--value\f[R] enables this. | \f[C]-X\f[R] or \f[C]--value\f[R] enables this. | ||||||
| So for example, \f[C]hledger bs -V --infer-value\f[R] will get market | So for example, \f[C]hledger bs -V --infer-market-price\f[R] will get | ||||||
| prices both from P directives and from transactions. | market prices both from P directives and from transactions. | ||||||
|  | (And if both occur on the same day, the P directive takes precedence). | ||||||
| .PP | .PP | ||||||
| There is a downside: value reports can sometimes be affected in | There is a downside: value reports can sometimes be affected in | ||||||
| confusing/undesired ways by your journal entries. | confusing/undesired ways by your journal entries. | ||||||
| If this happens to you, read all of this Valuation section carefully, | If this happens to you, read all of this Valuation section carefully, | ||||||
| and try adding \f[C]--debug\f[R] or \f[C]--debug=2\f[R] to troubleshoot. | and try adding \f[C]--debug\f[R] or \f[C]--debug=2\f[R] to troubleshoot. | ||||||
| .PP | .PP | ||||||
| \f[C]--infer-value\f[R] can infer market prices from: | \f[C]--infer-market-price\f[R] can infer market prices from: | ||||||
| .IP \[bu] 2 | .IP \[bu] 2 | ||||||
| multicommodity transactions with explicit prices | multicommodity transactions with explicit prices | ||||||
| (\f[C]\[at]\f[R]/\f[C]\[at]\[at]\f[R]) | (\f[C]\[at]\f[R]/\f[C]\[at]\[at]\f[R]) | ||||||
| @ -1350,16 +1355,16 @@ date. | |||||||
| valuation date.) | valuation date.) | ||||||
| .IP "3." 3 | .IP "3." 3 | ||||||
| If there are no P directives at all (any commodity or date) and the | If there are no P directives at all (any commodity or date) and the | ||||||
| \f[C]--infer-value\f[R] flag is used: the price commodity from the | \f[C]--infer-market-price\f[R] flag is used: the price commodity from | ||||||
| latest transaction-inferred price for A on or before valuation date. | the latest transaction-inferred price for A on or before valuation date. | ||||||
| .PP | .PP | ||||||
| This means: | This means: | ||||||
| .IP \[bu] 2 | .IP \[bu] 2 | ||||||
| If you have P directives, they determine which commodities \f[C]-V\f[R] | If you have P directives, they determine which commodities \f[C]-V\f[R] | ||||||
| will convert, and to what. | will convert, and to what. | ||||||
| .IP \[bu] 2 | .IP \[bu] 2 | ||||||
| If you have no P directives, and use the \f[C]--infer-value\f[R] flag, | If you have no P directives, and use the \f[C]--infer-market-price\f[R] | ||||||
| transaction prices determine it. | flag, transaction prices determine it. | ||||||
| .PP | .PP | ||||||
| Amounts for which no valuation commodity can be found are not converted. | Amounts for which no valuation commodity can be found are not converted. | ||||||
| .SS Simple valuation examples | .SS Simple valuation examples | ||||||
| @ -1410,15 +1415,14 @@ $ hledger -f t.j bal -N euros -V | |||||||
| .fi | .fi | ||||||
| .SS --value: Flexible valuation | .SS --value: Flexible valuation | ||||||
| .PP | .PP | ||||||
| \f[C]-B\f[R], \f[C]-V\f[R] and \f[C]-X\f[R] are special cases of the | \f[C]-V\f[R] and \f[C]-X\f[R] are special cases of the more general | ||||||
| more general \f[C]--value\f[R] option: | \f[C]--value\f[R] option: | ||||||
| .IP | .IP | ||||||
| .nf | .nf | ||||||
| \f[C] | \f[C] | ||||||
|  --value=TYPE[,COMM]  TYPE is cost, then, end, now or YYYY-MM-DD. |  --value=TYPE[,COMM]  TYPE is then, end, now or YYYY-MM-DD. | ||||||
|                       COMM is an optional commodity symbol. |                       COMM is an optional commodity symbol. | ||||||
|                       Shows amounts converted to: |                       Shows amounts converted to: | ||||||
|                       - cost commodity using transaction prices (then optionally to COMM using market prices at period end(s)) |  | ||||||
|                       - default valuation commodity (or COMM) using market prices at posting dates |                       - default valuation commodity (or COMM) using market prices at posting dates | ||||||
|                       - default valuation commodity (or COMM) using market prices at period end(s) |                       - default valuation commodity (or COMM) using market prices at period end(s) | ||||||
|                       - default valuation commodity (or COMM) using current market prices |                       - default valuation commodity (or COMM) using current market prices | ||||||
| @ -1428,9 +1432,6 @@ more general \f[C]--value\f[R] option: | |||||||
| .PP | .PP | ||||||
| The TYPE part selects cost or value and valuation date: | The TYPE part selects cost or value and valuation date: | ||||||
| .TP | .TP | ||||||
| \f[B]\f[CB]--value=cost\f[B]\f[R] |  | ||||||
| Convert amounts to cost, using the prices recorded in transactions. |  | ||||||
| .TP |  | ||||||
| \f[B]\f[CB]--value=then\f[B]\f[R] | \f[B]\f[CB]--value=then\f[B]\f[R] | ||||||
| Convert amounts to their value in the default valuation commodity, using | Convert amounts to their value in the default valuation commodity, using | ||||||
| market prices on each posting\[aq]s date. | market prices on each posting\[aq]s date. | ||||||
| @ -1481,7 +1482,7 @@ Show the cost of each posting: | |||||||
| .IP | .IP | ||||||
| .nf | .nf | ||||||
| \f[C] | \f[C] | ||||||
| $ hledger -f- print --value=cost | $ hledger -f- print --cost | ||||||
| 2000-01-01 | 2000-01-01 | ||||||
|     (a)             5 B |     (a)             5 B | ||||||
| 
 | 
 | ||||||
| @ -1620,7 +1621,7 @@ lw(9.5n) lw(11.8n) lw(12.0n) lw(17.2n) lw(12.0n) lw(7.4n). | |||||||
| T{ | T{ | ||||||
| Report type | Report type | ||||||
| T}@T{ | T}@T{ | ||||||
| \f[C]-B\f[R], \f[C]--value=cost\f[R] | \f[C]-B\f[R], \f[C]--cost\f[R] | ||||||
| T}@T{ | T}@T{ | ||||||
| \f[C]-V\f[R], \f[C]-X\f[R] | \f[C]-V\f[R], \f[C]-X\f[R] | ||||||
| T}@T{ | T}@T{ | ||||||
| @ -2355,41 +2356,59 @@ aregister, areg | |||||||
| .PD 0 | .PD 0 | ||||||
| .P | .P | ||||||
| .PD | .PD | ||||||
| Show transactions affecting a particular account, and the account\[aq]s | .PP | ||||||
| running balance. | Show the transactions and running historical balance in an account, with | ||||||
|  | each line item representing one transaction. | ||||||
| .PP | .PP | ||||||
| \f[C]aregister\f[R] shows the transactions affecting a particular | \f[C]aregister\f[R] shows the transactions affecting a particular | ||||||
| account (and its subaccounts), from the point of view of that account. | account and its subaccounts, with each line item representing a whole | ||||||
| Each line shows: | transaction - as in bank statements, hledger-ui, hledger-web and other | ||||||
| .IP \[bu] 2 | accounting apps. | ||||||
| the transaction\[aq]s (or posting\[aq]s, see below) date |  | ||||||
| .IP \[bu] 2 |  | ||||||
| the names of the other account(s) involved |  | ||||||
| .IP \[bu] 2 |  | ||||||
| the net change to this account\[aq]s balance |  | ||||||
| .IP \[bu] 2 |  | ||||||
| the account\[aq]s historical running balance (including balance from |  | ||||||
| transactions before the report start date). |  | ||||||
| .PP | .PP | ||||||
| With \f[C]aregister\f[R], each line represents a whole transaction - as | Note this is unlike the \f[C]register\f[R] command, which shows | ||||||
| in hledger-ui, hledger-web, and your bank statement. | individual postings and does not always show a single account or a | ||||||
| By contrast, the \f[C]register\f[R] command shows individual postings, | historical balance. | ||||||
| across all accounts. |  | ||||||
| You might prefer \f[C]aregister\f[R] for reconciling with real-world |  | ||||||
| asset/liability accounts, and \f[C]register\f[R] for reviewing detailed |  | ||||||
| revenues/expenses. |  | ||||||
| .PP | .PP | ||||||
| An account must be specified as the first argument, which should be the | A reminder, \[dq]historical\[dq] balances include any balance from | ||||||
| full account name or an account pattern (regular expression). | transactions before the report start date, so (if opening balances are | ||||||
| aregister will show transactions in this account (the first one matched) | recorded correctly) \f[C]aregister\f[R] will show the real-world | ||||||
| and any of its subaccounts. | balances of an account, as you would see in a bank statement. | ||||||
|  | .PP | ||||||
|  | As a quick rule of thumb, use \f[C]aregister\f[R] for reconciling | ||||||
|  | real-world asset/liability accounts and \f[C]register\f[R] for reviewing | ||||||
|  | detailed revenues/expenses. | ||||||
|  | .PP | ||||||
|  | \f[C]aregister\f[R] shows the register for just one account (and its | ||||||
|  | subaccounts). | ||||||
|  | This account must be specified as the first argument. | ||||||
|  | You can write either the full account name, or a case-insensitive | ||||||
|  | regular expression which will select the alphabetically first matched | ||||||
|  | account. | ||||||
|  | (Eg if you have \f[C]assets:aaa:checking\f[R] and | ||||||
|  | \f[C]assets:bbb:checking\f[R] accounts, \f[C]hledger areg checking\f[R] | ||||||
|  | would select \f[C]assets:aaa:checking\f[R].) | ||||||
| .PP | .PP | ||||||
| Any additional arguments form a query which will filter the transactions | Any additional arguments form a query which will filter the transactions | ||||||
| shown. | shown. | ||||||
| .PP | .PP | ||||||
|  | Each \f[C]aregister\f[R] line item shows: | ||||||
|  | .IP \[bu] 2 | ||||||
|  | the transaction\[aq]s date (or the relevant posting\[aq]s date if | ||||||
|  | different, see below) | ||||||
|  | .IP \[bu] 2 | ||||||
|  | the names of all the other account(s) involved in this transaction | ||||||
|  | (probably abbreviated) | ||||||
|  | .IP \[bu] 2 | ||||||
|  | the total change to this account\[aq]s balance from this transaction | ||||||
|  | .IP \[bu] 2 | ||||||
|  | the account\[aq]s historical running balance after this transaction. | ||||||
|  | .PP | ||||||
| Transactions making a net change of zero are not shown by default; add | Transactions making a net change of zero are not shown by default; add | ||||||
| the \f[C]-E/--empty\f[R] flag to show them. | the \f[C]-E/--empty\f[R] flag to show them. | ||||||
| .PP | .PP | ||||||
|  | \f[C]aregister\f[R] ignores a depth limit, so its final total will | ||||||
|  | always match a balance report with similar arguments. | ||||||
|  | .PP | ||||||
| This command also supports the output destination and output format | This command also supports the output destination and output format | ||||||
| options The output formats supported are \f[C]txt\f[R], \f[C]csv\f[R], | options The output formats supported are \f[C]txt\f[R], \f[C]csv\f[R], | ||||||
| and \f[C]json\f[R]. | and \f[C]json\f[R]. | ||||||
| @ -2534,157 +2553,6 @@ the sum of the top-level balances, not of all the balances shown. | |||||||
| .PP | .PP | ||||||
| Each group of sibling accounts is sorted separately, by declaration | Each group of sibling accounts is sorted separately, by declaration | ||||||
| order and then by account name. | order and then by account name. | ||||||
| .SS Customising single-period balance reports |  | ||||||
| .PP |  | ||||||
| You can customise the layout of single-period balance reports with |  | ||||||
| \f[C]--format FMT\f[R], which sets the format of each line. |  | ||||||
| Eg: |  | ||||||
| .IP |  | ||||||
| .nf |  | ||||||
| \f[C] |  | ||||||
| $ hledger balance --format \[dq]%20(account) %12(total)\[dq] |  | ||||||
|               assets          $-1 |  | ||||||
|          bank:saving           $1 |  | ||||||
|                 cash          $-2 |  | ||||||
|             expenses           $2 |  | ||||||
|                 food           $1 |  | ||||||
|             supplies           $1 |  | ||||||
|               income          $-2 |  | ||||||
|                gifts          $-1 |  | ||||||
|               salary          $-1 |  | ||||||
|    liabilities:debts           $1 |  | ||||||
| --------------------------------- |  | ||||||
|                                 0 |  | ||||||
| \f[R] |  | ||||||
| .fi |  | ||||||
| .PP |  | ||||||
| The FMT format string (plus a newline) specifies the formatting applied |  | ||||||
| to each account/balance pair. |  | ||||||
| It may contain any suitable text, with data fields interpolated like so: |  | ||||||
| .PP |  | ||||||
| \f[C]%[MIN][.MAX](FIELDNAME)\f[R] |  | ||||||
| .IP \[bu] 2 |  | ||||||
| MIN pads with spaces to at least this width (optional) |  | ||||||
| .IP \[bu] 2 |  | ||||||
| MAX truncates at this width (optional) |  | ||||||
| .IP \[bu] 2 |  | ||||||
| FIELDNAME must be enclosed in parentheses, and can be one of: |  | ||||||
| .RS 2 |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]depth_spacer\f[R] - a number of spaces equal to the account\[aq]s |  | ||||||
| depth, or if MIN is specified, MIN * depth spaces. |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]account\f[R] - the account\[aq]s name |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]total\f[R] - the account\[aq]s balance/posted total, right |  | ||||||
| justified |  | ||||||
| .RE |  | ||||||
| .PP |  | ||||||
| Also, FMT can begin with an optional prefix to control how |  | ||||||
| multi-commodity amounts are rendered: |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]%_\f[R] - render on multiple lines, bottom-aligned (the default) |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]%\[ha]\f[R] - render on multiple lines, top-aligned |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]%,\f[R] - render on one line, comma-separated |  | ||||||
| .PP |  | ||||||
| There are some quirks. |  | ||||||
| Eg in one-line mode, \f[C]%(depth_spacer)\f[R] has no effect, instead |  | ||||||
| \f[C]%(account)\f[R] has indentation built in. |  | ||||||
| Experimentation may be needed to get pleasing results. |  | ||||||
| .PP |  | ||||||
| Some example formats: |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]%(total)\f[R] - the account\[aq]s total |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]%-20.20(account)\f[R] - the account\[aq]s name, left justified, |  | ||||||
| padded to 20 characters and clipped at 20 characters |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]%,%-50(account)  %25(total)\f[R] - account name padded to 50 |  | ||||||
| characters, total padded to 20 characters, with multiple commodities |  | ||||||
| rendered on one line |  | ||||||
| .IP \[bu] 2 |  | ||||||
| \f[C]%20(total)  %2(depth_spacer)%-(account)\f[R] - the default format |  | ||||||
| for the single-column balance report |  | ||||||
| .SS Depth limiting |  | ||||||
| .PP |  | ||||||
| With a \f[C]depth:N\f[R] query, or \f[C]--depth N\f[R] option, or just |  | ||||||
| \f[C]-N\f[R], balance reports will show accounts only to the specified |  | ||||||
| depth. |  | ||||||
| This is very useful to hide low-level accounts and get an overview. |  | ||||||
| Eg, limiting to depth 1 shows the top-level accounts: |  | ||||||
| .IP |  | ||||||
| .nf |  | ||||||
| \f[C] |  | ||||||
| $ hledger balance -N -1 |  | ||||||
|                  $-1  assets |  | ||||||
|                   $2  expenses |  | ||||||
|                  $-2  income |  | ||||||
|                   $1  liabilities |  | ||||||
| \f[R] |  | ||||||
| .fi |  | ||||||
| .PP |  | ||||||
| Accounts at the depth limit will include the balances of any hidden |  | ||||||
| subaccounts (even in flat mode, which normally shows exclusive |  | ||||||
| balances). |  | ||||||
| .PP |  | ||||||
| You can also drop account name components from the start of account |  | ||||||
| names, using \f[C]--drop N\f[R]. |  | ||||||
| This can be useful to hide unwanted top-level detail. |  | ||||||
| .SS Colour support |  | ||||||
| .PP |  | ||||||
| In terminal output, when colour is enabled, the balance command shows |  | ||||||
| negative amounts in red. |  | ||||||
| .SS Sorting by amount |  | ||||||
| .PP |  | ||||||
| With \f[C]-S\f[R]/\f[C]--sort-amount\f[R], accounts with the largest |  | ||||||
| (most positive) balances are shown first. |  | ||||||
| For example, \f[C]hledger bal expenses -MAS\f[R] shows your biggest |  | ||||||
| averaged monthly expenses first. |  | ||||||
| .PP |  | ||||||
| Revenues and liability balances are typically negative, however, so |  | ||||||
| \f[C]-S\f[R] shows these in reverse order. |  | ||||||
| To work around this, you can add \f[C]--invert\f[R] to flip the signs. |  | ||||||
| Or, use one of the sign-flipping reports like \f[C]balancesheet\f[R] or |  | ||||||
| \f[C]incomestatement\f[R], which also support \f[C]-S\f[R]. |  | ||||||
| Eg: \f[C]hledger is -MAS\f[R]. |  | ||||||
| .SS Percentages |  | ||||||
| .PP |  | ||||||
| With \f[C]-%\f[R] or \f[C]--percent\f[R], balance reports show each |  | ||||||
| account\[aq]s value expressed as a percentage of the column\[aq]s total. |  | ||||||
| This is useful to get an overview of the relative sizes of account |  | ||||||
| balances. |  | ||||||
| For example to obtain an overview of expenses: |  | ||||||
| .IP |  | ||||||
| .nf |  | ||||||
| \f[C] |  | ||||||
| $ hledger balance expenses -% |  | ||||||
|              100.0 %  expenses |  | ||||||
|               50.0 %    food |  | ||||||
|               50.0 %    supplies |  | ||||||
| -------------------- |  | ||||||
|              100.0 % |  | ||||||
| \f[R] |  | ||||||
| .fi |  | ||||||
| .PP |  | ||||||
| Note that \f[C]--tree\f[R] does not have an effect on \f[C]-%\f[R]. |  | ||||||
| The percentages are always relative to the total sum of each column, |  | ||||||
| they are never relative to the parent account. |  | ||||||
| .PP |  | ||||||
| Since the percentages are relative to the columns sum, it is usually not |  | ||||||
| useful to calculate percentages if the signs of the amounts are mixed. |  | ||||||
| Although the results are technically correct, they are most likely |  | ||||||
| useless. |  | ||||||
| Especially in a balance report that sums up to zero (eg |  | ||||||
| \f[C]hledger balance -B\f[R]) all percentage values will be zero. |  | ||||||
| .PP |  | ||||||
| This flag does not work if the report contains any mixed commodity |  | ||||||
| accounts. |  | ||||||
| If there are mixed commodity accounts in the report be sure to use |  | ||||||
| \f[C]-V\f[R] or \f[C]-B\f[R] to coerce the report into using a single |  | ||||||
| commodity. |  | ||||||
| .PP |  | ||||||
| .SS Multi-period balance report | .SS Multi-period balance report | ||||||
| .PP | .PP | ||||||
| Multi-period balance reports are a very useful hledger feature, | Multi-period balance reports are a very useful hledger feature, | ||||||
| @ -2827,14 +2695,166 @@ the width of multicommodity reports. | |||||||
| When the report is still too wide, a good workaround is to pipe it into | When the report is still too wide, a good workaround is to pipe it into | ||||||
| \f[C]less -RS\f[R] (-R for colour, -S to chop long lines). | \f[C]less -RS\f[R] (-R for colour, -S to chop long lines). | ||||||
| Eg: \f[C]hledger bal -D --color=yes | less -RS\f[R]. | Eg: \f[C]hledger bal -D --color=yes | less -RS\f[R]. | ||||||
|  | .SS Depth limiting | ||||||
|  | .PP | ||||||
|  | With a \f[C]depth:N\f[R] query, or \f[C]--depth N\f[R] option, or just | ||||||
|  | \f[C]-N\f[R], balance reports will show accounts only to the specified | ||||||
|  | depth. | ||||||
|  | This is very useful to hide low-level accounts and get an overview. | ||||||
|  | Eg, limiting to depth 1 shows the top-level accounts: | ||||||
|  | .IP | ||||||
|  | .nf | ||||||
|  | \f[C] | ||||||
|  | $ hledger balance -N -1 | ||||||
|  |                  $-1  assets | ||||||
|  |                   $2  expenses | ||||||
|  |                  $-2  income | ||||||
|  |                   $1  liabilities | ||||||
|  | \f[R] | ||||||
|  | .fi | ||||||
|  | .PP | ||||||
|  | Accounts at the depth limit will include the balances of any hidden | ||||||
|  | subaccounts (even in flat mode, which normally shows exclusive | ||||||
|  | balances). | ||||||
|  | .PP | ||||||
|  | You can also drop account name components from the start of account | ||||||
|  | names, using \f[C]--drop N\f[R]. | ||||||
|  | This can be useful to hide unwanted top-level detail. | ||||||
|  | .SS Colour support | ||||||
|  | .PP | ||||||
|  | In terminal output, when colour is enabled, the balance command shows | ||||||
|  | negative amounts in red. | ||||||
|  | .SS Sorting by amount | ||||||
|  | .PP | ||||||
|  | With \f[C]-S\f[R]/\f[C]--sort-amount\f[R], accounts with the largest | ||||||
|  | (most positive) balances are shown first. | ||||||
|  | For example, \f[C]hledger bal expenses -MAS\f[R] shows your biggest | ||||||
|  | averaged monthly expenses first. | ||||||
|  | .PP | ||||||
|  | Revenues and liability balances are typically negative, however, so | ||||||
|  | \f[C]-S\f[R] shows these in reverse order. | ||||||
|  | To work around this, you can add \f[C]--invert\f[R] to flip the signs. | ||||||
|  | Or, use one of the sign-flipping reports like \f[C]balancesheet\f[R] or | ||||||
|  | \f[C]incomestatement\f[R], which also support \f[C]-S\f[R]. | ||||||
|  | Eg: \f[C]hledger is -MAS\f[R]. | ||||||
|  | .SS Percentages | ||||||
|  | .PP | ||||||
|  | With \f[C]-%\f[R] or \f[C]--percent\f[R], balance reports show each | ||||||
|  | account\[aq]s value expressed as a percentage of the column\[aq]s total. | ||||||
|  | This is useful to get an overview of the relative sizes of account | ||||||
|  | balances. | ||||||
|  | For example to obtain an overview of expenses: | ||||||
|  | .IP | ||||||
|  | .nf | ||||||
|  | \f[C] | ||||||
|  | $ hledger balance expenses -% | ||||||
|  |              100.0 %  expenses | ||||||
|  |               50.0 %    food | ||||||
|  |               50.0 %    supplies | ||||||
|  | -------------------- | ||||||
|  |              100.0 % | ||||||
|  | \f[R] | ||||||
|  | .fi | ||||||
|  | .PP | ||||||
|  | Note that \f[C]--tree\f[R] does not have an effect on \f[C]-%\f[R]. | ||||||
|  | The percentages are always relative to the total sum of each column, | ||||||
|  | they are never relative to the parent account. | ||||||
|  | .PP | ||||||
|  | Since the percentages are relative to the columns sum, it is usually not | ||||||
|  | useful to calculate percentages if the signs of the amounts are mixed. | ||||||
|  | Although the results are technically correct, they are most likely | ||||||
|  | useless. | ||||||
|  | Especially in a balance report that sums up to zero (eg | ||||||
|  | \f[C]hledger balance -B\f[R]) all percentage values will be zero. | ||||||
|  | .PP | ||||||
|  | This flag does not work if the report contains any mixed commodity | ||||||
|  | accounts. | ||||||
|  | If there are mixed commodity accounts in the report be sure to use | ||||||
|  | \f[C]-V\f[R] or \f[C]-B\f[R] to coerce the report into using a single | ||||||
|  | commodity. | ||||||
|  | .PP | ||||||
|  | .SS Customising single-period balance reports | ||||||
|  | .PP | ||||||
|  | You can customise the layout of single-period balance reports with | ||||||
|  | \f[C]--format FMT\f[R], which sets the format of each line. | ||||||
|  | Eg: | ||||||
|  | .IP | ||||||
|  | .nf | ||||||
|  | \f[C] | ||||||
|  | $ hledger balance --format \[dq]%20(account) %12(total)\[dq] | ||||||
|  |               assets          $-1 | ||||||
|  |          bank:saving           $1 | ||||||
|  |                 cash          $-2 | ||||||
|  |             expenses           $2 | ||||||
|  |                 food           $1 | ||||||
|  |             supplies           $1 | ||||||
|  |               income          $-2 | ||||||
|  |                gifts          $-1 | ||||||
|  |               salary          $-1 | ||||||
|  |    liabilities:debts           $1 | ||||||
|  | --------------------------------- | ||||||
|  |                                 0 | ||||||
|  | \f[R] | ||||||
|  | .fi | ||||||
|  | .PP | ||||||
|  | The FMT format string (plus a newline) specifies the formatting applied | ||||||
|  | to each account/balance pair. | ||||||
|  | It may contain any suitable text, with data fields interpolated like so: | ||||||
|  | .PP | ||||||
|  | \f[C]%[MIN][.MAX](FIELDNAME)\f[R] | ||||||
|  | .IP \[bu] 2 | ||||||
|  | MIN pads with spaces to at least this width (optional) | ||||||
|  | .IP \[bu] 2 | ||||||
|  | MAX truncates at this width (optional) | ||||||
|  | .IP \[bu] 2 | ||||||
|  | FIELDNAME must be enclosed in parentheses, and can be one of: | ||||||
|  | .RS 2 | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]depth_spacer\f[R] - a number of spaces equal to the account\[aq]s | ||||||
|  | depth, or if MIN is specified, MIN * depth spaces. | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]account\f[R] - the account\[aq]s name | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]total\f[R] - the account\[aq]s balance/posted total, right | ||||||
|  | justified | ||||||
|  | .RE | ||||||
|  | .PP | ||||||
|  | Also, FMT can begin with an optional prefix to control how | ||||||
|  | multi-commodity amounts are rendered: | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]%_\f[R] - render on multiple lines, bottom-aligned (the default) | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]%\[ha]\f[R] - render on multiple lines, top-aligned | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]%,\f[R] - render on one line, comma-separated | ||||||
|  | .PP | ||||||
|  | There are some quirks. | ||||||
|  | Eg in one-line mode, \f[C]%(depth_spacer)\f[R] has no effect, instead | ||||||
|  | \f[C]%(account)\f[R] has indentation built in. | ||||||
|  | Experimentation may be needed to get pleasing results. | ||||||
|  | .PP | ||||||
|  | Some example formats: | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]%(total)\f[R] - the account\[aq]s total | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]%-20.20(account)\f[R] - the account\[aq]s name, left justified, | ||||||
|  | padded to 20 characters and clipped at 20 characters | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]%,%-50(account)  %25(total)\f[R] - account name padded to 50 | ||||||
|  | characters, total padded to 20 characters, with multiple commodities | ||||||
|  | rendered on one line | ||||||
|  | .IP \[bu] 2 | ||||||
|  | \f[C]%20(total)  %2(depth_spacer)%-(account)\f[R] - the default format | ||||||
|  | for the single-column balance report | ||||||
| .SS Budget report | .SS Budget report | ||||||
| .PP | .PP | ||||||
| With \f[C]--budget\f[R], extra columns are displayed showing budget | There is also a special balance report mode for showing budget | ||||||
|  | performance. | ||||||
|  | The \f[C]--budget\f[R] flag activates extra columns showing the budget | ||||||
| goals for each account and period, if any. | goals for each account and period, if any. | ||||||
| Budget goals are defined by periodic transactions. | For this report, budget goals are defined by periodic transactions. | ||||||
| This is very useful for comparing planned and actual income, expenses, | This is very useful for comparing planned and actual income, expenses, | ||||||
| time usage, etc. | time usage, etc. | ||||||
| --budget is most often combined with a report interval. |  | ||||||
| .PP | .PP | ||||||
| For example, you can take average monthly expenses in the common expense | For example, you can take average monthly expenses in the common expense | ||||||
| categories to construct a minimal monthly budget: | categories to construct a minimal monthly budget: | ||||||
| @ -3783,12 +3803,16 @@ payees | |||||||
| .PD | .PD | ||||||
| List the unique payee/payer names that appear in transactions. | List the unique payee/payer names that appear in transactions. | ||||||
| .PP | .PP | ||||||
| This command lists the unique payee/payer names that appear in | This command lists unique payee/payer names which have been declared | ||||||
| transactions, in alphabetic order. | with payee directives (--declared), used in transaction descriptions | ||||||
| You can add a query to select a subset of transactions. | (--used), or both (the default). | ||||||
|  | .PP | ||||||
| The payee/payer is the part of the transaction description before a | | The payee/payer is the part of the transaction description before a | | ||||||
| character (or if there is no |, the whole description). | character (or if there is no |, the whole description). | ||||||
| .PP | .PP | ||||||
|  | You can add query arguments to select a subset of transactions. | ||||||
|  | This implies --used. | ||||||
|  | .PP | ||||||
| Example: | Example: | ||||||
| .IP | .IP | ||||||
| .nf | .nf | ||||||
| @ -3823,9 +3847,20 @@ Show transaction journal entries, sorted by date. | |||||||
| The print command displays full journal entries (transactions) from the | The print command displays full journal entries (transactions) from the | ||||||
| journal file, sorted by date (or with \f[C]--date2\f[R], by secondary | journal file, sorted by date (or with \f[C]--date2\f[R], by secondary | ||||||
| date). | date). | ||||||
|  | .PP | ||||||
|  | Amounts are shown mostly normalised to commodity display style, eg the | ||||||
|  | placement of commodity symbols will be consistent. | ||||||
|  | All of their decimal places are shown, as in the original journal entry | ||||||
|  | (with one alteration: in some cases trailing zeroes are added.) | ||||||
|  | .PP | ||||||
| Amounts are shown right-aligned within each transaction (but not across | Amounts are shown right-aligned within each transaction (but not across | ||||||
| all transactions). | all transactions). | ||||||
| Directives and inter-transaction comments are not shown. | .PP | ||||||
|  | Directives and inter-transaction comments are not shown, currently. | ||||||
|  | This means the print command is somewhat lossy, and if you are using it | ||||||
|  | to reformat your journal you should take care to also copy over the | ||||||
|  | directives and file-level comments. | ||||||
|  | .PP | ||||||
| Eg: | Eg: | ||||||
| .IP | .IP | ||||||
| .nf | .nf | ||||||
| @ -3869,9 +3904,6 @@ $ hledger print assets:cash | hledger -f- -I reg expenses:food | |||||||
| There are some situations where print\[aq]s output can become | There are some situations where print\[aq]s output can become | ||||||
| unparseable: | unparseable: | ||||||
| .IP \[bu] 2 | .IP \[bu] 2 | ||||||
| Rounding amounts according to commodity display styles can cause |  | ||||||
| transactions to appear unbalanced. |  | ||||||
| .IP \[bu] 2 |  | ||||||
| Valuation affects posting amounts but not balance assertion or balance | Valuation affects posting amounts but not balance assertion or balance | ||||||
| assignment amounts, potentially causing those to fail. | assignment amounts, potentially causing those to fail. | ||||||
| .IP \[bu] 2 | .IP \[bu] 2 | ||||||
| @ -5305,6 +5337,7 @@ Scientific E notation is allowed: | |||||||
| EUR 1E3 | EUR 1E3 | ||||||
| \f[R] | \f[R] | ||||||
| .fi | .fi | ||||||
|  | .SS Decimal marks, digit group marks | ||||||
| .PP | .PP | ||||||
| A decimal mark can be written as a period or a comma: | A decimal mark can be written as a period or a comma: | ||||||
| .IP | .IP | ||||||
| @ -5314,7 +5347,6 @@ A decimal mark can be written as a period or a comma: | |||||||
| 1,23456780000009 | 1,23456780000009 | ||||||
| \f[R] | \f[R] | ||||||
| .fi | .fi | ||||||
| .SS Digit group marks |  | ||||||
| .PP | .PP | ||||||
| In the integer part of the quantity (left of the decimal mark), groups | In the integer part of the quantity (left of the decimal mark), groups | ||||||
| of digits can optionally be separated by a \[dq]digit group mark\[dq] - | of digits can optionally be separated by a \[dq]digit group mark\[dq] - | ||||||
| @ -5329,9 +5361,9 @@ INR 9,99,99,999.00 | |||||||
| \f[R] | \f[R] | ||||||
| .fi | .fi | ||||||
| .PP | .PP | ||||||
| Note, a number containing a single group mark and no decimal mark is | Note, a number containing a single digit group mark and no decimal mark | ||||||
| ambiguous. | is ambiguous. | ||||||
| Are these group marks or decimal marks ? | Are these digit group marks or decimal marks ? | ||||||
| .IP | .IP | ||||||
| .nf | .nf | ||||||
| \f[C] | \f[C] | ||||||
| @ -5340,15 +5372,16 @@ Are these group marks or decimal marks ? | |||||||
| \f[R] | \f[R] | ||||||
| .fi | .fi | ||||||
| .PP | .PP | ||||||
| hledger will treat them both as decimal marks by default (cf #793). | If you don\[aq]t tell it otherwise, hledger will assume both of the | ||||||
| If you use digit group marks, to prevent confusion and undetected typos | above are decimal marks, parsing both numbers as 1. | ||||||
| we recommend you write commodity directives at the top of the file to | To prevent confusion and undetected typos, especially if your data | ||||||
| explicitly declare the decimal mark (and optionally a digit group mark). | contains digit group marks, we recommend you explicitly declare the | ||||||
| Note, these formats (\[dq]amount styles\[dq]) are specific to each | decimal mark (and optionally a digit group mark), for each commodity, | ||||||
| commodity, so if your data uses multiple formats, hledger can handle it: | using \f[C]commodity\f[R] directives (described below): | ||||||
| .IP | .IP | ||||||
| .nf | .nf | ||||||
| \f[C] | \f[C] | ||||||
|  | # number formats for $, EUR, INR and the no-symbol commodity: | ||||||
| commodity $1,000.00 | commodity $1,000.00 | ||||||
| commodity EUR 1.000,00 | commodity EUR 1.000,00 | ||||||
| commodity INR 9,99,99,999.00 | commodity INR 9,99,99,999.00 | ||||||
| @ -5356,23 +5389,38 @@ commodity       1 000 000.9455 | |||||||
| \f[R] | \f[R] | ||||||
| .fi | .fi | ||||||
| .PP | .PP | ||||||
|  | Note, \f[C]commodity\f[R] directives declare both the number format for | ||||||
|  | parsing input, and the display style for showing output. | ||||||
|  | For the former, they are position-sensitive, affecting only following | ||||||
|  | amounts, so commodity directives should be at the top of your journal | ||||||
|  | file. | ||||||
|  | This is discussed more on #793. | ||||||
|  | .PP | ||||||
| .SS Commodity display style | .SS Commodity display style | ||||||
| .PP | .PP | ||||||
| For the amounts in each commodity, hledger chooses a consistent display | For the amounts in each commodity, hledger chooses a consistent display | ||||||
| style. | style to use in most reports. | ||||||
| (Excluding price amounts, which are always displayed as written). | (Except for price amounts, which are always displayed as written). | ||||||
| The display style is chosen as follows: | The display style is inferred as follows. | ||||||
| .IP \[bu] 2 |  | ||||||
| If there is a commodity directive (or default commodity directive) for |  | ||||||
| the commodity, its style is used (see examples above). |  | ||||||
| .IP \[bu] 2 |  | ||||||
| Otherwise the style is inferred from the amounts in that commodity seen |  | ||||||
| in the journal. |  | ||||||
| .IP \[bu] 2 |  | ||||||
| Or if there are no such amounts in the journal, a default style is used |  | ||||||
| (like \f[C]$1000.00\f[R]). |  | ||||||
| .PP | .PP | ||||||
| A style is inferred from the journal amounts in a commodity as follows: | First, if a default commodity is declared with \f[C]D\f[R], this | ||||||
|  | commodity and its style is applied to any no-symbol amounts in the | ||||||
|  | journal. | ||||||
|  | .PP | ||||||
|  | Then each commodity\[aq]s style is inferred from one of the following, | ||||||
|  | in order of preference: | ||||||
|  | .IP \[bu] 2 | ||||||
|  | The commodity directive for that commodity (including the no-symbol | ||||||
|  | commodity), if any. | ||||||
|  | .IP \[bu] 2 | ||||||
|  | The amounts in that commodity seen in the journal\[aq]s transactions. | ||||||
|  | (Posting amounts only; prices and periodic or auto rules are ignored, | ||||||
|  | currently.) | ||||||
|  | .IP \[bu] 2 | ||||||
|  | The built-in fallback style, which looks like this: \f[C]$1000.00\f[R]. | ||||||
|  | (Symbol on the left, period decimal mark, two decimal places.) | ||||||
|  | .PP | ||||||
|  | A style is inferred from journal amounts as follows: | ||||||
| .IP \[bu] 2 | .IP \[bu] 2 | ||||||
| Use the general style (decimal mark, symbol placement) of the first | Use the general style (decimal mark, symbol placement) of the first | ||||||
| amount | amount | ||||||
| @ -5388,25 +5436,22 @@ posting\[aq]s amount is inferred using a transaction price). | |||||||
| If you find this causing problems, use a commodity directive to fix the | If you find this causing problems, use a commodity directive to fix the | ||||||
| display style. | display style. | ||||||
| .PP | .PP | ||||||
| In summary, each commodity\[aq]s amounts will be normalised to | To summarise: each commodity\[aq]s amounts will be normalised to (a) the | ||||||
| .IP \[bu] 2 | style declared by a \f[C]commodity\f[R] directive, or (b) the style of | ||||||
| the style declared by a \f[C]commodity\f[R] directive | the first posting amount in the journal, with the first-seen digit group | ||||||
| .IP \[bu] 2 | style and the maximum-seen number of decimal places. | ||||||
| or, the style of the first posting amount in the journal, with the |  | ||||||
| first-seen digit group style and the maximum-seen number of decimal |  | ||||||
| places. |  | ||||||
| .PP |  | ||||||
| So if your reports are showing amounts in a way you don\[aq]t like, eg | So if your reports are showing amounts in a way you don\[aq]t like, eg | ||||||
| with too many decimal places, use a commodity directive to set the | with too many decimal places, use a commodity directive. | ||||||
| commodity\[aq]s display style. | Some examples: | ||||||
| For example: |  | ||||||
| .IP | .IP | ||||||
| .nf | .nf | ||||||
| \f[C] | \f[C] | ||||||
| # declare euro, dollar and bitcoin commodities and set their display styles: | # declare euro, dollar, bitcoin and no-symbol commodities and set their  | ||||||
|  | # input number formats and output display styles: | ||||||
| commodity EUR 1.000, | commodity EUR 1.000, | ||||||
| commodity $1000.00 | commodity $1000.00 | ||||||
| commodity 1000.00000000 BTC | commodity 1000.00000000 BTC | ||||||
|  | commodity 1 000. | ||||||
| \f[R] | \f[R] | ||||||
| .fi | .fi | ||||||
| .SS Rounding | .SS Rounding | ||||||
| @ -8235,6 +8280,14 @@ amount %amt %cur | |||||||
| Note we used a temporary field name (\f[C]cur\f[R]) that is not | Note we used a temporary field name (\f[C]cur\f[R]) that is not | ||||||
| \f[C]currency\f[R] - that would trigger the prepending effect, which we | \f[C]currency\f[R] - that would trigger the prepending effect, which we | ||||||
| don\[aq]t want here. | don\[aq]t want here. | ||||||
|  | .SS Amount decimal places | ||||||
|  | .PP | ||||||
|  | Like amounts in a journal file, the amounts generated by CSV rules like | ||||||
|  | \f[C]amount1\f[R] influence commodity display styles, such as the number | ||||||
|  | of decimal places displayed in reports. | ||||||
|  | .PP | ||||||
|  | The original amounts as written in the CSV file do not affect display | ||||||
|  | style (because we don\[aq]t yet reliably know their commodity). | ||||||
| .SS Referencing other fields | .SS Referencing other fields | ||||||
| .PP | .PP | ||||||
| In field assignments, you can interpolate only CSV fields, not hledger | In field assignments, you can interpolate only CSV fields, not hledger | ||||||
|  | |||||||
							
								
								
									
										4434
									
								
								hledger/hledger.info
									
									
									
									
									
								
							
							
						
						
									
										4434
									
								
								hledger/hledger.info
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1297
									
								
								hledger/hledger.txt
									
									
									
									
									
								
							
							
						
						
									
										1297
									
								
								hledger/hledger.txt
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user