Commit Graph

9354 Commits

Author SHA1 Message Date
Simon Michael
c21b666130 csv: handle more sign variations, eg a sign by itself
simplifySign now covers a few more sign combinations that might arise.
And in particular, it strips a standalone sign with no number,
which simplifies sign flipping with amount-in/amount-out.
2021-01-07 10:06:38 -08:00
Simon Michael
6035cdf1e0 ;csv: doc: setting amounts: tweaks 2021-01-07 09:30:37 -08:00
Simon Michael
4952ac22a1 ;lib: valuation: improve --debug=2 output 2021-01-07 08:59:04 -08:00
Simon Michael
1ad919bc6d lib: add level argument to fix traceAtWith 2021-01-07 08:57:25 -08:00
Simon Michael
62d9e46adc ;csv: doc: tweaks 2021-01-06 15:33:54 -08:00
Simon Michael
07a96c47c9 ;csv: doc: improve setting amounts tips 2021-01-06 11:01:12 -08:00
Simon Michael
b15a634a44 ;check: accept parseable/autobalanced/assertions as arguments, for completeness 2021-01-05 16:25:43 -08:00
Simon Michael
7510d99aec check: accept case-insensitive prefixes as arguments
Might a bad idea, but avoiding wasteful typing..
2021-01-05 16:18:24 -08:00
Simon Michael
9abb33d8e7 ;valuation: document the price search limit (#1439) 2021-01-05 15:59:58 -08:00
Stephen Morgan
c40db2b1eb lib: Make sure AtEnd valuation behaviour is consistent between single- and multi-period reports (#1424). 2021-01-05 14:42:09 -08:00
Stephen Morgan
83110e8820 lib,cli: Extend AtThen valuation to all report types.
Also adds a postingDate argument to amountApplyValuation, and re-orders
the ValuationType and (Transaction/Posting) arguments to
(transaction/posting)ApplyValuation, to be consistent with
amountApplyValuation.
2021-01-05 14:42:09 -08:00
Simon Michael
3d7d5c0db7 new price search that really finds the shortest path (#1443)
This one should also reliably prevent runaway searches in the event of more bugs, giving up after 1000 iterations.
2021-01-04 18:42:51 -08:00
Simon Michael
5842d47adc ;make functest: increase timeout to 30s, strangely unreliable at 10s 2021-01-04 18:11:01 -08:00
Simon Michael
e179685f3c ;valuation: commented test for #1443 2021-01-04 16:26:48 -08:00
Simon Michael
108b020f23 ;valuation: add functional test for #1439 slowdown 2021-01-04 15:45:58 -08:00
Simon Michael
5484c55053 ;make functest-PAT: don't hide successes in this mode 2021-01-04 15:45:58 -08:00
Simon Michael
14e12b83dc ;make functest*: $FUNCTESTEXE can override executable
Eg:
$ FUNCTESTEXE=hledger-1.20 make functest
2021-01-04 15:45:58 -08:00
Simon Michael
291c032195 ;make functest: add a 10s timeout to catch slow/hung tests 2021-01-04 15:28:52 -08:00
Simon Michael
0f275c7b41 ;make functest: hide successes again 2021-01-04 15:28:09 -08:00
Simon Michael
7c9303a15c lib: valuation: simplify price search code
This version tries counting recursions instead of path length, but I
think they are the same.
2021-01-03 09:49:00 -08:00
Simon Michael
73678393b1 lib: valuation: don't hang when finding prices (fixes #1439)
Searching for prices during valuation no longer now properly excludes
price loops, avoiding near infinite looping with certain
configurations of market prices. Also we now always use a direct price
when available, rather than searching unnecessarily.

Price searching progress info, useful for troubleshooting, is now
displayed with --debug=2.

There could still be some corner cases we don't handle correctly. We
now give up with an error message if the searched price chains get too
long (> 1000). More importantly, we should also give up if the search
iterates too many times, but this is not done yet.
2021-01-02 07:13:07 -08:00
Simon Michael
c96734474c Merge Xitian9/reporttext (#1427)
Many parts of the hledger-lib and hledger APIs have become more Text-ified,
expecting or returning Text instead of String.

Some functions now use WideBuilder (a text "builder" which keeps track
of width), to concatenate text more efficiently. There are some
helpers for converting to and from WideBuilder (wbUnpack, wbToText..)

showAmountB/showMixedAmountB are new amount-displaying functions
taking an AmountDisplayOpts. These will probably replace the old
show(Mixed)Amount* functions.

This reduces hledger's time and resident memory requirements by roughly 10%.
2021-01-02 07:11:09 -08:00
Stephen Morgan
5ba6215c47 cli: Remove redundant import, add some CPP. 2021-01-02 15:08:09 +11:00
Stephen Morgan
2bc2710017 test: Update for tests failing now that it's 2021. 2021-01-02 15:08:09 +11:00
Stephen Morgan
ef250e5673 bin: Update bin scripts for new API. 2021-01-02 15:08:09 +11:00
Stephen Morgan
7d3cf1747a lib: Make consistent naming scheme for showMixedAmount* functions,
add conversion between old API and new API in the documentation.
2021-01-02 15:08:09 +11:00
Stephen Morgan
1f891a4145 doc: Fix some outdated documentation. 2021-01-02 15:08:09 +11:00
Stephen Morgan
e63138ef7d lib,cli: Assorted fixes for older GHC. 2021-01-02 15:08:09 +11:00
Stephen Morgan
e4e533eb9f lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options. 2021-01-02 15:08:09 +11:00
Stephen Morgan
07a7c3d3a8 lib: Use Text and Text builder only in postingAsLines. 2021-01-02 15:08:09 +11:00
Stephen Morgan
13c111da73 lib,cli,ui: Use WideBuilder for Tabular.AsciiWide.
Move WideBuilder to Text.WideString.
2021-01-02 15:08:09 +11:00
Stephen Morgan
b9c00dce61 lib,cli,ui: Implement all showMixed* functions in terms of DisplayAmountOpts and WideBuilder. 2021-01-02 15:08:09 +11:00
Stephen Morgan
0a686e220e lib: Use AmountDisplayOpts for showAmount*, reducing need for many different named functions. 2021-01-02 15:08:09 +11:00
Stephen Morgan
c86e8a9794 lib: Implement showAmountHelper using AmountBuilder. 2021-01-02 15:08:09 +11:00
Stephen Morgan
5dedec83da lib: showamountquantity shows directly, rather than parsing string output of show instance for Quantity. 2021-01-02 15:08:09 +11:00
Stephen Morgan
f998a791cf lib: Remove unused optional width argument for StringFormat. 2021-01-02 15:08:09 +11:00
Stephen Morgan
462a13cad7 lib,cli: Use Text Builder for Balance commands. 2021-01-02 15:08:09 +11:00
Stephen Morgan
089564b04b lib,cli: Use Text for CompoundPeriodicReport titles. 2021-01-02 15:08:09 +11:00
Stephen Morgan
541c4fc18c lib,cli: Use Text for CSV values. 2021-01-02 15:08:09 +11:00
Stephen Morgan
e3ec01c3c6 lib,cli,ui: Use Text for showDate and related. 2021-01-02 15:08:09 +11:00
Stephen Morgan
74b296f865 lib,cli: Make showTransaction return Text rather than String. 2021-01-02 15:08:09 +11:00
Stephen Morgan
dbe7015502 cli: Refactor compoundBalanceCommand. 2021-01-02 15:08:09 +11:00
Stephen Morgan
7e44b89bb4 lib: Remove unused label on TranspactionReport and AccountTransactionsReport. 2021-01-02 15:08:09 +11:00
Stephen Morgan
5752f1c5cb lib,cli: Use Text Builder for Account Transaction Reports. 2021-01-02 15:08:09 +11:00
Stephen Morgan
b9dbed6713 cli: Use Text Builder for Entries Reports. 2021-01-02 15:08:09 +11:00
Stephen Morgan
12a6435c51 lib: Add wrap convenience function. 2021-01-02 15:08:09 +11:00
Stephen Morgan
646ee0bce5 cli: Using Text Builder for posting reports. 2021-01-02 15:08:09 +11:00
Simon Michael
ac39d59016 ;check: doc: link to payee directive 2020-12-31 12:57:39 -08:00
Simon Michael
fdeaa3cd8b doc: journal: document payee directive 2020-12-31 12:55:24 -08:00
Simon Michael
3898a66dda ;check: doc: wording 2020-12-31 12:40:46 -08:00