Commit Graph

10137 Commits

Author SHA1 Message Date
Stephen Morgan
d55ce4d759 ref: performance: Use a Set in accountNamesFromPostings, instead of
nubSort.

This has better performance when there is repetition in the account
names.
2021-09-18 16:00:55 -10:00
Stephen Morgan
ab5350e02c ref: performance: Improve performance for some high-use functions.
mixedAmount(Looks|Is)Zero now operate directly on the MixedAmount,
rather than converting them to a list of amounts first.

mixedAmountCost no longer reconstructs the entire MixedAmount when there
are amounts with no cost.

transactionCheckBalanced only checks if signs are okay if sums are not
okay. It also only traverses the list of postings once when picking real
and balanced virtual postings.
2021-09-18 16:00:55 -10:00
Stephen Morgan
a2d7ac5318 ref: balance: Refactor getPostingsByColumn to use groupByDateSpan.
This reduces code duplication, makes the code more idiomatic, and hides
optimisation magic within groupByDateSpan.
2021-09-18 14:40:28 -10:00
Stephen Morgan
35c33f342b cln: Move column grouping functions form Report.PostingsReport to Data.Dates. 2021-09-18 14:40:28 -10:00
Stephen Morgan
8a6d824900 imp: csv: sql: Use . as a decimal point in sql output for Print command. 2021-09-18 14:32:21 -10:00
Simon Michael
173d69647d ;fix: make help-copy-bins-to: fix help 2021-09-18 12:44:44 -10:00
Malte Brandy
e31eb58ada lib: Allow multiline comments in csv rules 2021-09-18 12:43:49 -10:00
Simon Michael
b79a8473f7 ;doc: update manuals 2021-09-18 12:16:09 -10:00
Simon Michael
9dca1dc7b6 imp: prices: use --infer-market-prices instead of --costs
This command now reuses the --infer-market-prices flag, and uses
a new --infer-reverse-prices flag, instead of the old
--costs and --inverted-costs flags, which are now deprecated and hidden.
2021-09-18 12:12:31 -10:00
Simon Michael
326d6e8dae ref: ReportOptions{infer_value_} renamed to infer_prices_
For more consistency with the flag name (--infer-market-prices).
And BalancingOpts{infer_prices_} is now infer_transaction_prices_.
2021-09-18 12:12:31 -10:00
Simon Michael
daa9fddec9 imp: cli: --infer-market-price renamed to --infer-market-prices
It was too easy to get this wrong, even some of the docs did.
Now either plural or singular spelling works
(since we accept flag prefixes).
2021-09-18 12:12:31 -10:00
Simon Michael
c784cf4a38 imp: cli: hide the old --infer-value flag spelling
Hide this deprecated legacy flag, and also leave more width for flag descriptions in --help.
2021-09-18 12:12:31 -10:00
Stephen Morgan
a24f9a61df fix: web: Toggle showing zero elements properly even when called with
--empty. (#1237)

Calling with --empty now overrides any cookies determining whether
zero accounts are hidden.
2021-09-18 11:50:36 -10:00
Stephen Morgan
9f5b652b4e cln: Clean up miscellaneous functions in Hledger.Data.Amount.
This makes imports more explicit, removes printf, and adds stack traces
to unimplemented calls to Num instances for mixed amounts.
2021-09-18 11:41:53 -10:00
Stephen Morgan
020dd15be4 ref: Simplify parsing of commodity-style option. 2021-09-18 11:41:53 -10:00
Stephen Morgan
6b400194e3 cln: Add explicit export list for Hledger.Data.Account.
All modules in hledger-lib now have explicit export lists, with the
exception of Hledger.Data.Types.
2021-09-18 11:41:53 -10:00
Stephen Morgan
c1d85ba17c ref: Move JournalParser and ErroringJournalParser to Hledger.Data.Journal.
This is so that Hledger.Utils does not depend on Hledger.Data in any
way, and allows us more flexibility in refactoring Hledger.Data.
2021-09-18 11:41:53 -10:00
Simon Michael
993e381307 ;doc: update manuals 2021-09-18 11:24:52 -10:00
Simon Michael
633af61b2e imp: cli: move --today to reportflags (#1674) 2021-09-18 11:24:27 -10:00
Simon Michael
02a79fb230 ;tests: ui: use --today to make hledger-ui tests robust (#1674) 2021-09-18 11:10:25 -10:00
Simon Michael
8a4cea2a69 ;doc: update manuals 2021-09-17 17:58:10 -10:00
Stephen Morgan
62351dd329 fix: bal: Make sure boring parent accounts in compound balance reports
include historical postings when account declarations have undeclared
parents. (#1698)
2021-09-17 15:24:19 -10:00
Stephen Morgan
3b5262e54a fix: performance: Speed up PostingsReport when called with a large number of intervals. (#1683)
It is still very slow for large journals, but at least it doesn't run
any slower for interval reports.
2021-09-16 17:40:24 -10:00
Malte Brandy
724c84fe50 ;doc: Convert some plain urls to links 2021-09-16 07:06:08 -10:00
Stephen Morgan
df424a7a96 fix: web: Do not hide empty accounts if they have non-empty subaccounts. (#1237) 2021-09-10 16:44:57 -10:00
Stephen Morgan
36f5bc9d23 ;doc: Document --today in the manuals. 2021-09-10 10:40:50 -10:00
Stephen Morgan
54f2600db2 imp: cli: Let --today option handle smart dates, determined relative to
the current date.
2021-09-10 10:40:50 -10:00
Simon Michael
7a249cffe9 ;doc: update manuals 2021-09-09 14:45:01 -10:00
Simon Michael
ddec2cedf3 ;doc: update CLI usage texts 2021-09-09 14:44:09 -10:00
Stephen Morgan
c0053cb9ba doc: Document --today in the manual. 2021-09-09 14:40:39 -10:00
Stephen Morgan
0f205295e8 pkg!: test: Use --today in Journal parsing functions. 2021-09-09 14:40:39 -10:00
Stephen Morgan
3456fcb862 test: ui: web: Use report date from _rsDay for hledger-ui and
hledger-web, rather than getCurrentDay.

File watching in hledger-ui continues to use getCurrentDay.
2021-09-09 14:40:39 -10:00
Stephen Morgan
6905e40c4d pkg!: cli: Add --today option to explicitly set the current date. (#1674)
rawOptsTo* in hledger-lib now takes a day as an argument, and does not
live in the IO monad, since it's now pure.

This is so that we can run tests containing future transactions that
won't fail as soon as ‘the future’ actually arrives.
2021-09-09 14:40:39 -10:00
Stephen Morgan
765466c392 dev!: ui: Rename fields of UIOpts for consistency.
In code, either replace the name with the new name, or use the lenses
instead.

watch_ -> uoWatch
cliopts_ -> uoCliOpts
2021-09-09 13:31:43 -10:00
Stephen Morgan
7f7f1a2cdf ref: ui: lens: Use lenses in UIState, saving a lot of boilerplate. 2021-09-09 13:31:43 -10:00
Stephen Morgan
f471258a48 dev: ui: lens: Add classy lens instances for UIOpts and UIState. 2021-09-09 13:31:43 -10:00
Stephen Morgan
09a2449f4f ref: ui: Pull register and theme options into UIOpts. 2021-09-09 13:31:43 -10:00
Stephen Morgan
54c73ff759 ref: ui: Refactor code to eliminate requirement for change_ in UIOpts.
--change is already stored in balanceaccum_ in ReportOpts, so it does
not need to be stored in UIOpts too.
2021-09-09 13:31:43 -10:00
Stephen Morgan
50f73b7434 fix: balance: Show all empty accounts in flat balance reports. (#1688)
Previously we only showed empty leaves.
2021-09-08 18:17:27 -10:00
Stephen Morgan
4cb631c0f2 fix: web: Handle non-regular postings in the add transaction form. (#1058) 2021-09-08 13:21:50 -10:00
Stephen Morgan
04c35e1519 fix: bin: Allow hledger-check-fancyassertions to parse predicates (#1464). 2021-09-08 13:19:31 -10:00
Stephen Morgan
8fcdc22a45 fix: bin: Get scripts compiling with current hledger-lib. 2021-09-08 13:19:31 -10:00
Simon Michael
db45b13249 test: more detailed commodity directive tests 2021-09-07 10:19:01 -10:00
Simon Michael
cea8bc0558 test: split/rename directive tests 2021-09-07 09:51:49 -10:00
Simon Michael
344c421a3b test: update shelltest format 2021-09-07 09:47:31 -10:00
Dmitry Astapov
555a68faa5 fix: roi: rare bug with PnL applied on the first day of investment 2021-09-03 11:02:43 -10:00
Simon Michael
25755c1ddd ;doc: journal: clarify account type auto detection, again 2021-09-02 09:04:55 -10:00
Simon Michael
32bf6284be ;doc: journal: clarify account type auto detection 2021-09-02 07:26:53 -10:00
Simon Michael
703980524b ;doc: csv: clarifiy csv-only interpolation earlier 2021-09-01 07:14:05 -10:00
Simon Michael
5485990cac fix: csv: report correct CSV line number in errors
Some errors in CSV conversion, such as a failing balance assertion,
were always being reported as line 2.
Reported by Lawrence Wu.
2021-09-01 06:58:15 -10:00