Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration to flag sroc supp. billing invoices
https://eaflood.atlassian.net/browse/WATER-3951 We had 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](#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. That is all now working for new charge versions created and approved. The remaining issue is existing charge versions that have been processed. When this change goes live there will be a number of SROC charge versions that have been approved and should be considered. But when they were approved only the `include_in_supplementary_billing` flag existed. We could try and do something clever, and look at all the SROC charge versions that have been approved this year and then only set the flag against their connect licences. But we've decided instead to just set `include_in_sroc_supplementary_billing` to true for those licences where `include_in_supplementary_billing` is true. It might result in some empty SROC bill runs. But it's far simpler, so there is less chance we'll get something wrong and miss licences. So, this change adds a migration that will set the flags when first deployed.
- Loading branch information