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

Fix display of financial year in new bill views #523

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

Cruikshanks
Copy link
Member

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

In testing the new bill views, it has been spotted that it looked like we were displaying the financial year incorrectly.

In a bill's metadata, we show, for example, "Financial year 2023-2024". The financial year is from 1st April to 31st March hence we represent the year being [from] and [to]. Our QA however spotted examples where we were showing "2019 to 201".

We were getting the financial years from the bill run and assumed the legacy code was doing the same. When we checked we found it was getting a financial year ending but then just taking 1 away from it directly in the view to get the from value.

"Shame!" we cried. "Another example of shoddy work!" Only it wasn't. 😳😬

The values we were using are from_financial_year_ending and to_financial_year_ending. We had incorrectly assumed they were the from and to years for bill run. Instead, they are to record financial years covered by a bill run. A supplementary can cover 6 years. So, for example, if a PRESROC supplementary bill run covered 2018-04-01 to 2022-03-31 the DB would hold from_financial_year_ending = 2019, to_financial_year_ending = 2022.

As we are now displaying the bill, the value we need is financial_year_ending in the bill record. And as we only have the ending we need to do something similar to the legacy code and deduct 1 year to get the 'from'.

This change fixes what we have built to do just that.

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

In testing of the new bill views it has been spotted that it looked like we were displaying the financial year incorrectly.

In a bill's metadata we show, for example, "Financial year 2023-2024". The financial year is from 1st April to 31st March hence we represent the year being `[from] and [to]`. Our QA however spotted examples where we were showing "2019 to 201".

We were getting the financial years from the bill run and assumed the legacy code was doing the same. When we checked we found it was getting a financial year ending but then just taking 1 away from it directly in the view in order to get the from value.

"Shame!" we cried. "Another example of shoddy work!" Only it wasn't. 😳😬

The values we were using are `from_financial_year_ending` and `to_financial_year_ending`. We had incorrectly assumed they were the from and to years for bill run. Instead, they are to record the span of financial years covered by a bill run. A supplementary can cover a span of 6 years. So, for example, if a PRESROC supplementary bill run covered 2018-04-01 to 2022-03-31 the DB would hold `from_financial_year_ending = 2019, to_financial_year_ending = 2022`.

As we are now displaying the bill, the value we actually need is `financial_year_ending` in the bill record. And as we only have the ending we need to do something similar to the legacy code and deduct 1 year to get the 'from'.

This change fixes what we have built to do just that.
@Cruikshanks Cruikshanks added the bug Something isn't working label Nov 14, 2023
@Cruikshanks Cruikshanks self-assigned this Nov 14, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review November 14, 2023 23:05
@Cruikshanks Cruikshanks merged commit c74ae0d into main Nov 14, 2023
6 checks passed
@Cruikshanks Cruikshanks deleted the fix-display-finance-year-in-new-bill-views branch November 14, 2023 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant