Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix comparison Section 126 factor in supp. billing (#224)
https://eaflood.atlassian.net/browse/WATER-4010 We found another scenario where the bill run always added credit and debit for the charge version on each bill run. The scenario was a new charge version was added which applied an abatement agreement (section 126 factor). The bill run gets run and sent. Another minor change is then made. No new debit and credit are needed. But when the engine grabs the previous debit, flips it to credit and compares it against the calculated line it finds they don't match. This results in a debit and credit for the same amount appearing each time when they should be cancelled out and not appear at all. We tracked the problem down to the `charge_element` holding all the values as strings inside a JSONB field (`adjustments`). But when they get persisted to the `billing_transactions` table they are properly stored as a number. This is the same issue as [Fix including unnecessary supp. billing trans.](#210) only in reverse. Thanks, legacy code! This change ensures when it comes to the comparison of `section126Factor` both previous and calculated and looking at the same data type.
- Loading branch information