Commit Graph

453 Commits

Author SHA1 Message Date
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
Simon Michael
e2c9147ee5 csv: some follow-on issues related to #829 2018-09-07 13:43:05 -07:00
Simon Michael
fe2c48245c csv: simplify rules in ssv test 2018-09-07 13:42:44 -07:00
Simon Michael
23bdac41d9 csv: merge lucamolteni's cassava/custom separators (squashed) (#829)
commit 5ba464de76
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Sep 7 17:54:12 2018 +0200

    Fix CI 2

commit f060ae9449
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Sep 7 17:30:08 2018 +0200

    Fix CI build

commit af0719a33b
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Sep 7 17:19:01 2018 +0200

    Fix rebase

commit 1a24ddfa54
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Aug 10 16:25:24 2018 +0200

    Fixed some GHC warnings

commit 1ac43398a3
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Aug 10 16:14:49 2018 +0200

    Fix .cabal

commit 422456b925
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jul 1 22:56:20 2018 +0200

    Removed to-do list

commit 1118b762e4
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jul 1 22:53:28 2018 +0200

    Better test

commit 1146ed0941
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jul 1 15:32:28 2018 +0200

    Fix parsing

commit 4fc2374b2b
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 22:11:11 2018 +0200

    Parsing of separator

commit f7a61737f1
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 14:29:23 2018 +0200

    Almost separator in options

commit ac8841cf3b
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 14:16:59 2018 +0200

    Separator in parseCSV

commit 92a8b9f6ba
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 13:30:41 2018 +0200

    separator option

commit ec417a81ae
Author: Luca Molteni <volothamp@gmail.com>
Date:   Thu Jun 21 10:45:26 2018 +0200

    Removed one qualified import

commit 8b2f386c2f
Author: Luca Molteni <volothamp@gmail.com>
Date:   Wed Jun 20 14:01:12 2018 +0200

    Removed string conversions

commit a14d0e099e
Author: Luca Molteni <volothamp@gmail.com>
Date:   Wed Jun 20 10:23:20 2018 +0200

    custom delimiter in cassava

commit 694d48e2bc
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 17:51:54 2018 +0200

    Use Text.getContents - remove UTF-8 compatibility library

commit a7ada2cc60
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 17:49:34 2018 +0200

    todo list

commit 58ec47d398
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 17:45:22 2018 +0200

    CSV test now has unicode characters

commit b7851e94c3
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 16:59:39 2018 +0200

    Use decode from Text

commit 79f59fd28c
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sun Jun 10 13:28:57 2018 +0200

    Use Text and Lazy Bytestring

commit 470c9bcb8d
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 15:30:22 2018 +0200

    Use megaparsec error

commit f978848ba2
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 15:22:07 2018 +0200

    Renamed qualify and remove Parsec

commit 152587fde2
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 15:12:36 2018 +0200

    Use cassava mega parsec

commit cf281577a3
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 14:01:47 2018 +0200

    Removed Data.Vector

commit 1272e8e758
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 12:16:18 2018 +0200

    Removed Parsec ParseError

commit ae07f04313
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 12:06:14 2018 +0200

    Type sinonim for ParsecError

commit 8e15b253c1
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 11:16:08 2018 +0200

    Replaced with typeclasses

commit 1ed46f9c17
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 11:01:33 2018 +0200

    Replaced Text/CSV with Cassava

commit 362f4111b5
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 10:34:37 2018 +0200

    Use cassava parsin instead of Text/CSV

commit 83e678e371
Author: Luca Molteni <volothamp@gmail.com>
Date:   Sat Jun 9 08:22:51 2018 +0200

    Text CSV error messages

commit f922df71d2
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 21:45:20 2018 +0200

    Better types

commit edd130781c
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 21:34:59 2018 +0200

    Conversion to Text CSV type

commit 0799383214
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 16:06:21 2018 +0200

    First function with cassava

commit e92aeb151f
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 13:47:34 2018 +0200

    Added cassava as dependency

commit 5ea005c558
Author: Luca Molteni <volothamp@gmail.com>
Date:   Fri Jun 8 13:18:47 2018 +0200

    Better .gitignore for multi idea modules
2018-09-07 12:34:51 -07:00
Simon Michael
9076474a09 lib: --forecast func tests note 2018-08-17 09:37:55 +01:00