Skip to content

Conversation

simonmichael
Copy link
Owner

@simonmichael simonmichael commented Aug 27, 2025

This is a proposed fix for #2445.
Previously, for end-value reports, a P directive later than the latest transaction could set the default report end date and valuation date - even if that P directive was in the future.

Now, future-dated P directives are ignored; only non-future P directives can influence valuation date.

The PR also tries to clarify report span calculation, and various related functions.

The changes to tests show that the P directives can also extend the report end date, which seems to be new behaviour. I'm not sure if the old or new behaviour is more correct/intuitive/straightforward, so this needs some review and discussion.

@simonmichael simonmichael marked this pull request as draft August 27, 2025 23:20
@simonmichael simonmichael added needs-discussion To unblock: needs more discussion/review/exploration needs-review To unblock: needs more code/docs/design review by someone valuation labels Aug 27, 2025
…/valuation date [#2445]

In end-value reports with unspecified end date, a market price later
than the latest transaction can extend the default report end date and
valuation date. Now, only market prices on or before "today" can do this;
market price declarations dated in the future will be ignored.

Report span and valuation date calculations have been clarified.
@simonmichael
Copy link
Owner Author

simonmichael commented Aug 28, 2025

After several attempts, I have pushed a new fix that implements just the change described above, while seemingly not changing old behaviour otherwise. This is a confusing rabbit hole, but I think this is the right fix.

@simonmichael simonmichael marked this pull request as ready for review August 28, 2025 13:30
@simonmichael simonmichael removed needs-discussion To unblock: needs more discussion/review/exploration needs-review To unblock: needs more code/docs/design review by someone labels Aug 28, 2025
@simonmichael simonmichael changed the title valuation: future P directives don't set valuation date valuation: don't let future P directives influence valuation date Aug 28, 2025
@simonmichael simonmichael changed the title valuation: don't let future P directives influence valuation date valuation: don't let future P directives influence default valuation/end date Aug 28, 2025
@simonmichael simonmichael merged commit c3e85ce into master Aug 28, 2025
1 check passed
@simonmichael simonmichael deleted the sm-valuation-date branch August 28, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant