Commit Graph

6870 Commits

Author SHA1 Message Date
Simon Michael
1c3233cc0f ui: replace odd-looking pattern 2018-10-18 14:43:00 -07:00
Simon Michael
1db9b018f1 ui: add --present/--future, hide future txns by default, toggle with F
You may have transactions dated later than today, perhaps piped from
print --forecast or recorded in the journal, which you don't want to
see except when forecasting.

By default, we now hide future transactions, showing "today's balance".
This can be toggled with the F key, which is easier than setting a
date query. --present and --future flags have been added to set the
initial mode.

(Experimental. Interactions with date queries have not been explored.)
2018-10-18 14:43:00 -07:00
Simon Michael
e52430bd62 ui: default theme: reduce highlighting noise in bottom border help 2018-10-18 14:43:00 -07:00
Simon Michael
89712fe81d ui: make flat the default, toggle with T, add --tree/-T/-F flags 2018-10-18 14:43:00 -07:00
Dmitry Astapov
15c666702b cli: compoundbalancecommand keeps zero-balance accounts with children 2018-10-17 16:59:53 -07:00
Jesse Rosenthal
a6a73e36e3 Finish removing journalFinalise (#903)
* journal: Get rid of `journalFinalise` and use granular functions

Complete the process started in 53b3e2bd. This gets rid of the
`journalFinalise` function and uses the smaller steps, in order to
have more granular control.

* journal: Change order of operations in finalization

We want to make sure that we add the filepath after the order is
reversed, so the added filepath is on the head and not the tail (as it
would be if it were reversed after it was added).

* journal: Refine granular finalization functions

This commit fixes two of the granular finalization functions:

1. Rename `journalSetTime` to `journalSetLastReadTime` and improve
   documentation.

2. Remove `journalSetFilePath`. It's redundant with `journalAddFile`
   currently in `Hledger.Read.Common`. The only difference between the
   functions is where the file is added (we keep the one in which it
   is added to the tail), so we change the position vis-a-vis
   reversal.
2018-10-16 08:51:51 -07:00
Simon Michael
0f2a31bea7 docs: journal: account: a little bit more about sorting
[ci skip]
2018-10-15 12:07:44 -07:00
Simon Michael
4a399e50cb acc: don't require an explicit --flat to make --drop work 2018-10-13 13:22:11 -07:00
Simon Michael
b72f9697a2 lib: journal: account: allow whitespace or a comment after the account name 2018-10-13 13:09:49 -07:00
Simon Michael
4f2d9dde4c docs: journal: clarify transaction modifiers
[ci skip]
2018-10-12 09:12:06 -07:00
Simon Michael
383479d313 doc: update hledger-irr mention
[ci skip]
2018-10-12 09:12:06 -07:00
Jesse Rosenthal
53b3e2bd94 journal: split up the parts of journalFinalise, and use them as needed.
`journalFinalise` is only used in the `parseAndFinaliseJournal`
functions, but it needs to be run differently at different stages when
transaction modifiers are applied. This change breaks it into smaller
functions, and uses those smaller parts in `parseAndFinaliseJournal`
as needed.
2018-10-12 07:39:53 -07:00
Jesse Rosenthal
20f134c96b read: only run finalise twice if there are modifiers
Previously we ran if `--auto` was set. But this adds a small
performance hit if `--auto` becomes default. Now we only run twice if
there are transactionModifiers AND `--auto` is set. So even if auto is
specified, there will be no penalty if there are no modifiers.
2018-10-12 07:39:53 -07:00
Jesse Rosenthal
6c3fb56603 Add test for modifers on inferred values. 2018-10-12 07:39:53 -07:00
Jesse Rosenthal
5a3462ce48 read: Integrate transaction modifiers with journal finalization
Currently, automated transactions are added before the journal is
finalized. This means that no inferred values will be picked up. We
change the procedure, if `auto_` is set, to

 1. first run `journalFinalise` without assertion checking (assertions
    might be wrong until automated transactions), but with reordering
 2. Insert transaction modifiers
 3. Run `journalFinalise` again, this time with assertion checking as
    set in the options, and without reordering.

If `auto_` is not set, all works as before.

Closes: #893
2018-10-12 07:39:53 -07:00
Jesse Rosenthal
b346d7f701 Journal: make reordering optional in journalFinalise
Currently `journalFinalise` always reverses the order of
entries. However, if there are automated transactions, we might need
to run it twice. This adds a boolean flag to make reordering
optional. This will be used in the `parseAndFinaliseJournal`
functions.
2018-10-12 07:39:53 -07:00
Simon Michael
c53502e1ac docs: say more about special chars and unicode chars (cf #895)
[ci skip]
2018-10-11 19:06:52 -07:00
Simon Michael
9685699491 docs: options: clarify special characters topic
[ci skip]
2018-10-11 18:00:36 -07:00
Simon Michael
51bf8cbccc docs: journal: account: a gotcha when changing builtin account types
[ci skip]
2018-10-11 16:16:33 -07:00
Simon Michael
a899f7924f docs: journal: account: update directives intro
[ci skip]
2018-10-11 15:53:06 -07:00
Moritz Kiefer
ec1b31f7ba Anonymize original postings 2018-10-11 15:39:33 -07:00
Simon Michael
0d6803e4b5 accounts: drop obsolete --codes flag 2018-10-10 20:35:53 -07:00
Simon Michael
cf25ef5cf5 accounts: filtering by anything other than account name was broken 2018-10-10 20:32:19 -07:00
Simon Michael
3f0ab0b008 tests: clean up directives test files
[ci skip]
2018-10-10 20:31:08 -07:00
Simon Michael
e4215c094e doc: journal: document setting account types
[ci skip]
2018-10-09 14:24:59 -10:00
Simon Michael
605a082d77 bs/bse/cf/is: use account type declarations if any
These commands now detect the account types declared by account directives.
Whenever such declarations are not present, built-in regular expressions
are used, as before.
2018-10-09 14:24:59 -10:00
Simon Michael
c1236fa6e9 journal: account directives can declare account types
Previously you had to use one of the standard english account names
(assets, liabilities..) for top-level accounts, if you wanted to use
the bs/bse/cf/is commands.
Now, account directives can specify which of the big five categories
an account belongs to - asset, liability, equity, revenue or expense -
by writing one of the letters A, L, E, R or X two or more spaces after
the account name (where the numeric account code used to be).

This might change. Some thoughts influencing the current syntax:
- easy to type and read
- does not require multiple lines
- does not depend on any particular account numbering scheme
- allows more types later if needed
- still anglocentric, but only a little
- could be treated as syntactic sugar for account tags later
- seems to be compatible with (ignored by) current Ledger

The current design permits unlimited account type declarations anywhere
in the account tree. So you could declare a liability account somewhere
under assets, and maybe a revenue account under that, and another asset
account even further down. In such cases you start to see oddities like
accounts appearing in multiple places in a tree-mode report. In theory
the reports will still behave reasonably, but this has not been tested
too hard. In any case this is clearly too much freedom. I have left it
this way, for now, in case it helps with:

- modelling contra accounts ?
- multiple files. I suspect the extra expressiveness may come in handy
  when combining multiple files with account type declarations,
  rewriting account names, apply parent accounts etc.
  If we only allowed type declarations on top-level accounts, or
  only allowed a single account of each type, complications seem likely.
2018-10-09 14:24:59 -10:00
Simon Michael
678e8c28e4 tests: protect func. test from shelltest -w flag (#897) 2018-10-09 17:16:47 -07:00
Mykola Orliuk
8c6a418325 lib: fix home path expansion in includes
fixes simonmichael/hledger#896
2018-10-09 13:35:40 -10:00
Simon Michael
6c57629b8c lib: fix posting-date-and-balance-assignment error properly (#894) 2018-10-09 16:08:47 -07:00
Simon Michael
8c7c59017a lib: fix my wrong merge of #880 more 2018-10-09 15:26:15 -07:00
Simon Michael
36fdeceb6c lib: tweak posting-date-no-amount-balance-assertion error (#894) 2018-10-09 14:15:52 -07:00
Simon Michael
f6e095e794 lib: fix my wrong merge of #880 2018-10-09 14:06:22 -07:00
Simon Michael
0f921bfbe0
Merge pull request #880 from awjchen/ExceptTLayer
Re-implement the 'ExceptT' layer of the parser and switch to megaparsec 7 [WIP]
2018-10-09 10:33:21 -10:00
Simon Michael
88887e5458
Merge branch 'master' into ExceptTLayer 2018-10-09 10:31:32 -10:00
Simon Michael
278802e648 journal: Y affects dates in periodic transactions (fix #892) 2018-10-09 11:54:40 -07:00
Simon Michael
ab26220b23 lib: document SmartDate
[ci skip]
2018-10-09 10:43:03 -07:00
Alex Chen
2cbc41e088 Merge branch 'master' into ExceptTLayer 2018-10-09 11:19:45 -06:00
Alex Chen
e45070aab5 Update dependency bounds for megaparsec 2018-10-09 11:15:33 -06:00
Alex Chen
a8d642d5b5 lib: revise comments for "final" parse errors
- also simplify their implementation a bit
2018-10-09 11:05:46 -06:00
Simon Michael
dcf4c07ac8 journal: commented test for Y and periodic transactions (#892)
[ci skip]
2018-10-09 08:17:16 -07:00
Simon Michael
881966207f stack: trial build plan for ghc 8.6 (#883)
[ci skip]
2018-10-07 20:20:48 -10:00
Simon Michael
f5ac8f82b2 site: download: tweaks; start collecting packager contact info
[ci skip]
2018-10-07 17:02:39 -10:00
Simon Michael
d6508f8c4e site: download: 1.11 windows binary
[ci skip]
2018-10-07 16:10:30 -10:00
Simon Michael
36af23ff5a appveyor: try older ghc again, skip tests for now (#888)
[ci skip]
2018-10-07 10:07:31 -10:00
Simon Michael
9f4426a462 site: download: add update link, link to platform package info
[ci skip]
2018-10-07 09:10:55 -10:00
Simon Michael
b036a49a4f site: download: update homebrew-installed version
[ci skip]
2018-10-07 08:34:02 -10:00
Simon Michael
fdab1d1877 appveyor: 7x is rocket science, try this (#888)
https://stackoverflow.com/questions/1359793

[ci skip]
2018-10-07 08:24:04 -10:00
Simon Michael
e4850e89df site: download: tweaks
[ci skip]
2018-10-07 07:01:33 -10:00
Simon Michael
0ef8024d23 site: download: more cleanups, add cabal install command
[ci skip]
2018-10-07 06:52:54 -10:00