Overview: Cornell has experienced an issue where upon approve and pay the invoice is transitioned to the paid status but NO transactions are created.
Steps to Reproduce:
- Create 2 funds and budgets
- Create an order
- Create an order line with the first fund
- Open the order
- Create an invoice
- Add an invoice line linked to the po line
- Change the invoice line fund to the second fund
- Approve the invoice - this will fail with a 400 in Juniper before HF3
- Unopen the order
- Remove the fund distribution from the order line
- Add a new fund distribution with the new fund to the order line
- Reopen the order
- Remove the invoice line
- Add another invoice line with the second fund
- Approve the invoice
- Pay the invoice
- Check the payment transaction
- Check the budgets
NOTE: Library had created the invoice based on POL and it would not approve (Because the invoice line referenced an encumbrance that did not exists anymore). The invoice line was deleted and added back and the invoice was successfully approved and paid. However, no transactions (Payments or credits) can be found on the budget.
Expected Results: Invoice is approved and paid successfully and necessary transactions are created against the correct budget
To sum up conclusions, this can happen for an invoice created before Juniper HF3, if an invoice line fund was changed to a different fund before the invoice was approved and the approval failed (see
MODINVOICE-290). After this, mod-finance-storage is keeping a failed temporary transaction that is making any future invoice approval silently fail to create pending payments for the same invoice, even in the latest Kiwi. Only editing the mod-finance-storage database to remove the failed temporary transaction before approving the invoice would resolve the issue.
MODFISTO-268 would resolve the latest issue of invoices staying in an unstable state after something bad happens when creating a transaction, because new summary ids would be used instead of invoice ids. Failed groups of transactions would not affect new ones.