Commit Graph

457 Commits

Author SHA1 Message Date
Simon Michael
6e4ba1106f tests: more tests for #893
[ci skip]
2019-02-01 15:31:38 -08:00
Simon Michael
94771edda2 tests: move, consolidate auto posting tests (#893)
[ci skip]
2019-02-01 15:31:36 -08:00
Simon Michael
33d82fb657 fix: --forecast shouldn't force --auto on (#953, #959) 2019-02-01 11:43:24 -08:00
Simon Michael
6416ad9e54 fix functional test breakage 2019-01-28 20:25:59 -08:00
Dmitry Astapov
f6e5b3d438 lib: make --auto work on --forecast transactions 2019-01-25 12:53:59 -08:00
Dmitry Astapov
f2aaaf3310 lib, cli: merge --show-unbudgeted into --empty 2019-01-25 12:53:09 -08:00
Simon Michael
550e33a558 journal: fix balance assertions/assignments & prices (#824)
Hopefully this is will do it. This restores the past behaviour:

- parsing prices in balance assertions/assignments
- ignoring them in assertions
- using them in assignments
- and printing them

and clarifies tests and docs.
2019-01-25 12:41:10 -08:00
Simon Michael
a5eb5bdff9 journal: fix balance assertions test (#824, #958) 2019-01-25 10:09:40 -08:00
Dmitry Astapov
5711cdf9ba cli: added --transpose to "balance" command 2019-01-24 15:06:35 -08:00
Dmitry Astapov
f3366c7256 lib: fix behavior of nested budgets and --show-unbudgeted 2019-01-24 14:56:22 -08:00
Dmitry Astapov
56553ede69 cli: if abs(return on investment)<0.01% display it as zero 2019-01-24 13:36:11 -08:00
Simon Michael
7b47fb608e close: use exact, minimal amounts; ensure assertions pass (#941) 2019-01-16 14:57:59 -08:00
Simon Michael
99f397da5d make the #949 functional test more robust 2019-01-16 09:19:56 -08:00
Simon Michael
95643affad test that order of include files is maintained (#949) 2019-01-15 12:58:28 -08:00
Simon Michael
70b11ed0a4 journal: make balance assertions exact again (#941)
Going with option 1b from the issue: calculated and asserted amounts
are compared exactly, disregarding display precision.
But now balance assertion failure messages show those exact amounts at
full precision, avoiding confusion.
2019-01-08 16:51:11 +00:00
Simon Michael
c331be7f23 journal: clarify balance assertion/display precision more (#941) 2019-01-06 22:17:20 +00:00
Simon Michael
187fcf75ed journal: clarify balance assertion/display precision interaction
Surprisingly, balance assertions were checking to maximum precision,
which meant it was possible, with a display-precision-limiting
commodity directive, to have a failing assertion with the error
message showing asserted and actual amounts that looked the same.

Now we round the calculated account balance (but not the asserted
balance) to display precision before comparing. This should ensure
assertions always behave as you would expect from visual inspection.
2019-01-06 08:30:54 +00:00
Simon Michael
08cc807e49 roi: tweak a test and disable another to make build green (#937) 2019-01-05 07:35:54 +00:00
Simon Michael
86a91c514d lib: disallow prices in balance assertions/assignments (fix #824)
(and in Ledger-style {=FIXEDLOTPRICES} )
2019-01-05 07:35:54 +00:00
Jesse Rosenthal
1389a64e99 tests: budget: add tests for unassignable accounts. 2018-12-02 13:29:00 -08:00
Alex Chen
519297051d lib: restore previous period expression parser behaviour (PR #807)
- parse a period expression by first extracting words separated by
  single spaces, then by "re-parsing" this text with 'periodexprp'
- this way, the period expression parsers do not need to know about
  the single- or double-space rules
2018-11-22 14:09:32 -08:00
Simon Michael
b00aa32d7b journal: txn modifier multipliers multiply total-priced amounts (#928)
A different approach: instead of converting to unit prices and fiddling
with the display precision, just multiply the total prices by the same
multiplier (and keep them positive).

This seems a little more natural. I'm not sure if one of these will be
more robust than the other.
2018-11-13 17:50:30 -08:00
Simon Michael
9e8b1612b0 journal: fix txn modifier multipliers with total-priced amounts (#928)
Transaction modifier multipliers have never multiplied total-priced amounts
correctly (and prior to hledger 1.10, this could generate unbalanced
transactions).

Now, the generated postings in this situation will have unit prices,
and an extra digit of display precision. This helps ensure that
the modified transaction will remain balanced. I'm not sure yet if
it's guaranteed.
2018-11-13 16:35:46 -08:00
Mykola Orliuk
1aac38d3d3 lib: include source info in txn balance errors
Partially address simonmichael/hledger#904
2018-10-23 15:54:38 -07:00
Simon Michael
f58330169a tests: show auto postings' current commodity action (#913) 2018-10-22 11:35:28 -07:00
Simon Michael
bcd15137c6 tests: upgrade, document print --auto tests 2018-10-22 11:09:53 -07:00
Simon Michael
643de787b1 tests: move auto.test under print/ 2018-10-22 10:53:59 -07:00
Samuel May
e57ef9e9a9 lib: journal: Add support for exact assertions 2018-10-22 09:55:14 -07:00
Dmitry Astapov
15c666702b cli: compoundbalancecommand keeps zero-balance accounts with children 2018-10-17 16:59:53 -07:00
Jesse Rosenthal
6c3fb56603 Add test for modifers on inferred values. 2018-10-12 07:39: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
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
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
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
Alex Chen
2cbc41e088 Merge branch 'master' into ExceptTLayer 2018-10-09 11:19:45 -06:00
Simon Michael
dcf4c07ac8 journal: commented test for Y and periodic transactions (#892)
[ci skip]
2018-10-09 08:17:16 -07:00
Felix Yan
9c0648b46a test: fix a typo 2018-10-05 11:06:47 -10:00
Simon Michael
2c9c4ebf79
Merge branch 'master' into ExceptTLayer 2018-10-04 21:04:02 -10:00
Alex Chen
3d2584d869 lib: switch to megaparsec 7 2018-09-30 20:15:12 -06:00
Simon Michael
e670bd4e9a tests: typo 2018-09-27 13:51:31 -10:00
Dmitry Astapov
743098034b tests: return on investment 2018-09-27 13:42:31 -10:00
Dmitry Astapov
bda202e4d4 cli: "close" can print only opening or closing transaction 2018-09-25 07:25:59 -10:00
Simon Michael
855bd54d19 budget: declaration and (actual) amount sorting for bal --budget
Account declaration-aware sorting is the default throughout hledger now.
2018-09-24 08:31:19 -10:00
Dmitry Astapov
8c79d6529d lib: fix balance --budget in the presence of --value 2018-09-23 07:45:34 -10:00
Simon Michael
ef5e7511c2 tests: fix balance/sorting.test with released shelltest
It was using org-style nodes for organisation, which requires
a shelltest dev build.
2018-09-22 21:58:00 -10:00
Simon Michael
3de8c11de1 journal: a new account sorting mechanism, and a bunch of sorting fixes
A bunch of account sorting changes that got intermingled.

First, account codes have been dropped. They can still be parsed and
will be ignored, for now. I don't know if anyone used them.
Instead, account display order is now controlled by the order of account
directives, if any. From the mail list:

  I'd like to drop account codes, introduced in hledger 1.9 to control
  the display order of accounts. In my experience,

  - they are tedious to maintain
  - they duplicate/compete with the natural tendency to arrange account
    directives to match your mental chart of accounts
  - they duplicate/compete with the tree structure created by account
    names

  and it gets worse if you think about using them more extensively,
  eg to classify accounts by type.

  Instead, I plan to just let the position (parse order) of account
  directives determine the display order of those declared accounts.
  Undeclared accounts will be displayed after declared accounts,
  sorted alphabetically as usual.

Second, the various account sorting modes have been implemented more
widely and more correctly. All sorting modes (alphabetically, by account
declaration, by amount) should now work correctly in almost all commands
and modes (non-tabular and tabular balance reports, tree and flat modes,
the accounts command). Sorting bugs have been fixed, eg #875.
Only the budget report (balance --budget) does not yet support sorting.

Comprehensive functional tests for sorting in the accounts and balance
commands have been added. If you are confused by some sorting behaviour,
studying these tests is recommended, as sorting gets tricky.
2018-09-22 21:45:07 -10:00