Henning Thielemann
96e0500ea7
cli: Commands.Register.postingsReportItemAsRecord: format transaction index as integer
...
lib: Write.Spreadsheet.Type: new TypeInteger
2024-10-18 00:07:11 -10:00
Henning Thielemann
b23753f5ae
cli: Commands.Register.postingsReportItemAsRecord: export amounts as number plus commodity
...
lib: Write.Spreadsheet.cellFromMixedAmount, cellsFromMixedAmount: taken from Cli.Balance
2024-10-18 00:07:11 -10:00
Henning Thielemann
d7b713f958
lib: Write.Ods.styleNames: common generation of ODS style names for both formatCell and cellConfig
2024-10-18 00:07:11 -10:00
Henning Thielemann
fe53b9b6ee
lib: Write.Ods: disambiguate style names for DataMixedAmount and DataString (bugfix)
2024-10-18 00:07:11 -10:00
Henning Thielemann
991c56caef
cli: Commands.Register.postingsReportAsSpreadsheet: generalize CSV output to HTML and FODS
2024-10-18 00:07:11 -10:00
Simon Michael
0f7aaa9600
imp: check accounts: simplify confusing suggestion in error message, 2
2024-10-16 21:19:51 -10:00
Simon Michael
36d1093b84
imp: check accounts: simplify confusing suggestion in error message
2024-10-15 16:36:54 -10:00
Henning Thielemann
9d1ba5c588
cli: CompoundBalanceCommand.compoundBalanceReportAsSpreadsheet: common function for CSV, HTML, FODS export
2024-10-14 20:59:51 -10:00
Simon Michael
71a7879213
fix:check tags: _price-matched -> _cost-matched, and whitelisted [ #2247 ]
2024-10-14 14:49:18 -10:00
Henning Thielemann
b8497c830e
lib: Write.Spreadsheet.headerCell, addRowSpanHeader, rawTableContent: taken from Commands.Balance
2024-10-14 11:35:12 -10:00
Simon Michael
2a374668e4
dev: Write.Beancount: isUpperCase -> isUpper to support ghc < 9.6
2024-10-14 11:02:21 -10:00
Simon Michael
aff3cd0591
imp:print:beancount: more robust conversion of commodity names
2024-10-11 14:56:03 -10:00
Simon Michael
6dd9c92d32
lib: add Hledger.Data.Currency, currencySymbolToCode, currencyCodeToSymbol
2024-10-11 14:56:03 -10:00
Simon Michael
66fce53c0b
dev: extract beancount output helpers to Hledger.Write.Beancount
2024-10-10 23:25:07 -10:00
Simon Michael
21a84fb336
fix: calculate value correctly when P amounts have few decimal digits [ #2254 ]
...
Valuation in another commoditay could sometimes be inaccurate if the P
price amounts did not have enough decimal places.
2024-10-08 23:11:57 -10:00
Simon Michael
4e6f6611a6
dev: fix DisplayName's off-by-one indent value, noted in #2246
...
Now displayIndent (and prrIndent) 0 means no indent, 1 means one
indent step, etc.
2024-10-08 23:11:57 -10:00
Simon Michael
6ce5e85e99
dev: clarify: rename displayDepth/prrDepth to displayIndent/prrIndent
...
These are about indentation for rendering, not account depth;
these are not always directly related, eg when boring parents are elided.
2024-10-08 23:11:57 -10:00
Simon Michael
8c71d071d7
imp:print:beancount:convert account names more robustly; better errors
2024-10-03 23:19:32 -10:00
Simon Michael
e157bb4a6b
dev: Hledger.Write.Ods: fix build with ghc <9.6
2024-09-30 17:20:13 -10:00
Simon Michael
6773e92361
dev: Hledger.Write.Ods: follow global-then-local-imports convention
2024-09-30 17:20:13 -10:00
Simon Michael
c92b601028
dev: fix warnings with ghc 9.10 / base 4.20
...
Older ghc versions should also still build cleanly (tested with 9.8 so far).
I don't like enabling CPP in so many modules but it's easier that
figuring out how to do it with base-compat; hopefully no noticeable
compilation impact.
2024-09-30 17:20:13 -10:00
Simon Michael
cc7ba473ec
imp: bal: html output will use a hledger.css file, like bs/cf/is
2024-09-29 21:22:38 -10:00
Henning Thielemann
5565f11c73
cli: Commands.Balance.multiBalanceReportAsSpreadsheetHelper: vertically merge cells showing account names and Total
...
lib: Write.Spreadsheet: add support for cell spans
2024-09-29 19:25:05 -10:00
Henning Thielemann
2f9a8031b0
lib: Write.Html -> Write.Html.Lucid
...
Write.Html: keep common definitions for both HTML backends
2024-09-29 13:27:51 -10:00
Henning Thielemann
cc7e034d64
lib: Write.Html.Blaze: alternative to Lucid based export
...
for compatibility with hledger-web/yesod
2024-09-29 13:27:51 -10:00
Henning Thielemann
d8fc30f7c5
lib: Write.Html.Attribute.tableStyle: style definitions taken from Commands.Balance.multiBalanceReportAsHtml
...
avoid duplicate with Write.Html.printHtml
Write.Html.Attribute: remove dependency on Lucid
2024-09-29 13:27:51 -10:00
Henning Thielemann
499c626e48
lib: Write.Spreadsheet: support for anchors in HTML and FODS export
...
cli: Commands.Balance: new option --base-url
It adds hledger-web-compatible hyperlinks to account names.
2024-09-28 22:12:51 -10:00
Simon Michael
823be7c565
fix: csv: tags on following lines, and posting dates, also work now [ #2241 ]
...
Follow-on work from #2214 .
2024-09-28 18:54:43 -10:00
Simon Michael
b28468e651
dev: clarify some confusing comment parsers a bit [ #2241 ]
2024-09-28 18:53:46 -10:00
Henning Thielemann
6ce6c72fd4
lib: Write.Html.Attributes: extracted HTML output helpers from Cli.Commands.Balance
2024-09-24 22:51:30 -10:00
Henning Thielemann
ff397f79cc
lib: Write.Spreadsheet.Cell: add cellClass field for HTML style class
...
cmd: Commands.Balance.multiBalanceRowAsCellBuilders: add HTML style class attributes here
This way we do not need to dissect table rows in
multiBalanceReportHtmlHeadRow, multiBalanceReportHtmlBodyRow, multiBalanceReportHtmlFootRow
Eventually removed these three functions.
2024-09-11 13:51:09 -07:00
Henning Thielemann
55c1246598
cli: Commands.Balance.budgetReportAsSpreadsheet: also transpose border
2024-09-11 13:51:09 -07:00
Henning Thielemann
2ed13afed4
lib: Write.Spreadsheet: support for borders like in existing HTML export
...
cli: Commands.Balance: use for FODS export and balance and budget export to HTML
2024-09-11 13:51:09 -07:00
Simon Michael
5cbbdb4670
imp: reg --sort: show supported keys in help and error message [ #2211 ]
2024-09-09 14:04:43 -07:00
Michael Rees
e34fa491af
Add abs implementation for MixedAmount
2024-09-05 11:56:07 +01:00
Michael Rees
52253c01f6
Add absamount as --sort field for register
2024-09-05 11:56:07 +01:00
Michael Rees
693360344c
Add desc/description as possible sort field
2024-09-05 11:56:07 +01:00
Michael Rees
25bcf3eebb
;Don't apply sort spec when only sorting by date
...
If there is no sort spec given, then the postings are already sorted by
date, so there's no need to apply the default sort spec again.
2024-09-05 11:56:07 +01:00
Michael Rees
275c72b770
; Use defsortspec everywhere instead of hard-coding default
2024-09-05 11:56:07 +01:00
Michael Rees
b429f57afb
Show error message on conflicting --sort and -H
2024-09-05 11:56:07 +01:00
Michael Rees
b4a9f87fe4
Move SortSpec to Hledger.Reports.ReportOptions
...
As part of this migration, I also switched from using Data.List.splitOn
to Hledger.Utils.splitAtElement.
2024-09-05 11:56:07 +01:00
Michael Rees
00eb0aa16b
feat: register: add --sort as in ledger
2024-09-05 11:56:07 +01:00
Simon Michael
3fbad1892d
dev: rename some Intervals for clarity [ #2218 ]
2024-09-04 16:07:54 +01:00
Simon Michael
038ebd8c7a
fix: three more interval start date cases; add tests; cleanup [ #2218 ]
2024-09-04 16:07:54 +01:00
Simon Michael
c8b6ca7b70
fix: 'every Nth day of month from DATE' start date [ #2218 ]
2024-09-04 16:07:54 +01:00
Simon Michael
375fb07ede
;dev: cleanups
2024-08-29 10:07:02 +01:00
Henning Thielemann
3af8eb3bc6
cli: Command.Balance: use Date format for dates in LayoutTidy
2024-08-16 16:57:38 +02:00
Henning Thielemann
da61b64f94
cli: Command.Balance: support FODS export for multibalance
...
Data.Amount.showMixedAmountLinesPartsB: new helper function
2024-08-16 16:57:38 +02:00
Henning Thielemann
66a047aade
lib: Write.Spreadsheet.Cell: add type parameter for the text type
...
instance Functor Cell
This way you can choose between Text, Lazy.Text, WideBuilder for cell content.
2024-08-16 16:57:38 +02:00
Henning Thielemann
f306df6d61
imp: lib: Write.Html: use Lucid to generate HTML
2024-08-16 16:57:38 +02:00
Henning Thielemann
8c42a735c2
cli: lib: Write.Spreadsheet: common data types for Write.Ods and Write.Html
...
Write.Html: write spreadsheet data to a HTML table
enables HTML export for the balance command
2024-08-16 16:57:38 +02:00
Henning Thielemann
29b67691fb
cli: Write.Ods: also use a number cell if the total amount has a single commodity
2024-08-16 16:57:38 +02:00
Henning Thielemann
2a1f3920c6
lib: Write.Ods.escape: escape cell contents
2024-08-16 16:57:38 +02:00
Henning Thielemann
ba0db5feec
cli: Write.Ods: write single amounts as numbers with units
...
This way you can do computations with the numbers in LibreOffice Calc.
2024-08-16 16:57:38 +02:00
Henning Thielemann
7b136600fa
cli: Cli.Balance.balanceReportAsFods: use distinguished cell formatting styles
2024-08-16 16:57:38 +02:00
Henning Thielemann
0e158d0c3e
cli: lib: Hledger.Write.Ods: basic support for FODS export
...
used in Commands.Balance
2024-08-16 16:57:38 +02:00
Henning Thielemann
14b5a1f82a
imp: Hledger.Read.CsvUtils -> Write.Csv
2024-08-16 16:57:38 +02:00
Simon Michael
d19b353bfb
imp: improve bad regexp error message
...
Eg '(?:foo)' is not malformed, it's just not supported.
https://hledger.org/hledger.html#hledgers-regular-expressions
2024-07-24 11:06:13 +01:00
Simon Michael
4b3abfd470
;imp: check: recentassertions: improve message readability
2024-07-16 22:12:41 +01:00
Simon Michael
40620666f8
imp: cli: rename --rules-file to --rules; tweak options help
...
For brevity, and consistency with --conf.
--rules-file remains supported, as a hidden option.
hledger's main mode now supports the hidden legacy flags,
as the command modes do.
2024-06-25 18:37:55 +01:00
Simon Michael
969b5a89d1
dev: comment parsing tests/refactoring, fix indented timedot comments
2024-06-25 18:37:54 +01:00
Simon Michael
713c3f4067
imp: TimedotReader: trace parsing at debug level 9
2024-06-25 18:37:54 +01:00
Simon Michael
6b24c09a58
feat: config file: ignore unsupported general options; refactor
2024-06-25 18:37:54 +01:00
Simon Michael
e1991be46f
feat: config file: add a real parser, support command-specific options
2024-06-25 18:37:54 +01:00
Simon Michael
f5c2ec681c
dev: refactor: merge Text.Megaparsec.Custom into Hledger.Utils.Parse
2024-06-25 18:37:54 +01:00
Simon Michael
07a4b21620
dev: refactor: move emptyorcommentlinep'; hlint
2024-06-25 18:37:54 +01:00
Simon Michael
6c47fa034a
;dev: update doctests for weekly headings change [ #2204 ]
2024-06-25 18:36:43 +01:00
Simon Michael
49c4ccd0b7
dev: Hledger.Utils.IO: fix hlint warnings
2024-06-25 07:45:27 +01:00
Victor Mihalache
60efd035f5
imp: abbreviate week naming for weekly reports
2024-06-14 09:37:32 +01:00
Simon Michael
1a242c1264
dev: refactor table rendering code
...
- Consolidate some table rendering helpers in Balance.hs
- Rename, document for clarity
- Extract parameters for controlling table borders
- hlint suggestions
2024-06-12 05:01:48 +01:00
Simon Michael
5b83e5c2f0
;dev: cleanup [ #2202 ]
2024-06-10 08:46:19 +01:00
Simon Michael
e89bea8563
fix: handle account type declarations in multiple files correctly [ #2202 ]
...
Tags and types declared in account directives in sibling files or
included files are now combined more carefully.
In particular, when merging two Journals into one,
- jdeclaredaccounttags and jdeclaredaccounttypes no longer lose information;
any duplicated/conflicting tag/type values are preserved.
- jaccounttypes now prefers the last type declared in case of
conflict, not the first.
2024-06-10 08:32:54 +01:00
Simon Michael
8d1ad8a3fe
lib: add journalDbg, for inspecting Journal fields
2024-06-10 08:26:58 +01:00
Simon Michael
0ccfc78844
;dev: cleanup
2024-06-07 06:32:52 -07:00
Simon Michael
1fe7e7af8c
imp: cli: --color now also accepts y or n, like --pretty
2024-05-29 09:37:20 -10:00
Simon Michael
605f8446e5
fix:pkg: fix a doctest failure with ghc 8.10
2024-05-17 15:08:26 -10:00
Simon Michael
e0f017f544
;dev: journalFinalise: doc update
2024-05-08 12:40:06 -10:00
Simon Michael
b7e5c05da2
imp: -I can now be overridden by -s or the check command
...
This enables a "relaxed" workflow where you delay balance assertions
checking until strict mode is turned on: always run hledger -I, and
add -s when you're ready.
2024-05-07 15:44:06 -10:00
Simon Michael
243a96b656
dev: clarify how readJournalFiles defers checks, and use a dedicated flag
2024-05-02 21:36:32 -10:00
Simon Michael
ea58a7ccd7
imp: check: check ordereddates before balance assertions, when both are enabled
2024-05-02 21:11:04 -10:00
Simon Michael
490a46fcd2
fix: journal: parse include directives with trailing whitespace
...
[https://github.com/adept/full-fledged-hledger/issues/29 ]
2024-05-02 07:26:12 -10:00
Simon Michael
96caa8f352
fix: detect ghc-debug support more accurately, checking hledger-lib also
2024-05-01 15:27:42 -10:00
Simon Michael
6796decb72
fix: show trailing decimal mark on cost amounts too, when needed
2024-05-01 14:17:46 -10:00
Simon Michael
d17b32c7eb
imp: cli,ui,web: support ghc-debug for analysing memory/profile info
...
When built with the ghcdebug flag and started with --debug=-1 (or -2
to pause at startup, or -3 to pause before exit), hledger can be
controlled by ghc-debug clients like ghc-debug-brick or a custom
ghc-debug query script.
Also, refactor version string code.
2024-05-01 13:43:04 -10:00
Simon Michael
55401282a0
imp: run checks in a well-defined order; and tweak that order
...
Now commodities are checked before accounts, and tags before recentassertions.
Also some check doc cleanups.
2024-04-26 18:59:45 -10:00
Simon Michael
4cbf72ab1f
imp!: check ordereddates: drop --date2 support; check primary dates only
...
date2 is a deprecated feature and was getting in the way, so has been dropped
from the ordereddates check, simplifying it.
2024-04-26 18:59:45 -10:00
Simon Michael
afe9e2c6f4
dev: move journalCheckBalanceAssertions to JournalChecks
2024-04-26 18:59:45 -10:00
Simon Michael
d3634cf4dd
dev: update failng doctests
2024-04-08 00:08:48 -10:00
Simon Michael
5be3ee9e20
imp: disallow date: in expr: OR expressions, avoiding unclear semantics [ #2177 ][ #2178 ]
2024-04-07 23:37:28 -10:00
Simon Michael
f982a372d9
dev: matchedPostingsBeforeAndDuring: improve debug output
2024-04-07 23:14:28 -10:00
Simon Michael
06ef6de242
dev:parseBooleanQuery: refactor
2024-04-07 22:48:25 -10:00
Simon Michael
1d3e6b5543
dev:parseBooleanQuery: refactor, clarifying helper dependencies
2024-04-07 21:53:03 -10:00
Simon Michael
fae6e49407
imp: simpler, clearer date parse error messages
...
When the error message repeated the invalid date at the end,
it was possible to misinterpret that as a suggested fix (reported in chat).
Instead, date errors (most of them) now rely on the highlighted data
excerpt above. This is also preferable since it shows the original
date as written, not a reconstruction with a possibly different format.
Should this be the policy for all error messages going forward ?
It would be easier.
Can we assume the data excerpt is always visible along with the error message ?
It isn't shown by flycheck-hledger in emacs, eg.
2024-03-26 10:05:57 -10:00
aragaer
09e158d31e
fix: Fill totals with correct amount of zeroes for empty reports
2024-03-17 10:52:53 -10:00
Dmitry Astapov
b0b9e69e4f
;dev:lib allow comment lines in the "if" table body
2024-03-08 07:42:58 -10:00
Simon Michael
169198ff55
Merge branch 'master' into fix-matchgroups
2024-03-02 12:15:52 -10:00
Jonathan Dowland
3b416a76ef
;cln:import: clarify haddock for getEffectiveAssignment
...
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-03-02 20:56:35 +00:00
Simon Michael
3ca208a3b6
fix:queries: fix OR-ing open-ended dates, spanUnion; add spanExtend [ #2177 ]
2024-03-01 18:10:24 -10:00
Jonathan Dowland
c5079d4f1e
dev:import: call hledgerFieldValue rather than re-implementing it
...
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-03-01 18:02:29 +00:00
Jonathan Dowland
1424a1f2f1
;cln:import: update some Haddock strings to reflect #2158
...
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-03-01 17:58:28 +00:00
Simon Michael
1ee0e80719
imp:errors:unbalanced transaction: show more precise amounts ( #2135 )
...
Like we used to in 1.30, but better (show all available decimal digits,
unless they're infinite in which case show 8, show trailing zeros,
show commodity symbol with zero).
2024-02-29 12:34:17 -10:00
Simon Michael
3ec432bd53
dev: rename/improve amountSetFullPrecisionUpTo, add mixedAmountSetFullPrecisionUpTo
2024-02-29 12:31:07 -10:00
Jonathan Dowland
71684f5611
ref:import: simplify renderTemplate and friends
...
renderTemplate and its ancillary functions did not need the
HledgerFieldName argument, so remove it.
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:42 +00:00
Jonathan Dowland
b7027c8bbb
feat:import: resolve matchgroup references in ConditionalBlock scope ( #2158 )
...
Adjust getEffectiveAssignment to compute an intermediary form of the
active assignments (with an additional Either wrapper to distinguish
top-level and conditional assignments) and move the remaining work to
its only caller, hledgerField.
Rework hledgerFieldValue. Instead of calling hledgerField, call
getEffectiveAssignment and--in the conditional block case--construct
a CsvRules scoped just to the active ConditionalBlock before calling
renderTemplate.
Adjust regexMatchValue to use rconditionalblocks to access conditional
blocks from the CsvRules, rather than rblocksassigning, since we haven't
narrowed the scope of that field.
The result is match group references are only expanded for match groups
that occur within the in-scope ConditionalBlock. Fixes : #2158 .
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:40 +00:00
Jonathan Dowland
ac7f726282
;ref:import: consistently use hledgerField
...
hledgerField is an alias to the function getEffectiveAssignment: both
names are used in various parts of RulesReader.
Treat hledgerField as the canonical name, and getEffectiveAssignment
as an implementation detail of hledgerField.
Replace all uses of getEffectiveAssignment with hledgerField (except the
one in hledgerField.)
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:39 +00:00
Jonathan Dowland
8f514ac16d
;test:import: test case for match groups ( #2158 )
...
Add a test which captures the issue of overlapping scope described
in GitHub issue #2158 .
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:36 +00:00
Jonathan Dowland
bd5652c1c2
;cln:import: remove superfluous comment lines
...
Signed-off-by: Jonathan Dowland <jon@dow.land>
2024-02-29 21:44:32 +00:00
Simon Michael
8f1ae401f4
dev: fix some partial head/tails, silence ghc 9.8's new warnings
...
Note the headErr/tailErr calls will print stack traces if they fail
(small ones: five lines, one of which is the useful location info),
which may or may not be best UX.
2024-02-28 15:58:21 -10:00
Simon Michael
fac3ee89af
feat:allow other kinds of unicode space as digit group separators
...
Based on feedback in chat, I added support for several more kinds of
Unicode space character for separating digit groups, both when reading
and when displaying numbers. These are the spaces currently supported,
which are just my best guess at the ones that might show up in CSV files
now and then:
space,
no-break space,
en space,
em space,
punctuation space,
thin space,
narrow no-break space,
medium mathematical space
2024-02-28 09:12:17 -10:00
Simon Michael
c7dd1fcc2f
;imp:cli:errors: make file-not-found error more format agnostic
2024-02-26 10:25:22 -10:00
Simon Michael
a4c2776a18
feat:close: support --round, like print
2024-02-25 17:37:59 -10:00
Simon Michael
d3ad743b36
imp: print, close: disambiguate balance assertion/assignment amount also ( #2176 )
...
Add a trailing decimal mark when necessary to disambiguate a single
digit group mark in the balance assertion/assignment amount, also.
2024-02-25 16:47:58 -10:00
Simon Michael
a871f274c4
fix:bal:budget: don't omit necessary parent accounts in tree mode ( #2071 )
...
Parent accounts with no actual or goal amounts would ideally be shown
elided on the same line, but the budget report in tree mode was
omitting them completely. Now --budget always shows them.
The effect is much like forcing --no-elide on, except it might not
show goal amounts that --no-elide does show.
It's not a wonderful fix, but the budget report code is twisty and I
can't afford to spend more time on this.
2024-02-25 01:23:39 -10:00
Simon Michael
c701e3a663
dev:budget: big refactor, clarify
...
Big functions like budgetReportAsTable are grouped as much as possible
into more modular sub-scopes.
2024-02-25 01:23:39 -10:00
Simon Michael
3cad760851
dev:budget: simplify some confusing fmaps
2024-02-25 01:23:31 -10:00
Simon Michael
ffdde364de
imp:bal:budget:csv,tsv output: show 0 not empty when there's no amount
2024-02-24 18:21:42 -10:00
Simon Michael
37f9d6b239
dev:budget report: clarify code, add debug output
2024-02-24 18:21:42 -10:00
Simon Michael
5a36362b33
imp:journal: use a symlink's target's directory for relative include paths
...
When reading a symbolically-linked journal file,
relative paths in include directives are now evaluated
relative to the directory of the real linked file,
not the directory of the symlink.
This also seems to fix an obscure case where stats did not report
absolute included file paths in certain circumstances (stdin, maybe no
terminal..)
2024-02-22 08:48:31 -10:00
Simon Michael
f6a50923c2
imp: interpret glob patterns in $LEDGER_FILE
...
For example, LEDGER_FILE=2???.journal now works.
2024-02-22 07:32:37 -10:00
Simon Michael
e6b3fa0f54
dev:IO: comments
2024-02-22 07:32:10 -10:00
Simon Michael
60a1adc5ba
lib: refactor, extract parseBalanceAssertionType
2024-02-20 20:55:27 -10:00
Simon Michael
baca5f8b54
fix:check:tags: add date and date2 to the implicitly-declared special tags
...
And add tests/comments.
2024-02-17 13:06:10 -10:00
Michael Rees
d4ecdb3fea
imp: Support tsv and ssv prefixes ( #2164 )
2024-02-08 06:44:44 -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
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
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
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