Commit Graph

2134 Commits

Author SHA1 Message Date
Simon Michael
b81f8f768d ;csv: amount-setting notes, doc improvements from reddit discussion
https://www.reddit.com/r/plaintextaccounting/comments/nxu1ss/hledger_parsing_csv_with_negative_amount_in_debit/
2021-06-11 16:30:43 -10:00
Simon Michael
665fec83cd
Merge pull request #1560 from Xitian9/rationalisevaluation
Clean up valuation functions, and make clear which to use where.
2021-06-07 19:02:44 -10:00
Stephen Morgan
0f1837816d lib,cli,ui,web: Add check balancednoautoconversion command, which checks that
transactions are balanced possibly using explicit prices, but without
inferring any prices. This is included in --strict mode.

Renames check autobalanced to check balancedwithautoconversion.
2021-06-07 18:58:58 -10:00
Stephen Morgan
0a019e2167 lib,cli,web,bin: Replace journalSelectingAmountFromOpts with journalApplyValuationFromOpts.
This also has the effect of allowing valuation in more reports, for
example the transactionReport.
2021-06-08 14:55:05 +10:00
Stephen Morgan
68e975adf1 lib,cli,ui,web: Remove unused LANGUAGE pragmas. 2021-06-07 17:33:54 -10:00
Stephen Morgan
55308e1ca8 lib,cli,ui,web: Remove unnecessary CPP when dropping support for GHC 8.2. 2021-06-07 17:33:54 -10:00
Simon Michael
f156375ee7 Revert "balcmds: note that csv output forces list mode (#1566)"
This reverts commit 3f6d7ba580.
CSV output doesn't force list mode, it forces full account names.
2021-06-06 18:35:01 -10:00
Simon Michael
9d2d8ac24f ;balcmds: clarify tests a little for #1566 2021-06-06 18:34:58 -10:00
Simon Michael
3f6d7ba580 balcmds: note that csv output forces list mode (#1566) 2021-06-06 17:57:16 -10:00
Stephen Morgan
5a322c1908 cli: Make sure full account name is used (possibly including dropping)
for csv output. (#1566)
2021-06-06 17:56:34 -10:00
Stephen Morgan
bf22c3efdd lib,cli: Replace concat(Top|Bottom)Padded with textConcat(Top|Bottom)Padded. 2021-06-03 23:23:54 -10:00
Stephen Morgan
0e59fee251 lib,cli: Export Text.Tabular from Text.Tabular.AsciiWide, clean up import lists. 2021-06-03 23:23:54 -10:00
Simon Michael
b681cde62d ;update cabal files 2021-06-03 14:08:47 -10:00
Simon Michael
58b481ca5b stack: updated tested-with to 8.6+ 2021-06-03 14:07:39 -10:00
Stephen Morgan
bf063e4538 cli,ui,web: Display full git description in --version report if able.
Remove unused prognameanddetailedversion code branches.
2021-06-02 19:46:18 -10:00
Simon Michael
1e2ff1315b Don't infer a txn price with same-sign amounts (#1551) 2021-06-02 15:22:57 -10:00
Simon Michael
566190df56 ;doc: account aliases: emphasise scope 2021-05-19 17:02:32 -10:00
Simon Michael
6a3019c5a8 ;update manuals 2021-05-18 10:51:03 -10:00
Simon Michael
031219e792 ;doc: clarify report intervals' effect on begin/end dates (#1561) 2021-05-18 10:50:52 -10:00
Simon Michael
0727736bff ;update CLI usage texts 2021-05-18 10:35:55 -10:00
Simon Michael
0b15d5771a ;update manuals 2021-05-18 10:35:43 -10:00
Simon Michael
701768765a ;doc: report intervals: expand this doc (#1561) 2021-05-18 10:34:40 -10:00
Stephen Morgan
efaa199a82 doc: Mention expansion of report start and end dates in report intervals. 2021-05-18 10:02:10 -10:00
Simon Michael
d3b20675d0 tools: really regenerate the cabal files with stack's hpack
hpack has dropped the hash at last, this should help a lot to reduce
edit conflicts and commit noise.
2021-05-14 16:14:06 -10:00
Simon Michael
239558dd75 ;doc: cli: quick links 2021-05-14 08:46:15 -10:00
Simon Michael
762080058e ;doc: cli: simplify shortcut links: the [] is not needed, hopefully 2021-05-14 08:39:33 -10:00
Simon Michael
c90d89e4fb ;doc: cli: simplify internal links 2021-05-14 08:38:57 -10:00
Simon Michael
d6c12d5379 ;doc: cli: organise common markdown links 2021-05-14 08:34:54 -10:00
Simon Michael
7acfb63e9b ;doc: check: cleanup 2021-05-14 08:30:56 -10:00
Simon Michael
41c8e1f6ef ;regen cabal files with latest stack's hpack (0.34.4) 2021-05-14 08:17:56 -10:00
Simon Michael
1e44371e81 ;doc: cli: more regular expressions linkage 2021-05-14 07:37:13 -10:00
Simon Michael
07128cbb05 ;doc: check: ordereddates: clarify within in each file 2021-05-14 07:36:35 -10:00
Stephen Morgan
dc16451de0 lib: Remove unused (amount|mixedAmount|posting|transaction)ApplyCostValuation functions. 2021-05-07 22:25:19 +10:00
Simon Michael
a722ab4338 ;doc: strict mode: fix check link 2021-05-06 14:51:25 -10:00
Simon Michael
4b3358f6df ;doc: strict mode: link to check command 2021-05-06 14:31:46 -10:00
Stephen Morgan
d1467d4766 lib: When inferring total prices, use the precision of toamount, rather than NaturalPrecision. 2021-05-02 21:14:36 +10:00
Stephen Morgan
686a0871a9 lib: Make sure fromamount and toamount have opposite signs when inferring prices.
Also change priceInferrerFor so that it would give the correct
(negative) prices when fromamount and toamount have the same sign.
2021-05-02 21:14:36 +10:00
Stephen Morgan
0078f1a520 lib: Infer prices correctly even when there are only balance assignments. 2021-05-01 09:45:29 -10:00
Stephen Morgan
7cb621b82f lib,cli,ui,bin: Remove unnecessary normalisedMixedAmount, replace
normaliseMixedAmountSquashPricesForDisplay with mixedAmountStripPrices.
2021-05-01 09:45:29 -10:00
Stephen Morgan
4780a02e5a lib,cli: Remove showAmounts*B functions, replacing them entirely with showMixedAmount*B functions. 2021-05-01 09:45:29 -10:00
Stephen Morgan
5e7b69356f lib: Change internal representation of MixedAmount to use a strict Map
instead of a list of Amounts. No longer export Mixed constructor, to
keep API clean (if you really need it, you can import it directly from
Hledger.Data.Types). We also ensure the JSON representation of
MixedAmount doesn't change: it is stored as a normalised list of
Amounts.

This commit improves performance. Here are some indicative results.

hledger reg -f examples/10000x1000x10.journal
- Maximum residency decreases from 65MB to 60MB (8% decrease)
- Total memory in use decreases from 178MiB to 157MiB (12% decrease)

hledger reg -f examples/10000x10000x10.journal
- Maximum residency decreases from 69MB to 60MB (13% decrease)
- Total memory in use decreases from 198MiB to 153MiB (23% decrease)

hledger bal -f examples/10000x1000x10.journal
- Total heap usage decreases from 6.4GB to 6.0GB (6% decrease)
- Total memory in use decreases from 178MiB to 153MiB (14% decrease)

hledger bal -f examples/10000x10000x10.journal
- Total heap usage decreases from 7.3GB to 6.9GB (5% decrease)
- Total memory in use decreases from 196MiB to 185MiB (5% decrease)

hledger bal -M -f examples/10000x1000x10.journal
- Total heap usage decreases from 16.8GB to 10.6GB (47% decrease)
- Total time decreases from 14.3s to 12.0s (16% decrease)

hledger bal -M -f examples/10000x10000x10.journal
- Total heap usage decreases from 108GB to 48GB (56% decrease)
- Total time decreases from 62s to 41s (33% decrease)

If you never directly use the constructor Mixed or pattern match against
it then you don't need to make any changes. If you do, then do the
following:

- If you really care about the individual Amounts and never normalise
  your MixedAmount (for example, just storing `Mixed amts` and then
  extracting `amts` as a pattern match, then use should switch to using
  [Amount]. This should just involve removing the `Mixed` constructor.
- If you ever call `mixed`, `normaliseMixedAmount`, or do any sort of
  amount arithmetic (+), (-), then you should replace the constructor
  `Mixed` with the function `mixed`. To extract the list of Amounts, use
  the function `amounts`.
- If you ever call `normaliseMixedAmountSquashPricesForDisplay`, you can
  replace that with `mixedAmountStripPrices`. (N.B. this does something
  slightly different from `normaliseMixedAmountSquashPricesForDisplay`,
  but I don't think there's any use case for squashing prices and then
  keeping the first of the squashed prices around. If you disagree let
  me know.)
- Any remaining calls to `normaliseMixedAmount` can be removed, as that
  is now the identity function.
2021-05-01 09:45:29 -10:00
Simon Michael
32b42a6c80 ;journal: another test for #1532 2021-04-21 08:09:36 -10:00
Simon Michael
bf7255402c ;journal: add, renumber commodity parse tests (#1532) 2021-04-20 10:37:31 -10:00
Simon Michael
f58fcd95ab ;journal: tests demonstrating commodity parse errors (#1532) 2021-04-20 09:55:11 -10:00
Simon Michael
8cf193547e ;bal: doc: balance features: fix --valuechange link 2021-04-19 16:17:36 -10:00
Simon Michael
39623934c3 ;doc: cli: a note about redirecting debug output 2021-04-17 20:18:05 -10:00
Simon Michael
fe846a0c7f ;lib: comments 2021-04-17 16:06:20 -10:00
Simon Michael
1afb84c95d lib: outputFileFromOpts now returns a maybe; cleanups 2021-04-17 14:51:24 -10:00
Simon Michael
4b5ad69eb1 ;doc: declaring commodities: better link 2021-04-16 12:19:57 -10:00
Simon Michael
ea812f8f34 ;doc: commodity display style: correction 2021-04-16 12:15:52 -10:00