Skip to content

using a future-dated P directive in value reports is unintuitive ? #2445

@simonmichael

Description

@simonmichael

As reported in #hledger, a valuation date can be sometimes be chosen that's in the future.
(To work around, add an explicit report end date, like -e today.)

Eg

P 3000-01-01 A  2 B

2025-01-01
  (a)      1 A

A market price declaration dated in the future is quite unusual, but let's say you have one.
Running hledger print -V today, we might expect the 3000-dated P to be ignored, but it isn't:

$ hledger print -V
2025-01-01
    (a)             2 B

3000-01-01 is chosen as the valuation date, as shown by --debug=2.
The manual's Valuation date section was "clarified" in September 2023 to say:

For single period reports (including normal print and register reports):
...

  • Otherwise the latest transaction date or P directive date is used (even if it's in the future)

This was catching up with a behaviour change made in 2021, arising from some complicated discussion at #1495, #1416 and originally #1405 . I think the goal was to fix unintuitive ignoring of P directives in value reports.

But we might have overlooked the case of a P directive dated in the future, which is an uncommon situation.

Perhaps in this case it would be better to pick:
"Otherwise the latest transaction date; otherwise the latest P directive date that's not in the future"
?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WISHSome kind of improvement request or proposal.affects3-fewAffects just a few users.annoyance2-minorMinor to moderate usability/doc bug, reasonably easy to avoid or tolerate.valuation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions