;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] | ||||
| convert amounts to cost or market value, more flexibly than -B/-V/-X | ||||
| .TP | ||||
| \f[B]\f[CB]--infer-value\f[B]\f[R] | ||||
| with -V/-X/--value, also infer market prices from transactions | ||||
| \f[B]\f[CB]--infer-market-prices\f[B]\f[R] | ||||
| use transaction prices (recorded with \[at] or \[at]\[at]) as additional | ||||
| market prices, as if they were P directives | ||||
| .TP | ||||
| \f[B]\f[CB]--auto\f[B]\f[R] | ||||
| 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) | ||||
| ************* | ||||
| @ -9,8 +10,8 @@ hledger-ui(1) | ||||
| hledger-ui is a terminal interface (TUI) for the hledger accounting | ||||
| 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 | ||||
| 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. | ||||
| 
 | ||||
|    Like hledger, it reads data from one or more files in hledger | ||||
| journal, timeclock, timedot, or CSV format specified with '-f', or | ||||
| '$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps | ||||
| 'C:/Users/USER/.hledger.journal').  For more about this see hledger(1), | ||||
| journal, timeclock, timedot, or CSV format specified with `-f', or | ||||
| `$LEDGER_FILE', or `$HOME/.hledger.journal' (on windows, perhaps | ||||
| `C:/Users/USER/.hledger.journal'). For more about this see hledger(1), | ||||
| hledger_journal(5) etc. | ||||
| 
 | ||||
|    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 | ||||
| ********* | ||||
| 
 | ||||
| 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. | ||||
| 
 | ||||
|    Any QUERYARGS are interpreted as a hledger search query which filters | ||||
| the data. | ||||
| 
 | ||||
| '--watch' | ||||
| 
 | ||||
| `--watch' | ||||
|      watch for data and date changes and reload automatically | ||||
| '--theme=default|terminal|greenterm' | ||||
| 
 | ||||
| `--theme=default|terminal|greenterm' | ||||
|      use this custom display theme | ||||
| '--register=ACCTREGEX' | ||||
| 
 | ||||
| `--register=ACCTREGEX' | ||||
|      start in the (first) matched account's register screen | ||||
| '--change' | ||||
| 
 | ||||
| `--change' | ||||
|      show period balances (changes) at startup instead of historical | ||||
|      balances | ||||
| '-l --flat' | ||||
| 
 | ||||
| `-l --flat' | ||||
|      show accounts as a flat list (default) | ||||
| '-t --tree' | ||||
| 
 | ||||
| `-t --tree' | ||||
|      show accounts as a tree | ||||
| 
 | ||||
|    hledger input options: | ||||
| 
 | ||||
| '-f FILE --file=FILE' | ||||
| 
 | ||||
| `-f FILE --file=FILE' | ||||
|      use a different input file. For stdin, use - (default: | ||||
|      '$LEDGER_FILE' or '$HOME/.hledger.journal') | ||||
| '--rules-file=RULESFILE' | ||||
|      `$LEDGER_FILE' or `$HOME/.hledger.journal') | ||||
| 
 | ||||
| `--rules-file=RULESFILE' | ||||
|      Conversion rules file to use when reading CSV (default: FILE.rules) | ||||
| '--separator=CHAR' | ||||
| 
 | ||||
| `--separator=CHAR' | ||||
|      Field separator to expect when reading CSV (default: ',') | ||||
| '--alias=OLD=NEW' | ||||
| 
 | ||||
| `--alias=OLD=NEW' | ||||
|      rename accounts named OLD to NEW | ||||
| '--anon' | ||||
| 
 | ||||
| `--anon' | ||||
|      anonymize accounts and payees | ||||
| '--pivot FIELDNAME' | ||||
| 
 | ||||
| `--pivot FIELDNAME' | ||||
|      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 | ||||
|      assignments) | ||||
| '-s --strict' | ||||
| 
 | ||||
| `-s --strict' | ||||
|      do extra error checking (check that all posted accounts are | ||||
|      declared) | ||||
| 
 | ||||
|    hledger reporting options: | ||||
| 
 | ||||
| '-b --begin=DATE' | ||||
| 
 | ||||
| `-b --begin=DATE' | ||||
|      include postings/txns on or after this date | ||||
| '-e --end=DATE' | ||||
| 
 | ||||
| `-e --end=DATE' | ||||
|      include postings/txns before this date | ||||
| '-D --daily' | ||||
| 
 | ||||
| `-D --daily' | ||||
|      multiperiod/multicolumn report by day | ||||
| '-W --weekly' | ||||
| 
 | ||||
| `-W --weekly' | ||||
|      multiperiod/multicolumn report by week | ||||
| '-M --monthly' | ||||
| 
 | ||||
| `-M --monthly' | ||||
|      multiperiod/multicolumn report by month | ||||
| '-Q --quarterly' | ||||
| 
 | ||||
| `-Q --quarterly' | ||||
|      multiperiod/multicolumn report by quarter | ||||
| '-Y --yearly' | ||||
| 
 | ||||
| `-Y --yearly' | ||||
|      multiperiod/multicolumn report by year | ||||
| '-p --period=PERIODEXP' | ||||
| 
 | ||||
| `-p --period=PERIODEXP' | ||||
|      set start date, end date, and/or reporting interval all at once | ||||
|      using period expressions syntax | ||||
| '--date2' | ||||
| 
 | ||||
| `--date2' | ||||
|      match the secondary date instead (see command help for other | ||||
|      effects) | ||||
| '-U --unmarked' | ||||
| 
 | ||||
| `-U --unmarked' | ||||
|      include only unmarked postings/txns (can combine with -P or -C) | ||||
| '-P --pending' | ||||
| 
 | ||||
| `-P --pending' | ||||
|      include only pending postings/txns | ||||
| '-C --cleared' | ||||
| 
 | ||||
| `-C --cleared' | ||||
|      include only cleared postings/txns | ||||
| '-R --real' | ||||
| 
 | ||||
| `-R --real' | ||||
|      include only non-virtual postings | ||||
| '-NUM --depth=NUM' | ||||
| 
 | ||||
| `-NUM --depth=NUM' | ||||
|      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 | ||||
|      hledger-ui/hledger-web) | ||||
| '-B --cost' | ||||
| 
 | ||||
| `-B --cost' | ||||
|      convert amounts to their cost/selling amount at transaction time | ||||
| '-V --market' | ||||
| 
 | ||||
| `-V --market' | ||||
|      convert amounts to their market value in default valuation | ||||
|      commodities | ||||
| '-X --exchange=COMM' | ||||
| 
 | ||||
| `-X --exchange=COMM' | ||||
|      convert amounts to their market value in commodity COMM | ||||
| '--value' | ||||
| 
 | ||||
| `--value' | ||||
|      convert amounts to cost or market value, more flexibly than | ||||
|      -B/-V/-X | ||||
| '--infer-value' | ||||
| 
 | ||||
|      with -V/-X/-value, also infer market prices from transactions | ||||
| '--auto' | ||||
| `--infer-market-prices' | ||||
|      use transaction prices (recorded with @ or @@) as additional market | ||||
|      prices, as if they were P directives | ||||
| 
 | ||||
| `--auto' | ||||
|      apply automated posting rules to modify transactions. | ||||
| '--forecast' | ||||
| 
 | ||||
| `--forecast' | ||||
|      generate future transactions from periodic transaction rules, for | ||||
|      the next 6 months or till report end date. In hledger-ui, also | ||||
|      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 | ||||
|      output.  'auto' (default): whenever stdout seems to be a | ||||
|      color-supporting terminal.  'always' or 'yes': always, useful eg | ||||
| @ -195,25 +194,24 @@ the last one takes precedence. | ||||
| 
 | ||||
|    hledger help options: | ||||
| 
 | ||||
| '-h --help' | ||||
| 
 | ||||
| `-h --help' | ||||
|      show general or COMMAND help | ||||
| '--man' | ||||
| 
 | ||||
| `--man' | ||||
|      show general or COMMAND user manual with man | ||||
| '--info' | ||||
| 
 | ||||
| `--info' | ||||
|      show general or COMMAND user manual with info | ||||
| '--version' | ||||
| 
 | ||||
| `--version' | ||||
|      show general or ADDONCMD version | ||||
| '--debug[=N]' | ||||
| 
 | ||||
| `--debug[=N]' | ||||
|      show debug output (levels 1-9, default: 1) | ||||
| 
 | ||||
|    A @FILE argument will be expanded to the contents of FILE, which | ||||
| 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 | ||||
| @ -221,15 +219,15 @@ File: hledger-ui.info,  Node: KEYS,  Next: SCREENS,  Prev: OPTIONS,  Up: Top | ||||
| 2 KEYS | ||||
| ****** | ||||
| 
 | ||||
| '?' 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 | ||||
| 'ESCAPE', or 'LEFT', or 'q') to close it.  The following keys work on | ||||
| `?' 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 | ||||
| `ESCAPE', or `LEFT', or `q') to close it. The following keys work on | ||||
| most screens: | ||||
| 
 | ||||
|    The cursor keys navigate: 'right' (or 'enter') goes deeper, 'left' | ||||
| returns to the previous screen, 'up'/'down'/'page up'/'page | ||||
| down'/'home'/'end' move up and down through lists.  Emacs-style | ||||
| ('ctrl-p'/'ctrl-n'/'ctrl-f'/'ctrl-b') movement keys are also supported | ||||
|    The cursor keys navigate: `right' (or `enter') goes deeper, `left' | ||||
| returns to the previous screen, `up'/`down'/`page up'/`page | ||||
| down'/`home'/`end' move up and down through lists. Emacs-style | ||||
| (`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 | ||||
| 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 | ||||
| @ -237,78 +235,78 @@ do that.) | ||||
| 
 | ||||
|    With shift pressed, the cursor keys adjust the report period, | ||||
| 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, | ||||
| 'shift-left/right' moves to the previous/next period.  'T' sets the | ||||
| report period to today.  With the '--watch' option, when viewing a | ||||
| `shift-left/right' moves to the previous/next period. `T' sets the | ||||
| report period to today. With the `--watch' option, when viewing a | ||||
| "current" period (the current day, week, month, quarter, or year), the | ||||
| 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 | ||||
| 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 | ||||
| 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 | ||||
| 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. | ||||
| 
 | ||||
|    As mentioned above, by default hledger-ui hides future transactions - | ||||
| 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. | ||||
| 
 | ||||
|    '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 | ||||
| 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 | ||||
| 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 | ||||
| pause.) | ||||
| 
 | ||||
|    'I' toggles balance assertion checking.  Disabling balance assertions | ||||
|    `I' toggles balance assertion checking. Disabling balance assertions | ||||
| 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. | ||||
| 
 | ||||
|    'A' is like 'a', but runs the hledger-iadd tool, which provides a | ||||
| terminal interface.  This key will be available if 'hledger-iadd' is | ||||
|    `A' is like `a', but runs the hledger-iadd tool, which provides a | ||||
| terminal interface. This key will be available if `hledger-iadd' is | ||||
| 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 | ||||
| cursor will be positioned at the current transaction when invoked from | ||||
| the register and transaction screens, and at the error location (if | ||||
| possible) when invoked from the error screen. | ||||
| 
 | ||||
|    'B' toggles cost mode, showing amounts in their transaction price's | ||||
| commodity (like toggling the '-B/--cost' flag). | ||||
|    `B' toggles cost mode, showing amounts in their transaction price's | ||||
| commodity (like toggling the `-B/--cost' flag). | ||||
| 
 | ||||
|    'V' toggles value mode, showing amounts' current market value in | ||||
| their default valuation commodity (like toggling the '-V/--market' | ||||
|    `V' toggles value mode, showing amounts' current market value in | ||||
| their default valuation commodity (like toggling the `-V/--market' | ||||
| flag). Note, "current market value" means the value on the report end | ||||
| 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 | ||||
| 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. | ||||
| 
 | ||||
|    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. | ||||
| 
 | ||||
|    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 | ||||
| will stop working.  To work around, press 'g' to force a manual reload, | ||||
|    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 | ||||
| will stop working. To work around, press `g' to force a manual reload, | ||||
| or exit the transaction screen. | ||||
| 
 | ||||
|    'q' quits the application. | ||||
|    `q' quits the application. | ||||
| 
 | ||||
|    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 | ||||
| =================== | ||||
| 
 | ||||
| This is normally the first screen displayed.  It lists accounts and | ||||
| their balances, like hledger's balance command.  By default, it shows | ||||
| all accounts and their latest ending balances (including the balances of | ||||
| This is normally the first screen displayed. It lists accounts and their | ||||
| balances, like hledger's balance command. By default, it shows all | ||||
| accounts and their latest ending balances (including the balances of | ||||
| subaccounts). If you specify a query on the command line, it shows just | ||||
| 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 | ||||
| subaccounts, except where subaccounts are hidden by a depth limit (see | ||||
| below).  In tree mode, all account balances are inclusive of | ||||
| subaccounts. | ||||
| below). In tree mode, all account balances are inclusive of subaccounts. | ||||
| 
 | ||||
|    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 less detail, collapsing all accounts to a single total. | ||||
| To remove the depth limit, set it higher than the maximum account depth, | ||||
| or press 'ESCAPE'. | ||||
|    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 less detail, collapsing all accounts to a single total. | ||||
| To remove the depth limit, set it higher than the maximum account | ||||
| 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 | ||||
| report period, taking into account all transactions before that date | ||||
| (filtered by the filter query if any), including transactions before the | ||||
| start of the report period.  In other words, historical balances are | ||||
| what you would see on a bank statement for that account (unless | ||||
| disturbed by a filter query).  Period balances ignore transactions | ||||
| 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. | ||||
| start of the report period. In other words, historical balances are what | ||||
| you would see on a bank statement for that account (unless disturbed by | ||||
| a filter query). Period balances ignore transactions 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. | ||||
| 
 | ||||
|    'U' toggles filtering by unmarked status, including or excluding | ||||
| unmarked postings in the balances.  Similarly, 'P' toggles pending | ||||
| postings, and 'C' toggles cleared postings.  (By default, balances | ||||
|    `U' toggles filtering by unmarked status, including or excluding | ||||
| unmarked postings in the balances. Similarly, `P' toggles pending | ||||
| postings, and `C' toggles cleared postings. (By default, balances | ||||
| include all postings; if you activate one or two status filters, only | ||||
| those postings are 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. | ||||
| 
 | ||||
|    '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 | ||||
| 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 | ||||
| @ -384,41 +381,43 @@ This screen shows the transactions affecting a particular account, like | ||||
| a check register. Each line represents one transaction and shows: | ||||
| 
 | ||||
|    * the other account(s) involved, in abbreviated form. (If there are | ||||
|      both real and virtual postings, it shows only the accounts affected | ||||
|      by real postings.) | ||||
|      both real and virtual postings, it shows only the accounts | ||||
|      affected by real postings.) | ||||
| 
 | ||||
|    * the overall change to the current account's balance; positive for | ||||
|      an inflow to this account, negative for an outflow. | ||||
| 
 | ||||
|    * the running historical total or period total for the current | ||||
|      account, after the transaction.  This can be toggled with 'H'. | ||||
|      Similar to the accounts screen, the historical total is affected by | ||||
|      transactions (filtered by the filter query) before the report start | ||||
|      date, while the period total is not.  If the historical total is | ||||
|      not disturbed by a filter query, it will be the running historical | ||||
|      balance you would see on a bank register for the current account. | ||||
|      account, after the transaction. This can be toggled with `H'. | ||||
|      Similar to the accounts screen, the historical total is affected | ||||
|      by transactions (filtered by the filter query) before the report | ||||
|      start date, while the period total is not. If the historical total | ||||
|      is not disturbed by a filter query, it will be the running | ||||
|      historical balance you would see on a bank register for the | ||||
|      current account. | ||||
| 
 | ||||
| 
 | ||||
|    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 | ||||
| mode but this account has subaccounts which are not shown due to a depth | ||||
| limit. In other words, the register always shows the transactions | ||||
| contributing to the balance shown on the accounts screen.  Tree | ||||
| mode/list mode can be toggled with 't' here also. | ||||
| contributing to the balance shown on the accounts screen. Tree mode/list | ||||
| mode can be toggled with `t' here also. | ||||
| 
 | ||||
|    'U' toggles filtering by unmarked status, showing or hiding unmarked | ||||
| transactions.  Similarly, 'P' toggles pending transactions, and 'C' | ||||
|    `U' toggles filtering by unmarked status, showing or hiding unmarked | ||||
| transactions. Similarly, `P' toggles pending transactions, and `C' | ||||
| toggles cleared transactions. (By default, transactions with all | ||||
| statuses are shown; if you activate one or two status filters, only | ||||
| those transactions are shown; 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. | ||||
| 
 | ||||
|    '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 | ||||
| command-line hledger). | ||||
| 
 | ||||
|    Press 'right' (or 'enter') to view the selected transaction in | ||||
|    Press `right' (or `enter') to view the selected transaction in | ||||
| 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 | ||||
| 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 | ||||
| parentheses show your position within that account register. They will | ||||
| 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. | ||||
| 
 | ||||
|    *LEDGER_FILE* The journal file path when not specified with '-f'. | ||||
| Default: '~/.hledger.journal' (on windows, perhaps | ||||
| 'C:/Users/USER/.hledger.journal'). | ||||
|    *LEDGER_FILE* The journal file path when not specified with `-f'. | ||||
| Default: `~/.hledger.journal' (on windows, perhaps | ||||
| `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 | ||||
| '~/DIR/current.journal', where current.journal is a symbolic link to | ||||
| `~/DIR/current.journal', where current.journal is a symbolic link to | ||||
| YYYY.journal. | ||||
| 
 | ||||
|    On Mac computers, you can set this and other environment variables in | ||||
| a more thorough way that also affects applications started from the GUI | ||||
| (say, an Emacs dock icon).  Eg on MacOS Catalina I have a | ||||
| '~/.MacOSX/environment.plist' file containing | ||||
|    On Mac computers, you can set this and other environment variables | ||||
| in a more thorough way that also affects applications started from the | ||||
| GUI (say, an Emacs dock icon). Eg on MacOS Catalina I have a | ||||
| `~/.MacOSX/environment.plist' file containing | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|   "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 | ||||
| @ -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, | ||||
| timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or | ||||
| '$HOME/.hledger.journal' (on windows, perhaps | ||||
| 'C:/Users/USER/.hledger.journal'). | ||||
| timedot, or CSV format specified with `-f', or `$LEDGER_FILE', or | ||||
| `$HOME/.hledger.journal' (on windows, perhaps | ||||
| `C:/Users/USER/.hledger.journal'). | ||||
| 
 | ||||
|  | ||||
| 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 | ||||
| ****** | ||||
| 
 | ||||
| The need to precede options with '--' when invoked from hledger is | ||||
| The need to precede options with `--' when invoked from hledger is | ||||
| 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 | ||||
| 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 | ||||
| times with an editor macro) can cause problems at least on OSX. Symptoms | ||||
| 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. | ||||
| 
 | ||||
|    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: | ||||
| Node: Top71 | ||||
| Node: OPTIONS1488 | ||||
| Ref: #options1585 | ||||
| Node: KEYS5768 | ||||
| Ref: #keys5863 | ||||
| Node: SCREENS10182 | ||||
| Ref: #screens10287 | ||||
| Node: Accounts screen10377 | ||||
| Ref: #accounts-screen10505 | ||||
| Node: Register screen12720 | ||||
| Ref: #register-screen12875 | ||||
| Node: Transaction screen14872 | ||||
| Ref: #transaction-screen15030 | ||||
| Node: Error screen15900 | ||||
| Ref: #error-screen16022 | ||||
| Node: ENVIRONMENT16266 | ||||
| Ref: #environment16380 | ||||
| Node: FILES17187 | ||||
| Ref: #files17286 | ||||
| Node: BUGS17499 | ||||
| Ref: #bugs17576 | ||||
| Node: Top82 | ||||
| Node: OPTIONS1478 | ||||
| Ref: #options1575 | ||||
| Node: KEYS5808 | ||||
| Ref: #keys5903 | ||||
| Node: SCREENS10199 | ||||
| Ref: #screens10304 | ||||
| Node: Accounts screen10394 | ||||
| Ref: #accounts-screen10522 | ||||
| Node: Register screen12726 | ||||
| Ref: #register-screen12881 | ||||
| Node: Transaction screen14876 | ||||
| Ref: #transaction-screen15034 | ||||
| Node: Error screen15901 | ||||
| Ref: #error-screen16023 | ||||
| Node: ENVIRONMENT16265 | ||||
| Ref: #environment16379 | ||||
| Node: FILES17184 | ||||
| Ref: #files17283 | ||||
| Node: BUGS17496 | ||||
| Ref: #bugs17573 | ||||
|  | ||||
| End Tag Table | ||||
|  | ||||
| @ -29,8 +29,8 @@ DESCRIPTION | ||||
|        C:/Users/USER/.hledger.journal).  For more about this  see  hledger(1), | ||||
|        hledger_journal(5) etc. | ||||
| 
 | ||||
|        Unlike  hledger,  hledger-ui hides all future-dated transactions by de- | ||||
|        fault.  They can be revealed, along with  any  rule-generated  periodic | ||||
|        Unlike  hledger,  hledger-ui  hides  all  future-dated  transactions by | ||||
|        default.  They can be revealed, along with any rule-generated  periodic | ||||
|        transactions,  by  pressing  the F key (or starting with --forecast) to | ||||
|        enable "forecast mode". | ||||
| 
 | ||||
| @ -86,8 +86,8 @@ OPTIONS | ||||
|               assignments) | ||||
| 
 | ||||
|        -s --strict | ||||
|               do extra error checking (check that all posted accounts are  de- | ||||
|               clared) | ||||
|               do extra error checking (check  that  all  posted  accounts  are | ||||
|               declared) | ||||
| 
 | ||||
|        hledger reporting options: | ||||
| 
 | ||||
| @ -117,8 +117,8 @@ OPTIONS | ||||
|               using period expressions syntax | ||||
| 
 | ||||
|        --date2 | ||||
|               match the secondary date instead (see command help for other ef- | ||||
|               fects) | ||||
|               match the secondary date instead (see  command  help  for  other | ||||
|               effects) | ||||
| 
 | ||||
|        -U --unmarked | ||||
|               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 | ||||
|               -B/-V/-X | ||||
| 
 | ||||
|        --infer-value | ||||
|               with -V/-X/--value, also infer market prices from transactions | ||||
|        --infer-market-prices | ||||
|               use  transaction  prices  (recorded  with @ or @@) as additional | ||||
|               market prices, as if they were P directives | ||||
| 
 | ||||
|        --auto apply automated posting rules to modify transactions. | ||||
| 
 | ||||
| @ -226,12 +227,12 @@ KEYS | ||||
| 
 | ||||
|        As mentioned above, by default hledger-ui hides future  transactions  - | ||||
|        both ordinary transactions recorded in the journal, and periodic trans- | ||||
|        actions generated by rule.  F  toggles  forecast  mode,  in  which  fu- | ||||
|        ture/forecasted transactions are shown. | ||||
|        actions  generated  by  rule.   F  toggles  forecast  mode,  in   which | ||||
|        future/forecasted transactions are shown. | ||||
| 
 | ||||
|        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- | ||||
|        try or the help dialog. | ||||
|        the app's initial state at startup.  Or,  it  cancels  minibuffer  data | ||||
|        entry or the help dialog. | ||||
| 
 | ||||
|        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 | ||||
| @ -292,14 +293,15 @@ SCREENS | ||||
| 
 | ||||
|        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- | ||||
|        counts, except where subaccounts are hidden by a depth limit  (see  be- | ||||
|        low).  In tree mode, all account balances are inclusive of subaccounts. | ||||
|        counts, except where subaccounts are  hidden  by  a  depth  limit  (see | ||||
|        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. | ||||
|        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 | ||||
|        depth limit, set it higher than the maximum account depth, or press ES- | ||||
|        CAPE. | ||||
|        depth  limit,  set  it  higher than the maximum account depth, or press | ||||
|        ESCAPE. | ||||
| 
 | ||||
|        H toggles between showing historical balances or period balances.  His- | ||||
|        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 | ||||
|        the start of the report period.  In other  words,  historical  balances | ||||
|        are  what  you  would  see on a bank statement for that account (unless | ||||
|        disturbed  by a filter query).  Period balances ignore transactions be- | ||||
|        fore the report start date, so they show the change in  balance  during | ||||
|        disturbed by a filter  query).   Period  balances  ignore  transactions | ||||
|        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. | ||||
| 
 | ||||
|        U toggles filtering by unmarked status, including or excluding unmarked | ||||
|        postings in the balances.  Similarly, P toggles pending postings, and C | ||||
|        toggles cleared postings.  (By default, balances include all  postings; | ||||
|        if you activate one or two status filters, only those postings are  in- | ||||
|        cluded; and if you activate all three, the filter is removed.) | ||||
|        if  you  activate  one  or  two status filters, only those postings are | ||||
|        included; and if you activate all three, the filter is removed.) | ||||
| 
 | ||||
|        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- | ||||
|        nal(5)). | ||||
| 
 | ||||
|        The transaction's date(s) and any cleared flag, transaction  code,  de- | ||||
|        scription,  comments, along with all of its account postings are shown. | ||||
|        Simple transactions have two postings, but there can  be  more  (or  in | ||||
|        certain cases, fewer). | ||||
|        The transaction's date(s)  and  any  cleared  flag,  transaction  code, | ||||
|        description,  comments,  along  with  all  of  its account postings are | ||||
|        shown.  Simple transactions have two postings, but there  can  be  more | ||||
|        (or in certain cases, fewer). | ||||
| 
 | ||||
|        up  and  down will step through all transactions listed in the previous | ||||
|        account register screen.  In the title bar, the numbers in  parentheses | ||||
|        show  your  position  within that account register.  They will vary de- | ||||
|        pending on which account register you came from (remember most transac- | ||||
|        tions  appear  in multiple account registers).  The #N number preceding | ||||
|        show  your  position  within  that  account  register.   They will vary | ||||
|        depending on which account register you came from (remember most trans- | ||||
|        actions appear in multiple account registers).  The #N number preceding | ||||
|        them is the transaction's position within the complete unfiltered jour- | ||||
|        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 | ||||
|        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- | ||||
|        vironment.plist file containing | ||||
|        (say,   an   Emacs   dock  icon).   Eg  on  MacOS  Catalina  I  have  a | ||||
|        ~/.MacOSX/environment.plist file containing | ||||
| 
 | ||||
|               { | ||||
|                 "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] | ||||
| convert amounts to cost or market value, more flexibly than -B/-V/-X | ||||
| .TP | ||||
| \f[B]\f[CB]--infer-value\f[B]\f[R] | ||||
| with -V/-X/--value, also infer market prices from transactions | ||||
| \f[B]\f[CB]--infer-market-prices\f[B]\f[R] | ||||
| use transaction prices (recorded with \[at] or \[at]\[at]) as additional | ||||
| market prices, as if they were P directives | ||||
| .TP | ||||
| \f[B]\f[CB]--auto\f[B]\f[R] | ||||
| 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) | ||||
| ************** | ||||
| @ -9,8 +10,8 @@ hledger-web(1) | ||||
| hledger-web is a web interface (WUI) for the hledger accounting tool. | ||||
| 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 | ||||
| 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 | ||||
| application for browsing and adding transactions, and optionally opens | ||||
| it in 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 (accounts, the current account register, balance charts) | ||||
| and allowing history-aware data entry, interactive searching, and | ||||
| bookmarking. | ||||
| it in 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 | ||||
| (accounts, the current account register, balance charts) and allowing | ||||
| history-aware data entry, interactive searching, and bookmarking. | ||||
| 
 | ||||
|    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 | ||||
| should put it behind a suitable web proxy.  As a small protection | ||||
| against data loss when running an unprotected instance, it writes a | ||||
| numbered backup of the main journal file (only ?)  on every edit. | ||||
| should put it behind a suitable web proxy. As a small protection against | ||||
| data loss when running an unprotected instance, it writes a numbered | ||||
| backup of the main journal file (only ?) on every edit. | ||||
| 
 | ||||
|    Like hledger, it reads data from one or more files in hledger | ||||
| journal, timeclock, timedot, or CSV format specified with '-f', or | ||||
| '$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps | ||||
| 'C:/Users/USER/.hledger.journal').  For more about this see hledger(1), | ||||
| journal, timeclock, timedot, or CSV format specified with `-f', or | ||||
| `$LEDGER_FILE', or `$HOME/.hledger.journal' (on windows, perhaps | ||||
| `C:/Users/USER/.hledger.journal'). For more about this see hledger(1), | ||||
| hledger_journal(5) etc. | ||||
| 
 | ||||
| * 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 | ||||
| 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. | ||||
| 
 | ||||
| '--serve' | ||||
| 
 | ||||
| `--serve' | ||||
|      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 | ||||
|      server-side web UI | ||||
| '--host=IPADDR' | ||||
| 
 | ||||
| `--host=IPADDR' | ||||
|      listen on this IP address (default: 127.0.0.1) | ||||
| '--port=PORT' | ||||
| 
 | ||||
| `--port=PORT' | ||||
|      listen on this TCP port (default: 5000) | ||||
| '--socket=SOCKETFILE' | ||||
| 
 | ||||
| `--socket=SOCKETFILE' | ||||
|      use a unix domain socket file to listen for requests instead of a | ||||
|      TCP socket.  Implies '--serve'.  It can only be used if the | ||||
|      operating system can provide this type of socket. | ||||
| '--base-url=URL' | ||||
|      TCP socket. Implies `--serve'. It can only be used if the operating | ||||
|      system can provide this type of socket. | ||||
| 
 | ||||
| `--base-url=URL' | ||||
|      set the base url (default: http://IPADDR:PORT). You would change | ||||
|      this when sharing over the network, or integrating within a larger | ||||
|      website. | ||||
| '--file-url=URL' | ||||
| 
 | ||||
| `--file-url=URL' | ||||
|      set the static files url (default: BASEURL/static). hledger-web | ||||
|      normally serves static files itself, but if you wanted to serve | ||||
|      them from another server for efficiency, you would set the url with | ||||
|      this. | ||||
| '--capabilities=CAP[,CAP..]' | ||||
|      them from another server for efficiency, you would set the url | ||||
|      with this. | ||||
| 
 | ||||
| `--capabilities=CAP[,CAP..]' | ||||
|      enable the view, add, and/or manage capabilities (default: | ||||
|      view,add) | ||||
| '--capabilities-header=HTTPHEADER' | ||||
| 
 | ||||
| `--capabilities-header=HTTPHEADER' | ||||
|      read capabilities to enable from a HTTP header, like | ||||
|      X-Sandstorm-Permissions (default: disabled) | ||||
| '--test' | ||||
| 
 | ||||
| `--test' | ||||
|      run hledger-web's tests and exit. hspec test runner args may | ||||
|      follow a -, eg: hledger-web -test - -help | ||||
| 
 | ||||
|    hledger input options: | ||||
| 
 | ||||
| '-f FILE --file=FILE' | ||||
| 
 | ||||
| `-f FILE --file=FILE' | ||||
|      use a different input file. For stdin, use - (default: | ||||
|      '$LEDGER_FILE' or '$HOME/.hledger.journal') | ||||
| '--rules-file=RULESFILE' | ||||
|      `$LEDGER_FILE' or `$HOME/.hledger.journal') | ||||
| 
 | ||||
| `--rules-file=RULESFILE' | ||||
|      Conversion rules file to use when reading CSV (default: FILE.rules) | ||||
| '--separator=CHAR' | ||||
| 
 | ||||
| `--separator=CHAR' | ||||
|      Field separator to expect when reading CSV (default: ',') | ||||
| '--alias=OLD=NEW' | ||||
| 
 | ||||
| `--alias=OLD=NEW' | ||||
|      rename accounts named OLD to NEW | ||||
| '--anon' | ||||
| 
 | ||||
| `--anon' | ||||
|      anonymize accounts and payees | ||||
| '--pivot FIELDNAME' | ||||
| 
 | ||||
| `--pivot FIELDNAME' | ||||
|      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 | ||||
|      assignments) | ||||
| '-s --strict' | ||||
| 
 | ||||
| `-s --strict' | ||||
|      do extra error checking (check that all posted accounts are | ||||
|      declared) | ||||
| 
 | ||||
|    hledger reporting options: | ||||
| 
 | ||||
| '-b --begin=DATE' | ||||
| 
 | ||||
| `-b --begin=DATE' | ||||
|      include postings/txns on or after this date | ||||
| '-e --end=DATE' | ||||
| 
 | ||||
| `-e --end=DATE' | ||||
|      include postings/txns before this date | ||||
| '-D --daily' | ||||
| 
 | ||||
| `-D --daily' | ||||
|      multiperiod/multicolumn report by day | ||||
| '-W --weekly' | ||||
| 
 | ||||
| `-W --weekly' | ||||
|      multiperiod/multicolumn report by week | ||||
| '-M --monthly' | ||||
| 
 | ||||
| `-M --monthly' | ||||
|      multiperiod/multicolumn report by month | ||||
| '-Q --quarterly' | ||||
| 
 | ||||
| `-Q --quarterly' | ||||
|      multiperiod/multicolumn report by quarter | ||||
| '-Y --yearly' | ||||
| 
 | ||||
| `-Y --yearly' | ||||
|      multiperiod/multicolumn report by year | ||||
| '-p --period=PERIODEXP' | ||||
| 
 | ||||
| `-p --period=PERIODEXP' | ||||
|      set start date, end date, and/or reporting interval all at once | ||||
|      using period expressions syntax | ||||
| '--date2' | ||||
| 
 | ||||
| `--date2' | ||||
|      match the secondary date instead (see command help for other | ||||
|      effects) | ||||
| '-U --unmarked' | ||||
| 
 | ||||
| `-U --unmarked' | ||||
|      include only unmarked postings/txns (can combine with -P or -C) | ||||
| '-P --pending' | ||||
| 
 | ||||
| `-P --pending' | ||||
|      include only pending postings/txns | ||||
| '-C --cleared' | ||||
| 
 | ||||
| `-C --cleared' | ||||
|      include only cleared postings/txns | ||||
| '-R --real' | ||||
| 
 | ||||
| `-R --real' | ||||
|      include only non-virtual postings | ||||
| '-NUM --depth=NUM' | ||||
| 
 | ||||
| `-NUM --depth=NUM' | ||||
|      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 | ||||
|      hledger-ui/hledger-web) | ||||
| '-B --cost' | ||||
| 
 | ||||
| `-B --cost' | ||||
|      convert amounts to their cost/selling amount at transaction time | ||||
| '-V --market' | ||||
| 
 | ||||
| `-V --market' | ||||
|      convert amounts to their market value in default valuation | ||||
|      commodities | ||||
| '-X --exchange=COMM' | ||||
| 
 | ||||
| `-X --exchange=COMM' | ||||
|      convert amounts to their market value in commodity COMM | ||||
| '--value' | ||||
| 
 | ||||
| `--value' | ||||
|      convert amounts to cost or market value, more flexibly than | ||||
|      -B/-V/-X | ||||
| '--infer-value' | ||||
| 
 | ||||
|      with -V/-X/-value, also infer market prices from transactions | ||||
| '--auto' | ||||
| `--infer-market-prices' | ||||
|      use transaction prices (recorded with @ or @@) as additional market | ||||
|      prices, as if they were P directives | ||||
| 
 | ||||
| `--auto' | ||||
|      apply automated posting rules to modify transactions. | ||||
| '--forecast' | ||||
| 
 | ||||
| `--forecast' | ||||
|      generate future transactions from periodic transaction rules, for | ||||
|      the next 6 months or till report end date. In hledger-ui, also | ||||
|      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 | ||||
|      output.  'auto' (default): whenever stdout seems to be a | ||||
|      color-supporting terminal.  'always' or 'yes': always, useful eg | ||||
| @ -223,62 +221,62 @@ the last one takes precedence. | ||||
| 
 | ||||
|    hledger help options: | ||||
| 
 | ||||
| '-h --help' | ||||
| 
 | ||||
| `-h --help' | ||||
|      show general or COMMAND help | ||||
| '--man' | ||||
| 
 | ||||
| `--man' | ||||
|      show general or COMMAND user manual with man | ||||
| '--info' | ||||
| 
 | ||||
| `--info' | ||||
|      show general or COMMAND user manual with info | ||||
| '--version' | ||||
| 
 | ||||
| `--version' | ||||
|      show general or ADDONCMD version | ||||
| '--debug[=N]' | ||||
| 
 | ||||
| `--debug[=N]' | ||||
|      show debug output (levels 1-9, default: 1) | ||||
| 
 | ||||
|    A @FILE argument will be expanded to the contents of FILE, which | ||||
| 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 | ||||
| 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 | ||||
| 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 | ||||
| '--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. | ||||
| 
 | ||||
|    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. | ||||
| 
 | ||||
|    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. | ||||
| 
 | ||||
|    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 | ||||
|    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 | ||||
| that for communication. This is an alternative way of running multiple | ||||
| hledger-web instances behind a reverse proxy that handles authentication | ||||
| for different users.  The path can be derived in a predictable way, eg | ||||
| by using the username within the path.  As an example, 'nginx' as | ||||
| reverse proxy can use the variable '$remote_user' to derive a path from | ||||
| the username used in a HTTP basic authentication.  The following | ||||
| 'proxy_pass' directive allows access to all 'hledger-web' instances that | ||||
| created a socket in '/tmp/hledger/': | ||||
| hledger-web instances behind a reverse proxy that handles | ||||
| authentication for different users. The path can be derived in a | ||||
| predictable way, eg by using the username within the path. As an | ||||
| example, `nginx' as reverse proxy can use the variable `$remote_user' | ||||
| to derive a path from the username used in a HTTP basic authentication. | ||||
| The following `proxy_pass' directive allows access to all `hledger-web' | ||||
| instances that created a socket in `/tmp/hledger/': | ||||
| 
 | ||||
| 
 | ||||
|   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 | ||||
| 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 | ||||
| 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 | ||||
| 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 | ||||
| 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 | ||||
| 
 | ||||
|    * 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 | ||||
|      local machine. | ||||
| 
 | ||||
|    * putting it behind an authenticating proxy, using eg apache or nginx | ||||
| 
 | ||||
|    * custom firewall rules | ||||
| 
 | ||||
|    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 | ||||
|      value is 'view,add': | ||||
|         * 'view' - allows viewing the journal file and all included | ||||
|      value is `view,add': | ||||
|         * `view' - allows viewing the journal file and all included | ||||
|           files | ||||
|         * 'add' - allows adding new transactions to the main journal | ||||
| 
 | ||||
|         * `add' - allows adding new transactions to the main journal | ||||
|           file | ||||
|         * 'manage' - allows editing, uploading or downloading the main | ||||
| 
 | ||||
|         * `manage' - allows editing, uploading or downloading the main | ||||
|           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 | ||||
|      on Sandstorm uses the X-Sandstorm-Permissions header to integrate | ||||
|      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 | ||||
| ********************************* | ||||
| 
 | ||||
| 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 | ||||
| let you edit, upload, or download the journal file or any files it | ||||
| 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 | ||||
| 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 | ||||
| ... | ||||
| 
 | ||||
|    You can get JSON data from these routes: | ||||
| 
 | ||||
| 
 | ||||
| /version | ||||
| /accountnames | ||||
| /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 | ||||
| python to prettify it): | ||||
| 
 | ||||
| 
 | ||||
| $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool | ||||
| [ | ||||
|     "assets", | ||||
| @ -401,6 +406,7 @@ $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool | ||||
| 
 | ||||
|    Or all transactions: | ||||
| 
 | ||||
| 
 | ||||
| $ 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. | ||||
| 
 | ||||
|    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 | ||||
| at the source for the appropriate handler to see what it returns.  Eg | ||||
| for '/accounttransactions' it's getAccounttransactionsR, returning a | ||||
| "'accountTransactionsReport ...'".  Looking up the haddock for that we | ||||
| To 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 for `/accounttransactions' it's getAccounttransactionsR, returning a | ||||
| "`accountTransactionsReport ...'". Looking up the haddock for that we | ||||
| can see that /accounttransactions returns an AccountTransactionsReport, | ||||
| which consists of a report title and a list of | ||||
| AccountTransactionsReportItem (etc). | ||||
| 
 | ||||
|    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 | ||||
| default).  The payload must be the full, exact JSON representation of a | ||||
| hledger transaction (partial data won't do).  You can get sample JSON | ||||
| from hledger-web's '/transactions' or '/accounttransactions', or you can | ||||
| export it with hledger-lib, eg like so: | ||||
| `/add', if hledger-web was started with the `add' capability (enabled | ||||
| by default). The payload must be the full, exact JSON representation of | ||||
| a hledger transaction (partial data won't do). You can get sample JSON | ||||
| from hledger-web's `/transactions' or `/accounttransactions', or you | ||||
| can export it with hledger-lib, eg like so: | ||||
| 
 | ||||
| 
 | ||||
| .../hledger$ stack ghci hledger-lib | ||||
| >>> 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 | ||||
| corresponds to hledger's Transaction and related data types): | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|     "tcomment": "", | ||||
|     "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 | ||||
| entry to your journal: | ||||
| 
 | ||||
| 
 | ||||
| $ 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 | ||||
| ************* | ||||
| 
 | ||||
| *LEDGER_FILE* The journal file path when not specified with '-f'. | ||||
| Default: '~/.hledger.journal' (on windows, perhaps | ||||
| 'C:/Users/USER/.hledger.journal'). | ||||
| *LEDGER_FILE* The journal file path when not specified with `-f'. | ||||
| Default: `~/.hledger.journal' (on windows, perhaps | ||||
| `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 | ||||
| '~/DIR/current.journal', where current.journal is a symbolic link to | ||||
| `~/DIR/current.journal', where current.journal is a symbolic link to | ||||
| YYYY.journal. | ||||
| 
 | ||||
|    On Mac computers, you can set this and other environment variables in | ||||
| a more thorough way that also affects applications started from the GUI | ||||
| (say, an Emacs dock icon).  Eg on MacOS Catalina I have a | ||||
| '~/.MacOSX/environment.plist' file containing | ||||
|    On Mac computers, you can set this and other environment variables | ||||
| in a more thorough way that also affects applications started from the | ||||
| GUI (say, an Emacs dock icon). Eg on MacOS Catalina I have a | ||||
| `~/.MacOSX/environment.plist' file containing | ||||
| 
 | ||||
| 
 | ||||
| { | ||||
|   "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 | ||||
| @ -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, | ||||
| timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or | ||||
| '$HOME/.hledger.journal' (on windows, perhaps | ||||
| 'C:/Users/USER/.hledger.journal'). | ||||
| timedot, or CSV format specified with `-f', or `$LEDGER_FILE', or | ||||
| `$HOME/.hledger.journal' (on windows, perhaps | ||||
| `C:/Users/USER/.hledger.journal'). | ||||
| 
 | ||||
|  | ||||
| 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 | ||||
| ****** | ||||
| 
 | ||||
| The need to precede options with '--' when invoked from hledger is | ||||
| The need to precede options with `--' when invoked from hledger is | ||||
| 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. | ||||
| 
 | ||||
| @ -593,24 +603,25 @@ awkward. | ||||
| 
 | ||||
|    Does not work well on small screens. | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| Tag Table: | ||||
| Node: Top72 | ||||
| Node: OPTIONS1762 | ||||
| Ref: #options1867 | ||||
| Node: PERMISSIONS9082 | ||||
| Ref: #permissions9221 | ||||
| Node: EDITING UPLOADING DOWNLOADING10433 | ||||
| Ref: #editing-uploading-downloading10614 | ||||
| Node: RELOADING11448 | ||||
| Ref: #reloading11582 | ||||
| Node: JSON API12015 | ||||
| Ref: #json-api12129 | ||||
| Node: ENVIRONMENT17619 | ||||
| Ref: #environment17735 | ||||
| Node: FILES18468 | ||||
| Ref: #files18568 | ||||
| Node: BUGS18781 | ||||
| Ref: #bugs18859 | ||||
| Node: Top84 | ||||
| Node: OPTIONS1751 | ||||
| Ref: #options1856 | ||||
| Node: PERMISSIONS9107 | ||||
| Ref: #permissions9246 | ||||
| Node: EDITING UPLOADING DOWNLOADING10458 | ||||
| Ref: #editing-uploading-downloading10639 | ||||
| Node: RELOADING11470 | ||||
| Ref: #reloading11604 | ||||
| Node: JSON API12036 | ||||
| Ref: #json-api12150 | ||||
| Node: ENVIRONMENT17639 | ||||
| Ref: #environment17755 | ||||
| Node: FILES18487 | ||||
| Ref: #files18587 | ||||
| Node: BUGS18800 | ||||
| Ref: #bugs18878 | ||||
|  | ||||
| End Tag Table | ||||
|  | ||||
| @ -20,9 +20,9 @@ DESCRIPTION | ||||
|        hledger-web  is hledger's web interface.  It starts a simple web appli- | ||||
|        cation for browsing and adding transactions, and optionally opens it in | ||||
|        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- | ||||
|        counts, the current account register, balance charts) and allowing his- | ||||
|        tory-aware data entry, interactive searching, and bookmarking. | ||||
|        than the hledger CLI or hledger-ui  interface,  showing  more  at  once | ||||
|        (accounts,  the  current account register, balance charts) and allowing | ||||
|        history-aware data entry, interactive searching, and bookmarking. | ||||
| 
 | ||||
|        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 | ||||
| @ -59,8 +59,8 @@ OPTIONS | ||||
| 
 | ||||
|        --socket=SOCKETFILE | ||||
|               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- | ||||
|               erating system can provide this type of socket. | ||||
|               a  TCP  socket.   Implies  --serve.   It can only be used if the | ||||
|               operating system can provide this type of socket. | ||||
| 
 | ||||
|        --base-url=URL | ||||
|               set the  base  url  (default:  http://IPADDR:PORT).   You  would | ||||
| @ -110,8 +110,8 @@ OPTIONS | ||||
|               assignments) | ||||
| 
 | ||||
|        -s --strict | ||||
|               do  extra error checking (check that all posted accounts are de- | ||||
|               clared) | ||||
|               do  extra  error  checking  (check  that all posted accounts are | ||||
|               declared) | ||||
| 
 | ||||
|        hledger reporting options: | ||||
| 
 | ||||
| @ -141,8 +141,8 @@ OPTIONS | ||||
|               using period expressions syntax | ||||
| 
 | ||||
|        --date2 | ||||
|               match the secondary date instead (see command help for other ef- | ||||
|               fects) | ||||
|               match  the  secondary  date  instead (see command help for other | ||||
|               effects) | ||||
| 
 | ||||
|        -U --unmarked | ||||
|               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 | ||||
|               -B/-V/-X | ||||
| 
 | ||||
|        --infer-value | ||||
|               with -V/-X/--value, also infer market prices from transactions | ||||
|        --infer-market-prices | ||||
|               use transaction prices (recorded with @  or  @@)  as  additional | ||||
|               market prices, as if they were P directives | ||||
| 
 | ||||
|        --auto apply automated posting rules to modify transactions. | ||||
| 
 | ||||
| @ -262,8 +263,8 @@ PERMISSIONS | ||||
|        You can restrict who can reach it by | ||||
| 
 | ||||
|        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- | ||||
|          chine. | ||||
|          it listens on  127.0.0.1,  accessible  to  all  users  on  the  local | ||||
|          machine. | ||||
| 
 | ||||
|        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 manage - allows editing, uploading or downloading the main  or  in- | ||||
|            cluded files | ||||
|          o manage  -  allows  editing,  uploading  or  downloading the main or | ||||
|            included files | ||||
| 
 | ||||
|        o using the --capabilities-header=HTTPHEADER flag  to  specify  a  HTTP | ||||
|          header  from  which it will read capabilities to enable.  hledger-web | ||||
| @ -290,8 +291,8 @@ PERMISSIONS | ||||
| EDITING, UPLOADING, DOWNLOADING | ||||
|        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 | ||||
|        let you edit, upload, or download the journal file or any files it  in- | ||||
|        cludes. | ||||
|        let  you  edit,  upload,  or  download the journal file or any files it | ||||
|        includes. | ||||
| 
 | ||||
|        Note, unlike any other hledger command, in this mode you (or any  visi- | ||||
|        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 | ||||
|        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 | ||||
|        makes a file unparseable, hledger-web will display an error message un- | ||||
|        til the file has been fixed. | ||||
|        makes a file unparseable, hledger-web will  display  an  error  message | ||||
|        until the file has been fixed. | ||||
| 
 | ||||
|        (Note: if you are viewing files mounted from another machine, make sure | ||||
|        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 | ||||
|        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- | ||||
|        derstanding, see the journal manual. | ||||
|        on the various data types, eg Transaction.   And  for  a  higher  level | ||||
|        understanding, see the journal manual. | ||||
| 
 | ||||
|        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 | ||||
|        at  the  source for the appropriate handler to see what it returns.  Eg | ||||
|        for /accounttransactions it's getAccounttransactionsR, returning a "ac- | ||||
|        countTransactionsReport ...".  Looking up the haddock for that  we  can | ||||
|        see  that  /accounttransactions  returns  an AccountTransactionsReport, | ||||
|        for  /accounttransactions  it's  getAccounttransactionsR,  returning  a | ||||
|        "accountTransactionsReport  ...".   Looking  up the haddock for that we | ||||
|        can see that /accounttransactions returns an AccountTransactionsReport, | ||||
|        which  consists  of a report title and a list of AccountTransactionsRe- | ||||
|        portItem (etc). | ||||
| 
 | ||||
| @ -490,8 +491,8 @@ JSON API | ||||
|                   "tstatus": "Unmarked" | ||||
|               } | ||||
| 
 | ||||
|        And  here's how to test adding it with curl.  This should add a new en- | ||||
|        try to your journal: | ||||
|        And here's how to test adding it with curl.   This  should  add  a  new | ||||
|        entry to your journal: | ||||
| 
 | ||||
|               $ 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 | ||||
|        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- | ||||
|        vironment.plist file containing | ||||
|        (say,  an  Emacs  dock  icon).   Eg  on  MacOS  Catalina   I   have   a | ||||
|        ~/.MacOSX/environment.plist file containing | ||||
| 
 | ||||
|               { | ||||
|                 "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] | ||||
| convert amounts to cost or market value, more flexibly than -B/-V/-X | ||||
| .TP | ||||
| \f[B]\f[CB]--infer-value\f[B]\f[R] | ||||
| with -V/-X/--value, also infer market prices from transactions | ||||
| \f[B]\f[CB]--infer-market-prices\f[B]\f[R] | ||||
| use transaction prices (recorded with \[at] or \[at]\[at]) as additional | ||||
| market prices, as if they were P directives | ||||
| .TP | ||||
| \f[B]\f[CB]--auto\f[B]\f[R] | ||||
| 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 | ||||
| query will be their intersection (perhaps excluding the | ||||
| \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 | ||||
| .PP | ||||
| Instead of reporting amounts in their original commodity, hledger can | ||||
| 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). | ||||
| This is controlled by the \f[C]--value=TYPE[,COMMODITY]\f[R] option, but | ||||
| we also provide the simpler \f[C]-B\f[R]/\f[C]-V\f[R]/\f[C]-X\f[R] | ||||
| flags, and usually one of those is all you need. | ||||
| .SS -B: Cost | ||||
| .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. | ||||
| This is controlled by the \f[C]--cost\f[R] and | ||||
| \f[C]--value=TYPE[,COMMODITY]\f[R] options, but we also provide the | ||||
| simpler \f[C]-V\f[R]/\f[C]-X\f[R] flags, and usually one of those is all | ||||
| you need. | ||||
| .SS -V: Value | ||||
| .PP | ||||
| 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 | ||||
| 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 | ||||
| declared by a P directive, or (with the \f[C]--infer-value\f[R] flag) | ||||
| inferred from transaction prices. | ||||
| declared by a P directive, or (with the \f[C]--infer-market-price\f[R] | ||||
| flag) inferred from transaction prices. | ||||
| .IP "2." 3 | ||||
| A \f[I]reverse market price\f[R]: the inverse of a declared or inferred | ||||
| market price from B to A. | ||||
| .IP "3." 3 | ||||
| A \f[I]a forward chain of market prices\f[R]: a synthetic price formed | ||||
| by combining the shortest chain of \[dq]forward\[dq] (only 1 above) | ||||
| market prices, leading from A to B. | ||||
| A \f[I]forward chain of market prices\f[R]: a synthetic price formed by | ||||
| combining the shortest chain of \[dq]forward\[dq] (only 1 above) market | ||||
| prices, leading from A to B. | ||||
| .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 | ||||
| A to B. | ||||
| .PP | ||||
| @ -1292,7 +1296,7 @@ That limit is currently 1000. | ||||
| .PP | ||||
| Amounts for which no suitable market price can be found, are not | ||||
| converted. | ||||
| .SS --infer-value: market prices from transactions | ||||
| .SS --infer-market-price: market prices from transactions | ||||
| .PP | ||||
| Normally, market value in hledger is fully controlled by, and requires, | ||||
| 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) ? | ||||
| We could produce value reports without needing P directives at all. | ||||
| .PP | ||||
| Adding the \f[C]--infer-value\f[R] flag to \f[C]-V\f[R], \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 | ||||
| prices both from P directives and from transactions. | ||||
| Adding the \f[C]--infer-market-price\f[R] flag to \f[C]-V\f[R], | ||||
| \f[C]-X\f[R] or \f[C]--value\f[R] enables this. | ||||
| So for example, \f[C]hledger bs -V --infer-market-price\f[R] will get | ||||
| market prices both from P directives and from transactions. | ||||
| (And if both occur on the same day, the P directive takes precedence). | ||||
| .PP | ||||
| There is a downside: value reports can sometimes be affected in | ||||
| confusing/undesired ways by your journal entries. | ||||
| 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. | ||||
| .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 | ||||
| multicommodity transactions with explicit prices | ||||
| (\f[C]\[at]\f[R]/\f[C]\[at]\[at]\f[R]) | ||||
| @ -1350,16 +1355,16 @@ date. | ||||
| valuation date.) | ||||
| .IP "3." 3 | ||||
| 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 | ||||
| latest transaction-inferred price for A on or before valuation date. | ||||
| \f[C]--infer-market-price\f[R] flag is used: the price commodity from | ||||
| the latest transaction-inferred price for A on or before valuation date. | ||||
| .PP | ||||
| This means: | ||||
| .IP \[bu] 2 | ||||
| If you have P directives, they determine which commodities \f[C]-V\f[R] | ||||
| will convert, and to what. | ||||
| .IP \[bu] 2 | ||||
| If you have no P directives, and use the \f[C]--infer-value\f[R] flag, | ||||
| transaction prices determine it. | ||||
| If you have no P directives, and use the \f[C]--infer-market-price\f[R] | ||||
| flag, transaction prices determine it. | ||||
| .PP | ||||
| Amounts for which no valuation commodity can be found are not converted. | ||||
| .SS Simple valuation examples | ||||
| @ -1410,15 +1415,14 @@ $ hledger -f t.j bal -N euros -V | ||||
| .fi | ||||
| .SS --value: Flexible valuation | ||||
| .PP | ||||
| \f[C]-B\f[R], \f[C]-V\f[R] and \f[C]-X\f[R] are special cases of the | ||||
| more general \f[C]--value\f[R] option: | ||||
| \f[C]-V\f[R] and \f[C]-X\f[R] are special cases of the more general | ||||
| \f[C]--value\f[R] option: | ||||
| .IP | ||||
| .nf | ||||
| \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. | ||||
|                       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 period end(s) | ||||
|                       - default valuation commodity (or COMM) using current market prices | ||||
| @ -1428,9 +1432,6 @@ more general \f[C]--value\f[R] option: | ||||
| .PP | ||||
| The TYPE part selects cost or value and valuation date: | ||||
| .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] | ||||
| Convert amounts to their value in the default valuation commodity, using | ||||
| market prices on each posting\[aq]s date. | ||||
| @ -1481,7 +1482,7 @@ Show the cost of each posting: | ||||
| .IP | ||||
| .nf | ||||
| \f[C] | ||||
| $ hledger -f- print --value=cost | ||||
| $ hledger -f- print --cost | ||||
| 2000-01-01 | ||||
|     (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{ | ||||
| Report type | ||||
| 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{ | ||||
| \f[C]-V\f[R], \f[C]-X\f[R] | ||||
| T}@T{ | ||||
| @ -2355,41 +2356,59 @@ aregister, areg | ||||
| .PD 0 | ||||
| .P | ||||
| .PD | ||||
| Show transactions affecting a particular account, and the account\[aq]s | ||||
| running balance. | ||||
| .PP | ||||
| Show the transactions and running historical balance in an account, with | ||||
| each line item representing one transaction. | ||||
| .PP | ||||
| \f[C]aregister\f[R] shows the transactions affecting a particular | ||||
| account (and its subaccounts), from the point of view of that account. | ||||
| Each line shows: | ||||
| .IP \[bu] 2 | ||||
| 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). | ||||
| account and its subaccounts, with each line item representing a whole | ||||
| transaction - as in bank statements, hledger-ui, hledger-web and other | ||||
| accounting apps. | ||||
| .PP | ||||
| With \f[C]aregister\f[R], each line represents a whole transaction - as | ||||
| in hledger-ui, hledger-web, and your bank statement. | ||||
| By contrast, the \f[C]register\f[R] command shows individual postings, | ||||
| 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. | ||||
| Note this is unlike the \f[C]register\f[R] command, which shows | ||||
| individual postings and does not always show a single account or a | ||||
| historical balance. | ||||
| .PP | ||||
| An account must be specified as the first argument, which should be the | ||||
| full account name or an account pattern (regular expression). | ||||
| aregister will show transactions in this account (the first one matched) | ||||
| and any of its subaccounts. | ||||
| A reminder, \[dq]historical\[dq] balances include any balance from | ||||
| transactions before the report start date, so (if opening balances are | ||||
| recorded correctly) \f[C]aregister\f[R] will show the real-world | ||||
| 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 | ||||
| Any additional arguments form a query which will filter the transactions | ||||
| shown. | ||||
| .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 | ||||
| the \f[C]-E/--empty\f[R] flag to show them. | ||||
| .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 | ||||
| options The output formats supported are \f[C]txt\f[R], \f[C]csv\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 | ||||
| Each group of sibling accounts is sorted separately, by declaration | ||||
| 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 | ||||
| .PP | ||||
| 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 | ||||
| \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]. | ||||
| .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 | ||||
| .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. | ||||
| 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, | ||||
| time usage, etc. | ||||
| --budget is most often combined with a report interval. | ||||
| .PP | ||||
| For example, you can take average monthly expenses in the common expense | ||||
| categories to construct a minimal monthly budget: | ||||
| @ -3783,12 +3803,16 @@ payees | ||||
| .PD | ||||
| List the unique payee/payer names that appear in transactions. | ||||
| .PP | ||||
| This command lists the unique payee/payer names that appear in | ||||
| transactions, in alphabetic order. | ||||
| You can add a query to select a subset of transactions. | ||||
| This command lists unique payee/payer names which have been declared | ||||
| with payee directives (--declared), used in transaction descriptions | ||||
| (--used), or both (the default). | ||||
| .PP | ||||
| The payee/payer is the part of the transaction description before a | | ||||
| character (or if there is no |, the whole description). | ||||
| .PP | ||||
| You can add query arguments to select a subset of transactions. | ||||
| This implies --used. | ||||
| .PP | ||||
| Example: | ||||
| .IP | ||||
| .nf | ||||
| @ -3823,9 +3847,20 @@ Show transaction journal entries, sorted by date. | ||||
| The print command displays full journal entries (transactions) from the | ||||
| journal file, sorted by date (or with \f[C]--date2\f[R], by secondary | ||||
| 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 | ||||
| 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: | ||||
| .IP | ||||
| .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 | ||||
| unparseable: | ||||
| .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 | ||||
| assignment amounts, potentially causing those to fail. | ||||
| .IP \[bu] 2 | ||||
| @ -5305,6 +5337,7 @@ Scientific E notation is allowed: | ||||
| EUR 1E3 | ||||
| \f[R] | ||||
| .fi | ||||
| .SS Decimal marks, digit group marks | ||||
| .PP | ||||
| A decimal mark can be written as a period or a comma: | ||||
| .IP | ||||
| @ -5314,7 +5347,6 @@ A decimal mark can be written as a period or a comma: | ||||
| 1,23456780000009 | ||||
| \f[R] | ||||
| .fi | ||||
| .SS Digit group marks | ||||
| .PP | ||||
| 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] - | ||||
| @ -5329,9 +5361,9 @@ INR 9,99,99,999.00 | ||||
| \f[R] | ||||
| .fi | ||||
| .PP | ||||
| Note, a number containing a single group mark and no decimal mark is | ||||
| ambiguous. | ||||
| Are these group marks or decimal marks ? | ||||
| Note, a number containing a single digit group mark and no decimal mark | ||||
| is ambiguous. | ||||
| Are these digit group marks or decimal marks ? | ||||
| .IP | ||||
| .nf | ||||
| \f[C] | ||||
| @ -5340,15 +5372,16 @@ Are these group marks or decimal marks ? | ||||
| \f[R] | ||||
| .fi | ||||
| .PP | ||||
| hledger will treat them both as decimal marks by default (cf #793). | ||||
| If you use digit group marks, to prevent confusion and undetected typos | ||||
| we recommend you write commodity directives at the top of the file to | ||||
| explicitly declare the decimal mark (and optionally a digit group mark). | ||||
| Note, these formats (\[dq]amount styles\[dq]) are specific to each | ||||
| commodity, so if your data uses multiple formats, hledger can handle it: | ||||
| If you don\[aq]t tell it otherwise, hledger will assume both of the | ||||
| above are decimal marks, parsing both numbers as 1. | ||||
| To prevent confusion and undetected typos, especially if your data | ||||
| contains digit group marks, we recommend you explicitly declare the | ||||
| decimal mark (and optionally a digit group mark), for each commodity, | ||||
| using \f[C]commodity\f[R] directives (described below): | ||||
| .IP | ||||
| .nf | ||||
| \f[C] | ||||
| # number formats for $, EUR, INR and the no-symbol commodity: | ||||
| commodity $1,000.00 | ||||
| commodity EUR 1.000,00 | ||||
| commodity INR 9,99,99,999.00 | ||||
| @ -5356,23 +5389,38 @@ commodity       1 000 000.9455 | ||||
| \f[R] | ||||
| .fi | ||||
| .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 | ||||
| .PP | ||||
| For the amounts in each commodity, hledger chooses a consistent display | ||||
| style. | ||||
| (Excluding price amounts, which are always displayed as written). | ||||
| The display style is chosen 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]). | ||||
| style to use in most reports. | ||||
| (Except for price amounts, which are always displayed as written). | ||||
| The display style is inferred as follows. | ||||
| .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 | ||||
| Use the general style (decimal mark, symbol placement) of the first | ||||
| 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 | ||||
| display style. | ||||
| .PP | ||||
| In summary, each commodity\[aq]s amounts will be normalised to | ||||
| .IP \[bu] 2 | ||||
| the style declared by a \f[C]commodity\f[R] directive | ||||
| .IP \[bu] 2 | ||||
| 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 | ||||
| To summarise: each commodity\[aq]s amounts will be normalised to (a) the | ||||
| style declared by a \f[C]commodity\f[R] directive, or (b) 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. | ||||
| 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 | ||||
| commodity\[aq]s display style. | ||||
| For example: | ||||
| with too many decimal places, use a commodity directive. | ||||
| Some examples: | ||||
| .IP | ||||
| .nf | ||||
| \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 $1000.00 | ||||
| commodity 1000.00000000 BTC | ||||
| commodity 1 000. | ||||
| \f[R] | ||||
| .fi | ||||
| .SS Rounding | ||||
| @ -8235,6 +8280,14 @@ amount %amt %cur | ||||
| 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 | ||||
| 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 | ||||
| .PP | ||||
| In field assignments, you can interpolate only CSV fields, not hledger | ||||
|  | ||||
							
								
								
									
										4422
									
								
								hledger/hledger.info
									
									
									
									
									
								
							
							
						
						
									
										4422
									
								
								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