add support for reporting period 'since first transaction' #2617
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an implementation of #2411.
This commit provides an option in the reporting period creation dialog to make a reporting period starting from the date of the first transaction.
This option is not introducing a new, specific reporting period implementation. Instead it is reusing the existing 'since-x' reporting period. The dialog merely uses a "macro" to bootstrap a 'since-x' reporting period with the date of the first transaction.
As such the option 'since first transaction' is not a pointer referencing the date of the first transaction in the ledger. It's not a dynamic functionality backed by the current state of a modifiable portfolio. It's based on a one-time, static snapshot of the portfolio state. When this option is selected in the reporting period dialog, it creates a 'since-x' reporting period based on the date of the first transaction at this point in time.
Due to the lack of dynamic transaction tracking this functionality obviously "breaks" when a new, first transaction is added in retrospect. Then a 'since-x' reporting period might have been created previously for the transaction that was considered the first one before. In this situation the user must update the 'since first transaction' reporting period manually.
Despite of the need for a manual correction of the first transaction reporting period, there are no severe issues caused. The outdated state is handled rather graceful. When the user re-enters the reporting period dialog in such a situation, he'll notice that the 'since first transaction' option is no longer selected. Instead a 'since ${date of the previous first transaction}' is selected. An outdated 'since first transaction' deteriorates gracefully into a simple 'since-x' when a new first transaction is added in retrospect.
But despite of the described limitation, I think this is still a very useful feature. First transactions do not change (often).