weenhanceit / autism-funding

A Web App to Help Manage BC Autism Funding
MIT License
0 stars 0 forks source link

Back-end InvoiceAllocation validations #72

Closed lcreid closed 7 years ago

lcreid commented 7 years ago

Validations (loosely speaking) for Cf0925 must include, when there is a change to the Part A or Part B amount:

Iterate through all Invoices for the Cf0925, and do the same validations as if the invoice amount had changed, as described in Issue #65.

lcreid commented 7 years ago

The first cut implementation simply reduces the amount of each invoice allocation, starting at the end, if the amount_available is less than zero. This meets the intent. I don't think we actually have to do all the other adjustments from Issue #65, since the invoice_amount doesn't actually change.

This implementation has a few caveats: