Skip to content

Commit

Permalink
Two-part tariff due returns to show as blank (#1198)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4606

During testing for the two-part tariff review pages, it was raised that the billing and data team wanted to amend the returns displaying under a charge element. When a return matches a charge element, we show these under the review charge element section with their allocated quantity.
A due return currently displays 0 ML. The billing and data team wants to remove this and show a due return as blank instead of 0 ML. They say that showing 0 ML gives the false impression that the return is a nil return, rather than a due return. This PR is for this change.
  • Loading branch information
Beckyrose200 authored Jul 22, 2024
1 parent 159f313 commit d7c835e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ function _prepareReturnVolume (reviewChargeElement) {

if (reviewReturns) {
reviewReturns.forEach((reviewReturn) => {
returnVolumes.push(`${reviewReturn.quantity} ML (${reviewReturn.returnReference})`)
if (reviewReturn.returnStatus === 'due') {
returnVolumes.push(`overdue (${reviewReturn.returnReference})`)
} else {
returnVolumes.push(`${reviewReturn.quantity} ML (${reviewReturn.returnReference})`)
}
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ describe('Review Licence presenter', () => {
describe('when a return has a status of "due"', () => {
beforeEach(() => {
licence[0].reviewReturns[0].returnStatus = 'due'
licence[0].reviewChargeVersions[0].reviewChargeReferences[0].reviewChargeElements[0].reviewReturns[0].returnStatus = 'due'
})

it('changes the status text to "overdue"', () => {
Expand All @@ -166,6 +167,12 @@ describe('Review Licence presenter', () => {
expect(result.matchedReturns[0].returnTotal).to.equal('/')
})

it('formats the charge elements return total correctly', () => {
const result = ReviewLicencePresenter.go(billRun, licence)

expect(result.chargeData[0].chargeReferences[0].chargeElements[0].returnVolume).to.equal(['overdue (10031343)'])
})

it('formats the returns link correctly', () => {
const result = ReviewLicencePresenter.go(billRun, licence)

Expand Down

0 comments on commit d7c835e

Please sign in to comment.