Skip to content
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

Highlight flagged for SROC supplementary billing #2322

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-3948

We have an issue that the current include_in_supplementary_billing flag was added at a time there was only 1 charge scheme. A licence gets flagged irrespective of whether the change relates to PRESROC or SROC.

Where that has impacted us is when sending a billing batch. When it gets sent it clears the flag for all licences included. But if we cancel one, for example, the PRESROC bill run, and send the SROC one we lose which licences still need to be processed on the PRESROC one.

Our solution was to add a new include_in_sroc_supplementary_billing flag to the licences table and only set it to 'true' when an SROC charge version is approved. But this means a licence might be flagged only for SROC supplementary billing and the existing functionality to highlight this only looks at the include_in_supplementary_billing field.

This change updates the 'marked for next supplementary bill run' notice to handle

  • marked for next PRESROC supplementary bill run only
  • marked for next SROC supplementary bill run only
  • marked for both schemes next supplementary bill run only
Examples of the updated notice

sup-billing-notice

https://eaflood.atlassian.net/browse/WATER-3948

We have an issue that the current `include_in_supplementary_billing` flag was added at a time there was only 1 charge scheme. A licence gets flagged irrespective of whether the change relates to PRESROC or SROC.

Where that has impacted us is when sending a billing batch. When it gets sent it clears the flag for _all_ licences included. But if we cancel one, for example, the PRESROC bill run, and send the SROC one we lose which licences still need to be processed on the PRESROC one.

[Our solution](DEFRA/water-abstraction-service#2077) was to add a new `include_in_sroc_supplementary_billing` flag to the `licences` table and only set it to 'true' when an SROC charge version is approved. But this means a licence might be flagged only for SROC supplementary billing and the existing functionality to highlight this only looks at the `include_in_supplementary_billing` field.

This change updates the 'marked for next supplementary bill run' notice to handle

- marked for next PRESROC supplementary bill run only
- marked for next SROC supplementary bill run only
- marked for both schemes next supplementary bill run only
We reduce the logic in the view to just be 'if thing exists show it'. TBH, that should be the limit of logic in a view.

We move the logic of determining what to show into the controller by adding a new function, used to set a new property in the view data.

We expand the tests to include coverage for the changes we are making.
@Cruikshanks Cruikshanks added the enhancement New feature or request label Mar 27, 2023
@Cruikshanks Cruikshanks self-assigned this Mar 27, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review March 27, 2023 20:37
Copy link
Contributor

@Jozzey Jozzey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cruikshanks Cruikshanks merged commit 87c386f into main Mar 28, 2023
@Cruikshanks Cruikshanks deleted the highlight-flagged-for-sroc-supplementary branch March 28, 2023 11:23
Cruikshanks added a commit that referenced this pull request Apr 5, 2023
https://eaflood.atlassian.net/browse/WATER-3948

In [Highlight flagged for SROC supplementary billing](#2322) we made a change to the notice shown to users when a licence is flagged for supplementary billing. The first iteration of the wording was what us developers had put together based on the existing messages and changes elsewhere in the service.

Our UAT team have now had a chance to look at them and asked for some tweaks.
Cruikshanks added a commit that referenced this pull request Apr 5, 2023
https://eaflood.atlassian.net/browse/WATER-3948

In [Highlight flagged for SROC supplementary billing](#2322) we made a change to the notice shown to users when a licence is flagged for supplementary billing. The first iteration of the wording was what us developers had put together based on the existing messages and changes elsewhere in the service.

Our UAT team have now had a chance to look at them and asked for some tweaks.

Pre-sroc (old charge scheme) needs to be

> This licence has been marked for the next supplementary bill run for the old charge scheme.

When a licence is flagged for both the old and new schemes

> This licence has been marked for the next supplementary bill runs for the current and old charge schemes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants