Invoice Transaction not created

Description

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:

  1. Create 2 funds and budgets

  2. Create an order

  3. Create an order line with the first fund

  4. Open the order

  5. Create an invoice

  6. Add an invoice line linked to the po line

  7. Change the invoice line fund to the second fund

  8. Approve the invoice - this will fail with a 400 in Juniper before HF3

  9. Unopen the order

  10. Remove the fund distribution from the order line

  11. Add a new fund distribution with the new fund to the order line

  12. Reopen the order

  13. Remove the invoice line

  14. Add another invoice line with the second fund

  15. Approve the invoice

  16. Pay the invoice

  17. Check the payment transaction

  18. 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:

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Attachments

1
  • 04 Feb 2022, 09:01 PM

Checklist

hide

TestRail: Results

Activity

Show:

Damien March 3, 2022 at 4:40 PM

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 and 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 ! 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 PM
Edited

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

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.

Cannot Reproduce

Details

Assignee

Reporter

Tester Assignee

Labels

Priority

Story Points

Sprint

Development Team

Thunderjet

Affected Institution

!!!ALL!!!

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created January 11, 2022 at 8:17 PM
Updated April 28, 2022 at 4:01 AM
Resolved February 4, 2022 at 6:01 PM
TestRail: Cases
TestRail: Runs

Flag notifications