Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle empty supplementary bill runs
https://eaflood.atlassian.net/browse/WATER-3923 From the charge version we generate transaction lines. For each charge element (reference) we look at the charge purposes connected to it and calculate the billable days. If that result is 0, we skip adding the transaction to the bill run. This means there is often a case where having calculated and rejected all the transaction lines, the bill run is 'empty'. The legacy process will update the status of the bill run to `empty`, and remove any `billing_invoice` and `billing_invoice_licence` records created. We need to do the same, though we intend to take a different approach. We'll process all the transaction lines first and only create `billing_invoice` and `billing_invoice_licence` records for those that remain. Should there be none, we'll go straight to marking the bill run as `empty` and stop the process there. Our intent is to remove needless calls to the DB and simplify the process.
- Loading branch information