Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inc. changes to agreements & charges in supp bill (#207)
https://eaflood.atlassian.net/browse/WATER-3989 When a new charge version is added to a licence, users can change agreements and charges linked to the licence via the charge version. So, for example, when the SROC charge version is first applied the licence does **not** have a two-part tariff agreement (2PT). But later in the year, one is added. To do this the business will add a new charge version and apply the 2PT agreement. Though the number of billable days calculated won't change, the charge that the [charging-module-api](https://gothub.com/DEFRA/sroc-charging-module-api) returns will. So, we need to credit the previous transaction and calculate a new debit. At the moment, our engine does not look at changes to agreements and charges. So, it will compare the billable days, see no change and cancel both the previous and calculated transaction lines before we get a value from the charging module. This change updates the logic for comparing previous transactions to those we've calculated to include agreements and charges. If there has been a change, the lines won't match and get cancelled so will then progress to the next step; sending them to the charging module to calculate their charge value.
- Loading branch information