-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix determine billing periods #859
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://eaflood.atlassian.net/browse/WATER-4375 To implement changes to support new two-part tariff bill run options we needed to update the create bill run journey. We took advantage of this to migrate the functionality into [water-abstraction-system](https://github.com/DEFRA/water-abstraction-system). In our new journey in order to determine fi there are any live bill runs that would block a new bill run from proceeding we have to determine the financial end year for the proposed bill run. We do this in `app/services/bill-runs/setup/exists.service.js`. Having determine the year we passed this into our existing `StartBillRunProcessService` for consistency. What we had overlooked was that if the year is set it will then pass that on to `DetermineBillingPeriodsService` which, if provided with a financial year will _only_ generate a billing period for that year. This breaks supplementary billing which for SROC needs multiple billing periods to be determined. We'll be revisiting `DetermineBillingPeriodsService` in the near future as part of our work to [Exclude Financial Year from Supplementary Billing where Annual Bill has not been run for region & year](https://eaflood.atlassian.net/browse/WATER-4403). But for now we just need to get supplementary billing working again.
We already had one for providing the financial year but it was hidden inside another.
Cruikshanks
added a commit
that referenced
this pull request
Mar 28, 2024
Now we've refactored `DetermineBillingPeriodsService` to not just return a single billing period when financial year is set we can remove the temporary fix we did in [Fix determine billing periods](#859).
Cruikshanks
added a commit
that referenced
this pull request
Apr 2, 2024
https://eaflood.atlassian.net/browse/WATER-4403 In [Bump supplementary end year if no annual bill run](#875) we added logic that would mean when creating a new supplementary bill run the engine could tell if an annual bill run existed for the same year and region. If one doesn't it will make a mess of the billing for customers if the supplementary happened before the annual. But we don't want to block users from working. So, instead we bump the financial end year to use back to the same as the last 'sent' annual bill run for that region. We even [Refactor DetermineBillingPeriods to use type](#864) so it would know to use the calculated year when determining the billing periods for the supplementary bill run. What we forgot to do was remove a [temporary fix](#859) we'd added until this work can be completed. This means the year we've calculated is being dropped and not passed to `DetermineBillingPeriods`. This change fixes that!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://eaflood.atlassian.net/browse/WATER-4375
To implement changes to support new two-part tariff bill run options we needed to update the create bill run journey. We took advantage of this to migrate the functionality into water-abstraction-system.
In our new journey to determine if there are any live bill runs that would block a new bill run from proceeding, we have to determine the financial end year for the proposed bill run. We do this in
app/services/bill-runs/setup/exists.service.js
.Having determined the year we pass this into our existing
StartBillRunProcessService
for consistency.What we had overlooked was that if the year is set it will then pass that on to
DetermineBillingPeriodsService
which, if provided with a financial year will only generate a billing period for that year. This breaks supplementary billing which for SROC needs multiple billing periods to be determined.We'll be revisiting
DetermineBillingPeriodsService
soon as part of our work to Exclude Financial Year from Supplementary Billing where Annual Bill has not been run for region & year. But for now, we just need to get supplementary billing working again.