Commit Graph

2270 Commits

Author SHA1 Message Date
Simon Michael
1087e790cf ;lib: refactor transactionCheckBalanced 2020-05-29 17:57:10 -07:00
Simon Michael
7bcc205622 lib: drop transactionPostingBalances 2020-05-29 17:33:53 -07:00
Simon Michael
0a5fa33f9d split more long transaction balancing errors into lines; refactor 2020-05-29 16:31:15 -07:00
Simon Michael
924ec1c98d journal: clearer transaction balancing errors; refactor
As mentioned by netvor on IRC, the unbalanced transaction error was
not too clear when postings all have the same sign.

Some other wording has been clarified, and the main error message is
now shown on multiple lines for readability (at the cost of
predictability/grepability..)

There's also a probably unnoticeable change: selecting which parts of
the error to show is now based on display precisions (reusing the
balanced check logic), rather than original precisions.
2020-05-29 16:07:58 -07:00
Simon Michael
61264cfdc0 lib: isNegativeMixedAmount handles all-negative multi-comm. amounts 2020-05-29 13:07:02 -07:00
Simon Michael
e6f9f09b41 ;lib: refactor, consolidate, add transactionCheckBalanced 2020-05-29 11:57:48 -07:00
Henning Thielemann
ec27eb6b17 ;web: maintain query when choosing a different 'inacct' account on the sidebar 2020-05-27 04:59:55 -07:00
Simon Michael
9417ee625e ;regen manuals 2020-05-25 17:49:01 -07:00
Simon Michael
93154e9251 update and clean up valuation docs (#1239) 2020-05-25 17:45:31 -07:00
Simon Michael
e1ddfc3a1b lib: also infer market prices from transactions, like Ledger (#1239) (WIP) 2020-05-25 17:45:31 -07:00
Dmitry Astapov
cbacef21eb lib: multiBalanceReport derives query from ReportOpts 2020-05-25 15:50:14 -07:00
Simon Michael
40c296a446 lib: rename finaliseJournal -> journalFinalise 2020-05-23 09:45:35 -07:00
Simon Michael
2c1cbb7956 ;csv: remove a comment breaking doctests 2020-05-12 18:01:05 -07:00
Simon Michael
f167c223a2 ;csv: emphasize regular expressions features and doc 2020-05-10 13:03:09 -07:00
Simon Michael
6b2dfad98c ;csv: clarify that whitespace is not stripped when matching 2020-05-09 15:43:44 -07:00
Simon Michael
3919f0945a ;csv: correction, that field equality trick was just a fluke 2020-05-09 15:37:11 -07:00
Simon Michael
8f1b2a32fa ;csv: start regexp examples section, show field equality testing 2020-05-09 13:35:45 -07:00
Simon Michael
3ef2fc9567 show a clearer error message on encountering a malformed regexp 2020-05-07 17:33:05 -07:00
Simon Michael
647a77225d ;journal: doc: tweak 2020-05-05 10:37:51 -07:00
Simon Michael
4999827eaf ;journal: doc: mention blank/unindented lines in transactions 2020-05-05 10:26:50 -07:00
Simon Michael
6935c46b2c ;regen cabal files with latest stack/hpack (2.3.1/0.33.0) 2020-05-02 17:31:35 -07:00
Vladimir Sorokin
5b88bfb834 csv: Increase maximum number of postings in CSV reader from 9 to 99.
The ordering of journalfieldnames is changed in order to comply with the requirement stated in the comment:
"Names must precede any other name they contain, for the parser".
If left unchanged, "account1" would precede "account11", "account12", and so on, which would break the parsing.
With the new ordering, "account11" precedes "account1".
2020-04-26 14:52:02 -07:00
Simon Michael
df92c36679 ;changelogs 2020-04-19 14:45:07 -07:00
Simon Michael
784d882e01 csv: combine amount assignments better, fix 1.17.1 regression (#1226) 2020-04-16 19:04:36 -07:00
Simon Michael
b149c0ba0c ;csv: tweak the too-many-amounts error more 2020-04-16 12:59:19 -07:00
Simon Michael
dd3db5a4e2 ;csv: doc: try to clarify status of unnumbered amount rules (#1226) 2020-04-16 09:07:17 -07:00
Simon Michael
3693fd4eb6 ;csv: mention doc url in too many amounts error (#1226) 2020-04-16 08:36:04 -07:00
Simon Michael
1428291dd6 don't let case of file extension break file format detection (#1225) 2020-04-15 11:31:28 -07:00
Simon Michael
e80b69fdc7 ;journal: doc: commmodity typo 2020-04-10 17:54:00 -07:00
Simon Michael
3b59a95a54 ;cli, journal: doc: consistent heading capitalisation, whitespace 2020-04-08 21:14:38 -07:00
Simon Michael
4195a55287 ;journal: fix double curly braces, since they are our m4 delimiters 2020-04-08 20:26:22 -07:00
Simon Michael
3ad2e50ec5 journal: also parse Ledger-style "virtual posting costs" - (@), (@@) 2020-04-08 20:22:03 -07:00
Simon Michael
847f924828 journal: comment fix 2020-04-08 20:00:18 -07:00
Simon Michael
f4a1a31712 journal: also support lot dates ([DATE]) 2020-04-08 19:55:55 -07:00
Simon Michael
fedde7fab1 journal: also support the total lot price variants ({{}}, {{=}}) 2020-04-08 19:18:39 -07:00
Simon Michael
5beeb56a87 ;journal: document improved lot price parsing; changelog 2020-04-08 19:02:24 -07:00
Simon Michael
ea3b290dd0 journal: more flexible, Ledger-compatible parsing of lot prices
We now accept (but still ignore) a fixed or nonfixed ({=} or {}) lot
price following a posting amount, and it may appear before or after a
transaction price (@ or @@). And it may no longer appear after a
balance assertion.

Also: fixedlotpricep renamed to lotpricep, now also parses non-fixed
lot prices. A bit of amount parsers cleanup.
2020-04-08 15:26:18 -07:00
Simon Michael
10f8dc84a5 period expressions: allow "until", like Ledger (synonym for "to") 2020-04-08 14:26:38 -07:00
Simon Michael
34dd7bf053 ;csv: clarify the rule file search directory a little 2020-04-08 12:25:38 -07:00
Simon Michael
898cda4ee5 ;changelogs 2020-04-06 18:38:38 -07:00
Simon Michael
3cc79a67f2 csv: don't discard explicit assignments of a 0 amount
Eg: an `amount1  $0.00` assignment was generating a posting1 with
missing amount.
2020-04-05 14:19:02 -07:00
Simon Michael
f219bba494 allow spaces between sign and number, when parsing 2020-04-04 14:18:04 -07:00
Simon Michael
741bfdc462 ;update cabal file 2020-03-30 15:28:42 -07:00
Simon Michael
216cf8d596 ;enable doctest with ghc 8.10 2020-03-30 15:28:11 -07:00
Simon Michael
9868d7f20d ;lib: update emacs code-folding config
orgstruct-mode was dropped from org 9.2, and I shouldn't have been
forcing it on anyway.

The new config allows its "replacement", outshine-mode, to do similar
code folding when you press tab on any of the lines matching
outline-regexp. But only if you patch it as mentioned at
https://github.com/alphapapa/outshine/issues/77.
Enable it by, eg: (add-hook 'haskell-mode-hook 'outshine-mode)
2020-03-28 17:09:47 -07:00
Simon Michael
293e2d81d1 ;changelogs 2020-03-25 18:42:26 -07:00
Simon Michael
e15eabdf15 csv: ignore amount if any amountN's are assigned; improve error msg
The change for hledger 1.17.1 broke one of my csv rules, where I used
`amount` but then tried to override it with `amountN`s in a
conditional block; the two clashed. Now in that situation any
`amountN`s take precedence, causing `amount` to be ignored entirely.

Also clarified the "too many non-zero amounts" error message a bit.
2020-03-25 18:09:41 -07:00
Pavan Rikhi
f574b782fa Fix Documentation for journalExpenseAccountQuery 2020-03-22 17:17:06 -07:00
Simon Michael
d868a7e170 ;update cabal files 2020-03-22 10:49:49 -07:00
Simon Michael
c6951bf7c6 ;doc: more tweaks to package readmes, hackage descriptions 2020-03-22 10:49:02 -07:00
Simon Michael
40d3a5c1f4 ;update cabal files 2020-03-22 09:28:10 -07:00
Simon Michael
9ca8d7cea9 ;update tested-with 2020-03-22 09:27:50 -07:00
Simon Michael
d59ccb260b ;doc: consistent markdown readmes for packages, part 2 2020-03-22 09:27:34 -07:00
Simon Michael
2b15418ddd ;update cabal files 2020-03-22 09:08:37 -07:00
Simon Michael
617c2ecbc5 ;doc: consistent markdown readmes for packages 2020-03-22 09:07:47 -07:00
Simon Michael
1a606870ca ;regen docs 2020-03-19 16:05:52 -07:00
Simon Michael
32dc29a1db ;journal: better link 2020-03-19 14:33:50 -07:00
Simon Michael
6e37d11bdd ;changelogs: typo, fix hledger-web item 2020-03-19 14:26:55 -07:00
Simon Michael
495dfa37a4 ;journal: document banker's rounding behaviour 2020-03-19 14:24:57 -07:00
Simon Michael
9631ca561c ;update changelogs "high water marks" 2020-03-19 14:09:37 -07:00
Simon Michael
4191aad049 ;update changelogs from release branch 2020-03-19 14:07:53 -07:00
Simon Michael
612a4d1c0e ;gen cabal 2020-03-19 11:38:05 -07:00
Simon Michael
5f2db97016 ;lib: disable doctest with GHC 8.10 for now (sol/doctest#246) 2020-03-19 11:37:55 -07:00
Simon Michael
96b4f0be4f require newer Decimal, math-functions, fixing inconsistent rounding
Decimal 0.5.1+ changed to banker's rounding (round to nearest even
number), and math-functions 0.3.3.0 (used by roi) fixed various
precision-related issues. Now we require the latest versions of these.
This was causing some functional test failures when building with old
GHCs/snapshots.
2020-03-19 10:10:55 -07:00
Simon Michael
05ad168792 ;regen manuals 2020-03-18 16:17:24 -07:00
Simon Michael
cf7de57836 ;update changelogs 2020-03-18 16:17:13 -07:00
Simon Michael
abc53024fc ;journal: doc: drop "transaction modifiers", just say "auto postings" 2020-03-18 15:11:31 -07:00
Simon Michael
31edd54c1a ;journal: clarify scope of auto posting rules (#1212) 2020-03-18 14:55:20 -07:00
Simon Michael
4e7a893efc ;csv: cleanup 2020-03-17 17:55:32 -07:00
Simon Michael
84165f5a0c ;journal: fix tests 2020-03-17 17:48:17 -07:00
Simon Michael
2cec32cebe journal: a more verbose commodity error message with examples 2020-03-17 13:36:48 -07:00
Simon Michael
6a01b1f438 ;lib, journal: fix some "decimal point" mentions 2020-03-17 13:36:19 -07:00
Simon Michael
a1361ecc04 csv: don't force a second posting with amount1
A rewrite and simplification of the posting-generating code. The
"special handling for pre 1.17 rules" should now be less noticeable.
amount1/amount2 no longer force a second posting or explicit amounts
on both postings. (Only amount/amount-in/amount-out do that.)
Error messages and handling of corner cases may be more robust, also.
2020-03-16 16:18:58 -07:00
Simon Michael
2aab02f4e8 ;journal: document directives/alias multi-file limitation clearly 2020-03-16 09:00:38 -07:00
Simon Michael
e0c3275d74 lib: debug helpers traceAt, traceAtWith 2020-03-11 19:08:05 -07:00
Simon Michael
8e04bd11fe ;doc: csv: clarify posting field rules, note a limitation 2020-03-10 15:01:52 -07:00
Simon Michael
70e85d8e4b ;doc: regen manuals
[ci skip]
2020-03-07 15:06:39 -08:00
Simon Michael
1883ff4499 bump to dev version 2020-03-07 15:06:18 -08:00
Simon Michael
be25c28822 ci: --pedantic is too much for now 2020-03-07 14:53:12 -08:00
Simon Michael
5639b47d85 ;ci: use --pedantic for all; fix a warning with unit test suites 2020-03-07 14:43:50 -08:00
Simon Michael
7ad0f9dd6d ;lib, cli: fix success-hiding in unit test suites 2020-03-07 14:10:22 -08:00
Simon Michael
5ab31f1111 ;lib, cli: hide successes in unit test suites' output 2020-03-07 04:00:55 -08:00
Simon Michael
3565f49acf ;re-enable doctest suite, with a workaround for cabal 3 (#1139) 2020-03-06 18:30:32 -08:00
Simon Michael
432b1c8ff4 ;doc: update manual versions
[ci skip]
2020-03-05 15:51:54 -08:00
Simon Michael
21fdcec6b7 journal: inclusive balance assignments now work (#1207) 2020-03-05 13:38:19 -08:00
Simon Michael
f18c74fff7 ;journal: a test for inclusive balance assignment, disabled (#1207)
[ci skip]
2020-03-05 11:19:04 -08:00
Simon Michael
5ed6fe586a ;refactor transaction balancing/checking (#1207) 2020-03-05 11:18:59 -08:00
Simon Michael
66d2897cc9 ;doc: changelog entry
[ci skip]
2020-03-02 12:49:16 -08:00
Stephen Morgan
e0dde6fe57 lib: Remove non-law-abiding Monoid instance for Journal. 2020-03-02 12:45:30 -08:00
Stephen Morgan
702c958487 lib: Replace some utility functions with library functions. 2020-03-02 12:45:30 -08:00
Simon Michael
61679e0178 ;lib: doc: changelog 2020-03-01 22:06:58 -08:00
Simon Michael
2ea66bcda4 ;lib: bump version to 1.17.0.1
hledger's first use of the fourth version component.
[ci skip]
2020-03-01 22:06:55 -08:00
Simon Michael
374be00223 ;lib: fix org headings and doctest setup that were breaking haddock
(and in some cases, installation).
[ci skip]
2020-03-01 22:00:39 -08:00
Simon Michael
6dfdc2bee8 ;one more cabal file update. Not in hackage tarballs. 2020-03-01 17:42:20 -08:00
Simon Michael
07a05d5c76 ;doc: finalise changelogs
More cleanup needed, but time's up.

[ci skip]
2020-03-01 17:33:18 -08:00
Simon Michael
061bf73b61 ;doc: regen manuals
[ci skip]
2020-03-01 17:29:01 -08:00
Simon Michael
ba44d00bed ;bump version to 1.17 2020-03-01 17:29:01 -08:00
Simon Michael
889767f1bd ;bump tested-with
[ci skip]
2020-03-01 17:28:43 -08:00
Simon Michael
04fb132496 ;doc: draft changelogs
[ci skip]
2020-03-01 16:44:28 -08:00
Simon Michael
752e8ed49a ;timedot: update docs 2020-03-01 14:06:29 -08:00