Skip to content

Commit

Permalink
Handle empty supplementary bill runs
Browse files Browse the repository at this point in the history
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
Cruikshanks committed Mar 6, 2023
1 parent 3c753c4 commit c5e6537
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit c5e6537

Please sign in to comment.