Commit Graph

3410 Commits

Author SHA1 Message Date
Michael Rees
d4ecdb3fea imp: Support tsv and ssv prefixes (#2164) 2024-02-08 06:44:44 -10:00
Simon Michael
aa69eb188a ;doc: update changelogs 2024-01-28 02:34:54 -10:00
Simon Michael
12e67e4859 dev: postingAddInferredEquityPostings: cleanup 2024-01-26 15:04:44 -10:00
Simon Michael
21adfe2c25 fix: really fix slowdown with many accounts [#2153]
The previous #2153 fix used accountNameTreeFrom, but it turns out this
has always had O(n^2) performance, so our tests with 10k accounts ran
even slower than before. Now it's faster, the main #2153 slowdown
should really be fixed, and other commands which build an account tree
should also be free of this slowdown when there are very many accounts.
2024-01-26 13:53:47 -10:00
Simon Michael
a38af98c9e fix: a slowdown with many txns and many accounts since 1.29 [#2153]
When processing costs and equity postings in transactions during
journal finalisation, we now pass just the conversion account name(s)
rather than the entire map of account types. This slowdown was severe
for some users/data/machines.
2024-01-25 13:49:49 -10:00
Simon Michael
508ccfc7d2 imp: balance assertions error: show costs detail with --debug=2 2024-01-23 22:18:34 -10:00
Simon Michael
54c60b4de9 imp: balance assertions error: clarify wording 2024-01-23 22:18:34 -10:00
Simon Michael
e694e7869d fix: check mixed-cost balances correctly again; cleanup (#2150)
The code is a bit clearer, and it no longer discards amounts other
than the first when the running balance contains multiple costs.
(This bug was exposed by the fix for #2039).
2024-01-23 21:35:07 -10:00
Simon Michael
8ec46baec9 dev: clarify behaviour of filterMixedAmountByCommodity, showMixedAmount* 2024-01-23 21:35:06 -10:00
Simon Michael
df79aa5e35 dev: distinguish oneLineFmt and oneLineNoCostFmt; add fullZeroFmt 2024-01-23 21:35:06 -10:00
Simon Michael
999cba8c31 dev: cleanup; add showAmountWith, showMixedAmountWith 2024-01-23 21:35:06 -10:00
Simon Michael
0cb382cf0e dev: rename AmountDisplayOpts -> AmountFormat, and related constants
noColour          -> defaultFmt
noCost            -> noCostFmt
oneLine           -> oneLineFmt
csvDisplay        -> machineFmt
2024-01-23 21:35:06 -10:00
Simon Michael
e2ed2b3b6d dev: clarify showAmountsCostB 2024-01-23 21:35:06 -10:00
Simon Michael
ca55c2f0f8 dev: rename other Price helpers to Cost
showAmountWithoutPrice             -> showAmountWithoutCost
mixedAmountStripPrices             -> mixedAmountStripCosts
showMixedAmountWithoutPrice        -> showMixedAmountWithoutCost
showMixedAmountOneLineWithoutPrice -> showMixedAmountOneLineWithoutCost
2024-01-23 21:35:06 -10:00
Simon Michael
323f87b3e9 dev: Amount: aprice -> acost
Acked-by: Simon Michael <simon@joyful.com>
2024-01-23 21:35:06 -10:00
Simon Michael
8102bd9c2b dev: AmountPrice,UnitPrice,TotalPrice -> AmountCost,UnitCost,TotalCost; related renames 2024-01-23 21:35:06 -10:00
Simon Michael
e201775e93 dev: amountStripPrices -> amountStripCost 2024-01-23 21:35:06 -10:00
Simon Michael
0353840d90 dev: showAmountPrice -> showAmountCostB, showAmountPriceDebug -> showAmountCostDebug 2024-01-23 21:35:06 -10:00
Simon Michael
ac47ea4a0e imp:balance assertion error message: make it clearer, show diff again 2024-01-21 15:02:51 -10:00
Simon Michael
41711d8ab5 fix:--anon: now hidden, gives an error, still usable as --obfuscate [#2133] 2024-01-21 11:59:11 -10:00
Simon Michael
c2ce1c2037 imp:close: add tags, with optional custom value, for easier matching/exclusion [#2151]
They are `balances:` for assertion transactions,
`retain:` for retained earnings transactions,
and `start` for opening/closing transactions.

And some --help cleanups.
2024-01-21 01:44:14 -10:00
Simon Michael
298a9c29b4 ;dev: Query comments 2024-01-21 00:57:30 -10:00
Simon Michael
352b0bc1b5 ;doc: update manuals 2024-01-12 13:52:11 -10:00
Simon Michael
9ccc1d3fa5 fix:add,import,web: really avoid filenames ending with . on Windows [#1056]
On MS Windows, trying to add or import or web add to a file whose name
ends with a dot could cause data loss, so in 2019 I made this raise an
error instead (in Hledger.Read.ensureJournalFileExists).

But, the logic was backward, so it did not do the check on Windows.
Now it does.

Also I have removed mention of this from add's doc; currently it's
not documented anywhere. It's obscure, but maybe this is not ideal.
2024-01-04 17:35:22 -10:00
Simon Michael
a0922a3866 ;cabal: update cabal files 2024-01-04 08:25:13 -10:00
Simon Michael
2a99b3d456 imp: stack: build with ghc 9.8, latest stackage nightly 2024-01-04 08:24:50 -10:00
Simon Michael
1648d2bcb7 fix:check:tags: also ignore builtin modified, _modified tags [#2148]
These tags are generated by --auto.
2024-01-04 05:55:24 -10:00
Simon Michael
6d455e765c ;doc:changelogs: cleanup 2024-01-03 20:43:39 -10:00
Simon Michael
5b1281fc69 ;doc: update changelogs 2024-01-03 20:42:28 -10:00
Simon Michael
ea34562b4b ;doc: changelogs 2024-01-03 20:42:04 -10:00
Simon Michael
0a838bdd6c ;doc:changelogs: cleanup for easier merge 2024-01-03 20:41:36 -10:00
Simon Michael
1128927632 ;doc:changelogs: whitespace 2023-12-30 20:29:49 -10:00
Simon Michael
8b45d4ba8c fix:csv: fix %FIELD interpolation in assignments using \n [#2134]
In field assignment values we now parse %FIELD references, \MATCHGROUP references
and "\n" newline markers more carefully, so all can coexist.
Parsing these values might be slower than before, but hopefully not noticeably so.
2023-12-23 19:25:34 -10:00
Simon Michael
20c299684b dev:csv: clarify renderTemplate [#2134] 2023-12-23 19:25:22 -10:00
Simon Michael
8f6b7b202e fix: traceOrLog and a rare warning from valuation code
Hledger.Utils.Debug.traceOrLog was logging when it should trace and vice versa.

This affected a warning which Hledger.Data.Valuation.pricesShortestPath
should display if encountering a pathologically long (>1000) price chain.
Also note some oddities about that warning.
2023-12-23 19:22:33 -10:00
Simon Michael
42c7383f57 ;dev:Hledger.Utils.Parse: cleanup 2023-12-23 19:22:33 -10:00
Simon Michael
4b7e7f77bd ;dev:Hledger.Utils.Debug: haddockify some comments so they show in hover 2023-12-23 19:22:33 -10:00
Simon Michael
9c56ed1104 imp!:web:tests: respect options when running tests
The hledger-web tests have been cleaned up and now allow more testing
of command line options like (though still not everything).

Note tests now run the app listening on its default host and port,
127.0.0.1 and 5000, instead of "any IPv4 or IPv6 hostname" and 3000.
This would seem to mean hledger-web tests can conflict more with
things running on port 5000, eg a normal hledger-web instance, but I
haven't been able to reproduce it.
2023-12-15 09:57:01 -10:00
Simon Michael
fbd2fdef40 ;cabal: update cabal files 2023-12-14 08:58:02 -10:00
Simon Michael
a3290bfaeb pkg: allow megaparsec 9.6* 2023-12-14 08:57:42 -10:00
Simon Michael
aaf4a38161 fix:timedot: accept numbers beginning with a decimal point again [#2130] 2023-12-08 15:08:35 -10:00
Simon Michael
51224f6e27 fix: bal --budget --layout=tall was hiding commodity symbols
When reports want to render amounts without commmodity symbols,
they must now use AmountDisplayOpts' new displayCommodity flag.
(Previously it was a side effect of setting displayCommodityOrder.)
2023-12-08 05:52:29 -10:00
Simon Michael
0bc86c95e4 lib: Hledger.Data.Amount: noPrice -> noCost 2023-12-07 23:35:50 -10:00
Simon Michael
862b7e5712 dev: clarify AmountDisplayOpts, add a new flag for symbol display 2023-12-07 23:35:50 -10:00
Simon Michael
9bad34c341 ;doc: changelogs 2023-12-07 11:36:39 -10:00
Simon Michael
7ace5ee560 ;doc: changelogs for 1.32.1 2023-12-07 11:32:20 -10:00
Simon Michael
c062b14c5d imp: auto-declare builtin tag names like type: and t: (#2119)
Now using type: in account declarations or generating t: with timedot
letters won't cause the `tags` check to fail.

If a user declares any of these explicitly with a tag directive,
it does not cause an error.
2023-12-07 08:55:05 -10:00
Simon Michael
6ae64c8f3e imp: allow declaring the empty payee name with "" (#2119) 2023-12-07 08:30:55 -10:00
Simon Michael
6a41ed9e64 imp: drop the "a difference of ..." line from balance assertion errors
Rationale:
To satisfy the recentassertions check I'm often filling in a bunch of
placeholder balance assertions, copy/pasting the correct amount from
the balance assertion failure messages. In this situation the
difference just repeats the amount in the line above, with opposite
sign, which makes it harder for me to interpret the message and to
copy-paste the right amount. And more generally I think showing the
difference isn't really necessary.
2023-12-07 07:58:52 -10:00
Simon Michael
c6a580ff3b fix:import: save each file's latest dates, separately (#2125) 2023-12-07 03:41:31 -10:00