Invoice Transaction not created
Description
CSP Request Details
CSP Rejection Details
Potential Workaround
Attachments
- 04 Feb 2022, 09:01 PM
defines
relates to
Checklist
hideTestRail: Results
Activity
Damien March 3, 2022 at 4:40 PM
@Ann-Marie Breaux The PR was just a karate test to reproduce the issue. But AFAIK it does not happen in the latest Juniper, Kiwi or Lotus when using the UI (except with some data from a previous version, but this becomes increasingly unlikely as time goes on).
I think we can remove the Kiwi HF2 release value.
Ann-Marie Breaux March 3, 2022 at 4:09 PM
Hi @Dennis Bridges and @Damien This issue is showing in the Kiwi HF2 dashboard as an unapproved hotfix. It looks like there was a PR that was declined, so no actual code was merged?
If no code, and closed as Cannot reproduce, then can we remove the Kiwi HF2 release value?
Dennis Bridges February 4, 2022 at 8:37 PM
Thanks so much for the clarification @Damien! I wasn't considering that it had been added to Juniper later on. This is all fitting together for me know.
Damien February 4, 2022 at 7:20 PMEdited
@Dennis Bridges The way I reproduce the issue with the API is by creating a new invoice line linked to a po line, with a reference to that po line encumbrance, but with a different fund id than the one used in the po line. This could not happen in the UI because if we create an invoice line from a po line, the same fund id is used.
I guess we could add a check in mod-invoice when creating an invoice line, to make sure the encumbrance is related to a po line with a fund distribution using the same fund id as the given one. But it's really an edge case, it would not even affect many (if any) people using the API.
Damien February 4, 2022 at 7:09 PM
@Dennis Bridges I was using the latest VM provided at https://app.vagrantup.com/folio/boxes/release , which is Juniper from Sept. 27. Since then, hotfix #3 released https://folio-org.atlassian.net/browse/MODINVOICE-310#icft=MODINVOICE-310, which is the same as https://folio-org.atlassian.net/browse/MODINVOICE-290#icft=MODINVOICE-290. I did not find it earlier because I could not find a link from https://folio-org.atlassian.net/browse/MODINVOICE-290#icft=MODINVOICE-290 to https://folio-org.atlassian.net/browse/MODINVOICE-310#icft=MODINVOICE-310, so I assumed it had not been released in a hotfix. Looking more thoroughly I found that it actually was. So in the latest Juniper, it would not be possible to create a new https://folio-org.atlassian.net/browse/MODFISTO-281#icft=MODFISTO-281 issue. However people might still be suffering from issues created earlier for the same invoice: after the approval fails in that way there is no way to fix the invoice even in the current Lotus.
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
Actual Results:
Additional Information:
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 https://folio-org.atlassian.net/browse/MODINVOICE-290#icft=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.
https://folio-org.atlassian.net/browse/MODFISTO-268#icft=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.
URL:
Interested parties: