Commit Graph

9492 Commits

Author SHA1 Message Date
Simon Michael
3a7c578f2d ;bal: doc: tweaks 2021-03-05 14:55:24 -08:00
Simon Michael
e521518eb6 ;bal: doc: tweaks 2021-03-05 10:43:47 -08:00
Simon Michael
2023e9cd65 ;bal: doc: more updates & cleanups (#1496) 2021-03-05 10:21:46 -08:00
Stephen Morgan
baab33b58d tools: Include more commodities and prices in generated journals. 2021-03-05 10:12:49 -08:00
Stephen Morgan
2aae54a02c test: Test bal --valuechange throws an error for bad --value options. 2021-03-05 10:09:14 -08:00
Stephen Morgan
efb37c3343 lib: Default to PeriodChange report when using ValueChangeReport. 2021-03-05 10:09:14 -08:00
Stephen Morgan
3f408c2117 lib,cli: Restore old --change option for per-period summation, use --sum for basic ValueChange balance report. 2021-03-05 10:09:14 -08:00
Simon Michael
ae73eea7cb ;bs,bse,cf,is: update docs 2021-03-04 10:26:58 -08:00
Simon Michael
7b8a873471 ;check: update manual 2021-03-03 15:43:38 -08:00
Stephen Morgan
d931e4919e cli: Allow overriding with --periodic (rather than the old --change) and properly calculate requestedspan in CompoundBalanceReport. 2021-03-03 15:43:02 -08:00
Simon Michael
e9f04d5ed6 check: ordereddates now checks each file separately (fix #1493) 2021-03-03 06:44:50 -08:00
Simon Michael
2505c69f80 lib: transactionFile 2021-03-03 06:44:25 -08:00
Simon Michael
642ad24b0e ;check: refactor 2021-03-03 06:06:39 -08:00
Simon Michael
ffb985f1a2 ui, web: make --man and --info work, similar to hledger
(cf #1410)
2021-03-03 05:57:31 -08:00
Simon Michael
cb0526381e ;bal: doc updates 2021-03-03 05:30:53 -08:00
Stephen Morgan
edaaef897b lib: Do not include price directives in journalDateSpan. Only include
price directives after the last transaction/posting date if using
--value=end.

Also enlarges the reportspan to encompass full intervals for budget
goals.
2021-03-03 05:26:55 -08:00
Simon Michael
ff5e810c78 ;bal: more doc updates 2021-03-03 04:10:23 -08:00
Simon Michael
dccd39171e ;gather investing examples 2021-03-03 04:09:41 -08:00
Simon Michael
4c9b72ea15 ;bal: mention --valuechange (#1480) 2021-02-27 18:53:05 -08:00
Simon Michael
f63c38a7e2 bal: docs rewritten, and updated for new flags 2021-02-27 18:51:44 -08:00
Stephen Morgan
7f2536a2a7 lib,cli: Add --valuechange report type for calculating change of value
of accounts, restore --value=end behaviour to that of hledger-1.19.
2021-02-27 18:42:02 -08:00
Stephen Morgan
351648e4fa lib,cli: Add --periodic option to indicate PeriodChange accumulation (renamed from --change). 2021-02-27 18:42:02 -08:00
Dmitry Astapov
18623ec287 doc: explain roi-unrealised.ledger, reference to cookbook 2021-02-25 15:11:35 -08:00
Simon Michael
7bfbcde627 Merge branch pr/Xitian9/1445 (Fix some space leaks, #1445)
- Consume list immediately in commodityStylesFromAmounts.

  This and/or the other strictness fixes below reduce memory and time
  usage, a lot, for journals with many @@ total prices.

- Include sign in TotalPrice in Amount, rather than relying on the sign of aquantity.
  Journal entries still require a positive @@ price, but now the sign is
  set after parsing, rather than when converting in amountToCost.
  The reason for this change is that, if we're going to perform arithmetic
  on Amount with TotalCost, then the presence of aquantity=0 means that
  amountToCost would render the total cost as 0, because signum 0 == 0.

  This makes amount arithmetic more consistent, and allows negative
  prices to be represented. It also means that total prices override
  the primary amount: 0A @@ 1B is now 1B, not 0.

- Make fields of Amount, AmountPrice, AmountStyle, and DigitGroupStyle
  strict.

- Distinguish between an Amount having quantity (or rounded quantity 0),
  and having both quantity and totalprice 0 (or rounded to 0).

- normaliseHelper now uses a strict Map for combining amounts
  internally, closing a big space leak.

  This also now combines Amounts with TotalPrices in the same commodity
  when normalising; amounts with TotalPrices were previously never
  combined.

- (amount|mixedAmount)(Looks|Is)Zero functions now check whether both
  the quantity and the cost are zero. This is usually what you want, but
  if you do only want to check whether the quantity is zero, you can run
  mixedAmountStripPrices (or similar) before this.
2021-02-23 15:22:51 -08:00
Dmitry Astapov
582a1651b3 roi: cmdline help simplified 2021-02-23 15:13:19 -08:00
Stephen Morgan
f0655d1c7f lib: (amount|mixedAmount)(Looks|Is)Zero functions now check whether
both the quantity and the cost are zero. This is usually what you want,
but if you do only want to check whether the quantity is zero, you
can run mixedAmountStripPrices (or similar) before this.

(multiply|divide)(Mixed)?Amount now also multiply or divide the
TotalPrice if it is present, and the old
(multiply|divide)(Mixed)?AmountAndPrice functions are removed.
2021-02-23 14:54:39 -08:00
Stephen Morgan
9d527a9926 lib: normaliseHelper now uses a strict Map for combining amounts
internally, closing a big space leak.

This also now combines Amounts with TotalPrices in the same commodity
when normalising; amounts with TotalPrices were previously never
combined.
2021-02-23 14:54:39 -08:00
Stephen Morgan
ecca7f4e0c lib: Distinguish between an Amount having quantity (or rounded quantity 0), and having both quantity and totalprice 0 (or rounded to 0). 2021-02-23 14:54:39 -08:00
Stephen Morgan
81b778a389 lib: Make fields of Amount, AmountPrice, AmountStyle, and DigitGroupStyle strict. 2021-02-23 14:54:39 -08:00
Stephen Morgan
2ada289e28 lib: Include sign in TotalPrice in Amount, rather than relying on the sign of
aquantity.

Journal entries still require a positive @@ price, but now the sign is
set after parsing, rather than when converting in amountToCost.

The reason for this change is that, if we're going to perform arithmetic
on Amount with TotalCost, then the presence of aquantity=0 means that
amountToCost would render the total cost as 0, because signum 0 == 0.
This makes journal entries like the following impossible to balance:
2000-01-01
    a  0 @@ 10 A
    b  -10 A
2021-02-23 14:54:39 -08:00
Stephen Morgan
a65ef7cd19 lib: Consume list immediately in commodityStylesFromAmounts.
This reduced the maximum heap size per thread from ~850K to ~430K in a
real-world register test.
2021-02-23 14:54:39 -08:00
Dmitry Astapov
150cf3f862 roi: roi-unrealised.example now works based on price directives 2021-02-23 14:11:29 -08:00
Dmitry Astapov
0fa51482c6 roi: check valuation on dates we have price directives for 2021-02-23 14:11:29 -08:00
Dmitry Astapov
8013d650f3 roi: honor all kinds of --value switches 2021-02-23 14:11:29 -08:00
Simon Michael
f4d81377af print --match: show --match's argument in debug output
If you forget that the argument is required by the --match
option, and not the command as a whole - eg if instead of

  hledger print --match somebank -x

you write:

  hledger print --match -x somebank

that gets quietly parsed as:

  hledger print --match="-x"

which is not great. Adding --debug now at least gives some insight:

  hledger print --match -x somebank --debug
  finding best match for description: "-x"
  similar transactions:
  ...
2021-02-20 14:29:40 -08:00
Simon Michael
5e7c4fc7bc add, print --match: prioritise infix matches
If the search description occurs in full within the other description,
that match gets a +0.5 score boost.
2021-02-20 14:08:47 -08:00
Simon Michael
44508f58c8 add, lib: debug output, refactor similar transactions lookup
add --debug=1 shows the top hits for similar past transactions.

added:
Hledger.Cli.Utils.journalSimilarTransaction
 provides --debug=1 output

changed:
Hledger.Cli.Commands.Add.transactionsSimilarTo -> Hledger.Data.Journal.journalTransactionsSimilarTo
 now takes an extra number-of-results argument
2021-02-20 13:41:37 -08:00
Simon Michael
7979c7d74c ;import: doc: tweak 2021-02-18 18:43:22 -08:00
Simon Michael
125ba49992 ;import: doc: tweak 2021-02-18 18:38:51 -08:00
Simon Michael
554f7a59fd ;import, print: better deduplication docs 2021-02-18 18:35:06 -08:00
Simon Michael
f7bbb39a77 ;regenerate cabal files with the hpack version in current stack
To minimise warnings. They got regenerated by a commit for #1471.
2021-02-18 13:42:40 -08:00
Simon Michael
286efc7b12 ;shake: use --markdown-headings to silence warning (& require pandoc-2.11.2+) 2021-02-17 12:11:15 -08:00
Simon Michael
b92a842728 ;update manuals 2021-02-17 12:07:23 -08:00
Simon Michael
f4c8b52885 ;update CLI usage texts 2021-02-17 12:07:06 -08:00
Arnout Engelen
ad2ab3c823 Make sure to round up for the 'to' date 2021-02-17 09:05:13 -08:00
Arnout Engelen
fe6e9a79fe Allow selecting the date range from the chart
By dragging a region with the mouse
2021-02-17 09:05:13 -08:00
Simon Michael
9cff45b2c5 ;journal: doc: note same-day P overrides --infer-market-value 2021-02-13 15:34:47 -08:00
Simon Michael
b31e40ceca lib: avoid shady Not (Or []) in account type queries 2021-02-13 14:58:06 -08:00
Simon Michael
6c392e9f43 bs: don't let just a Cash declaration hide Asset accounts
Clarify the account type queries a bit, and don't let a
declaration of account as Cash cause the fallback regex
for Asset accounts to be ignored.
2021-02-13 14:54:04 -08:00
Simon Michael
b9d33a4294 bs: just declaring a Cash account no longer hides Asset accounts
Since Cash is also an Asset, declaring an account as Cash also disabled the fallback regexp for Asset accounts.
2021-02-13 08:09:45 -08:00