Commit Graph

135 Commits

Author SHA1 Message Date
Brian Wignall
c823f5b51a Get "make functest" working again 2020-01-07 15:58:54 -08:00
Brian Wignall
03e68f3925 Get "make functest" working again 2020-01-07 15:58:54 -08:00
Brian Wignall
e12b0a4f05 Get "make functest" working again 2020-01-07 15:58:54 -08:00
Brian Wignall
28f9f043e5 Get "make functest" (mostly) working again 2020-01-07 15:58:54 -08:00
Simon Michael
8f1aa0981e ;make that auto posting test independent of current date
[ci skip]
2020-01-04 17:36:57 -08:00
Aleksandar Dimitrov
f55f814155 Fix auto postings test.
Happy new year!
2020-01-02 09:54:14 -08:00
Mykola Orliuk
6dbe925eed cli: anonymize transaction code also 2019-11-18 17:42:22 -08:00
Mykola Orliuk
0a273561f7 cli: anonymize declared accounts also
Fixes simonmichael/hledger#901
2019-11-18 17:42:22 -08:00
Simon Michael
6dcddadd9f ;journal: in generated-transaction:/posting: tags, add a space before the value 2019-10-07 14:54:36 -10:00
Simon Michael
39635b2fde ;valuation: test documenting new end-date behaviour (#1083)
[ci skip]
2019-09-05 21:03:30 -07:00
Simon Michael
a7f172b085 valuation: -V/-X respects report end date, code/doc cleanups (#1083)
-V (and -X) now respects a report end date set with -e/-p/date: when
choosing the valuation date, similar to hledger 1.14 and Ledger.

This means that -V/-X aren't exactly like either --value=end or
--value=now. The "Effect of --value on reports" doc has been extended
accordingly, and much of it has been reworded and made more accurate.
2019-09-05 13:41:36 -07:00
Simon Michael
07c4b3e0ab ;tests: consolidate query tests slightly
[ci skip]
2019-07-26 23:22:46 +01:00
Simon Michael
35799142dd
Merge pull request #914 from simonmichael/rule-tags
tags for matching rule-generated txns and postings
2019-07-17 18:38:14 +01:00
Simon Michael
5ceb278296 ;journal: tests: note surprising decimal mark parsing
[ci skip]
2019-07-09 11:31:56 +01:00
Simon Michael
6c2398e4d7 close: preserve transaction prices (costs) accurately (#1035)
Transaction prices were being collapsed/misreported after close/open;
this is fixed. Now each separately-priced amount gets its own posting,
and only the last of these (for each commodity) gets a balance
assertion. Also the equity posting's amount is now always shown
explicitly, which in multicommodity situations means that multiple
equity postings are shown. The upshot is that a balance -B report
will be unchanged after closing & opening transactions.
2019-07-09 11:21:22 +01:00
Simon Michael
19ba1628bf ;print: more valuation-related tests
[ci skip]
2019-07-08 06:00:28 +01:00
Simon Michael
33d03284c3 ;valuation: more tests; document default amount style issue
[ci skip]
2019-06-17 08:19:23 -07:00
Caleb Maclennan
18e19b9ad2 ;tests: normalize tests, examples, and docs using 2spcs before comments 2019-06-13 12:12:21 -07:00
Simon Michael
aa99743096 make -V do --value=end in multiperiod reports (#329) 2019-05-24 10:30:35 -07:00
Simon Michael
37b30415d5 update valuation tests to match latest #329 scheme 2019-05-23 21:55:19 -07:00
Simon Michael
e21afc466a bal/bs/bse: -H or --cumulative now disables -T (#329)
To reduce confusion, multiperiod balance reports using -H/--historical
or --cumulative, which show end balances, no longer show a Totals
column since summing end balances generally doesn't make sense.
Also the underlying MultiBalanceReport now returns zero for those
totals when in cumulative or historical mode.
2019-05-11 20:43:28 -07:00
Simon Michael
76342a3fd0 bal/bs/cf/is: mention valuation type in report title 2019-05-09 15:39:43 -07:00
Simon Michael
fb18019212 bal: document and test --value-at with --budget (#329) 2019-05-09 12:23:51 -07:00
Simon Michael
d77fd5743d bal/bs/cf/is: support --value-at with -H; fix row/col/grand totals
This also includes a big cleanup of multiBalanceReport, which got
accidentally mingled.
2019-05-09 07:58:45 -07:00
Simon Michael
9680e894cc ;tests: fix totals in a --value-at test
[ci skip]
2019-05-09 07:57:03 -07:00
Simon Michael
72214a5747 reg: fix --value-at=transaction with -M (#329) 2019-05-06 08:07:16 -07:00
Simon Michael
ad00da244b reg: support --value-at with -H (#329) 2019-05-05 17:47:38 -07:00
Simon Michael
8d7eacd73f bal: support --value-at=p/t with multiperiod reports (#329) 2019-05-05 09:30:01 -07:00
Simon Michael
ec1b98434c reg: support --value-at=period with periodic reports (#329) 2019-05-04 12:22:00 -07:00
Simon Michael
ebf5ed93f2 valuation: more thorough --value-at; document status (#329, #999)
This feature turns out to be quite involved, as valuation interacts
with the many report variations. Various bugs/specs have been
fixed/clarified relating to register's running total, balance totals
etc. Eg register's total should now be the sum of the posting amount
values, not the values of the original sums. Current level of support
has been documented.

When valuing at transaction date, we once again do early valuation of
all posting amounts, to get more correct results. variants. This means
--value-at=t can be slower than other valuation modes when there are
many transactions and many prices. This could be revisited for
optimisation when things are more settled.
2019-05-03 12:24:02 -07:00
Simon Michael
696e3098c8 reg: support --value-at in register reports; cleanups, tests 2019-04-26 12:08:46 -07:00
Simon Michael
00975fb226 bal*: support --value-at in multicolumn balance reports 2019-04-26 12:08:31 -07:00
Simon Michael
65934958f9 rename --value-date -> --value-at; --value-at implies -V 2019-04-26 12:08:31 -07:00
Simon Michael
9adae02973 print: add --value-date general option; implement for print -V 2019-04-26 12:08:31 -07:00
Simon Michael
1d81316681 tests: convert market prices tests to format 3
[ci skip]
2019-04-24 08:43:02 -07:00
Simon Michael
9d3eb8c069 bal, reg, print: -V prefers non-future valuation dates again (#999) 2019-04-24 08:31:21 -07:00
Simon Michael
c23fc8b671 speed up -V/--value by converting reports, not the journal (#999)
Instead of converting all journal amounts to value early on, we now
convert just the report amounts to value, before rendering.

This was basically how it originally worked (for the balance command),
but now it's built in to the four basic reports used by print,
register, balance and their variants - Entries, Postings, Balance,
MultiBalance - each of which now has its own xxValue helper.

This should mostly fix -V's performance when there are many
transactions and prices (the price lookups could still be optimised),
and allow more flexibility for report-specific value calculations.

+------------------------------------------++-----------------+-------------------+--------------------------+
|                                          || hledger.999.pre | hledger.999.1sort | hledger.999.after-report |
+==========================================++=================+===================+==========================+
| -f examples/1000x1000x10.journal bal -V  ||            1.08 |              0.96 |                     0.76 |
| -f examples/2000x1000x10.journal bal -V  ||            1.65 |              1.05 |                     0.73 |
| -f examples/3000x1000x10.journal bal -V  ||            2.43 |              1.58 |                     0.84 |
| -f examples/4000x1000x10.journal bal -V  ||            4.39 |              1.96 |                     0.93 |
| -f examples/5000x1000x10.journal bal -V  ||            7.75 |              2.99 |                     1.07 |
| -f examples/6000x1000x10.journal bal -V  ||           11.21 |              3.72 |                     1.16 |
| -f examples/7000x1000x10.journal bal -V  ||           16.91 |              4.72 |                     1.19 |
| -f examples/8000x1000x10.journal bal -V  ||           27.10 |              9.83 |                     1.40 |
| -f examples/9000x1000x10.journal bal -V  ||           39.73 |             15.00 |                     1.51 |
| -f examples/10000x1000x10.journal bal -V ||           50.72 |             25.61 |                     2.15 |
+------------------------------------------++-----------------+-------------------+--------------------------+

There's one new limitation, not yet resolved: -V once again can pick a
valuation date in the future, if no report end date is specified and
the journal has future-dated transactions. We prefer to avoid that,
but reports currently are pure and don't have access to today's date.
2019-04-23 17:39:01 -07:00
Simon Michael
72c7861267 tests: note parse-errors.test fragility
[ci skip]
2019-04-20 09:25:09 -07:00
Simon Michael
ba850f3871 lib: more transaction balancing/assertions/assignments cleanup 2019-02-20 09:14:30 -08:00
Simon Michael
8789a442a8 lib: inclusive balance assertions (=* and ==*) 2019-02-20 09:14:30 -08:00
Simon Michael
3b47b58aec lib: clarify transaction balancing & balance assertion checking 2019-02-20 09:14:30 -08:00
Simon Michael
6e4ba1106f tests: more tests for #893
[ci skip]
2019-02-01 15:31:38 -08:00
Simon Michael
94771edda2 tests: move, consolidate auto posting tests (#893)
[ci skip]
2019-02-01 15:31:36 -08:00
Simon Michael
550e33a558 journal: fix balance assertions/assignments & prices (#824)
Hopefully this is will do it. This restores the past behaviour:

- parsing prices in balance assertions/assignments
- ignoring them in assertions
- using them in assignments
- and printing them

and clarifies tests and docs.
2019-01-25 12:41:10 -08:00
Simon Michael
a5eb5bdff9 journal: fix balance assertions test (#824, #958) 2019-01-25 10:09:40 -08:00
Simon Michael
99f397da5d make the #949 functional test more robust 2019-01-16 09:19:56 -08:00
Simon Michael
95643affad test that order of include files is maintained (#949) 2019-01-15 12:58:28 -08:00
Simon Michael
70b11ed0a4 journal: make balance assertions exact again (#941)
Going with option 1b from the issue: calculated and asserted amounts
are compared exactly, disregarding display precision.
But now balance assertion failure messages show those exact amounts at
full precision, avoiding confusion.
2019-01-08 16:51:11 +00:00
Simon Michael
c331be7f23 journal: clarify balance assertion/display precision more (#941) 2019-01-06 22:17:20 +00:00
Simon Michael
187fcf75ed journal: clarify balance assertion/display precision interaction
Surprisingly, balance assertions were checking to maximum precision,
which meant it was possible, with a display-precision-limiting
commodity directive, to have a failing assertion with the error
message showing asserted and actual amounts that looked the same.

Now we round the calculated account balance (but not the asserted
balance) to display precision before comparing. This should ensure
assertions always behave as you would expect from visual inspection.
2019-01-06 08:30:54 +00:00