-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix display of credit transactions in bill views (#522)
https://eaflood.atlassian.net/browse/WATER-4131 In testing, we've spotted that the display of credit values on certain pages has gone awry! The first issue is how credit values are displayed. In most cases, we'll display `£150.25 credit` which is correct. But there are times, mainly in tables, where we need to show the signed version, for example `-£150.25`. A change to clean up our money formatters in `BasePresenter` broke this. So now negative values in the licence summaries table and the transaction table's total row are always displayed as positive. In this change, we update the formatter to allow callers to specify whether a sign should be returned. It also fixes all the JSDoc comments we forgot to update when we made the original change. Doh! The second issue is about _when_ we show credit values. During the initial build of the screens, we encountered some errors locally. We realised that bills sourced from NALD were missing data. When we checked the legacy code we found it only displayed credits when the bill run type was `supplementary` _and_ its source was `wrls`. When we did the same the errors went away. During QA it's been spotted, rightly, that this means the views can appear inconsistent sometimes showing the credits column and sometimes not. Without knowing why we're doing it, it just looks 'broken'. So, we dug deeper and realised that the key difference between bills from NALD and those created in WRLS is that the `invoiceValue` and `creditNoteValue` columns are empty for NALD ones. All we get is the `netAmount`. Knowing that we can change how we determine the credit and debit total values and not cause an error. So, the second change is to _always_ show the credits column for supplementary bills but to add a little 'dev magic' to handle how we calculate the totals!
- Loading branch information
1 parent
4e8be32
commit db15b2d
Showing
9 changed files
with
236 additions
and
81 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.