Add invoice proration option to TeamType (backport #2758) #2760
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.
Backport of #2758
Fixes #2746
Description
This adds a new option to the TeamType to set the invoice proration behaviour.
<img width="381" alt="image" src="https://github.com/flowforge/flowforge/assets/51083/91aa1973-fab9-4671-b359-643ece87ac1c\">
The default option is the existing behaviour - triggering an invoice with every change made.
The new option, 'Add proration items to monthly invoice', will mean the team invoice is still set monthly, but will list all of the changes made through the month and the protated charges.
This also addresses an issue where deleting an Instance would not remove it properly from billing.
The unit tests have been updated to match how the relevant parts of the code are called to ensure they properly match the real behaviour - specifically, not deleting the Project database object before calling
billing.removeProject
.Checklist