Details
-
Bug
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
None
-
-
ACQ Sprint 133
-
3
-
Thunderjet
-
Lotus R1 2022
-
Current workaround is to call invoice-storage api directly and put invoice line without encumbrance id in fund distribution.
Description
Overview: If order line fund distribution is changed to a different fund before linked invoice approval, invoice is stuck with a link to a deleted encumbrance, which prevents payment.
Steps to Reproduce:
- Log into FOLIO environment (kiwi or later) as a user with admin permissions.
- Create an order and order line with fund distribution.
- Open order.
- Create an invoice and add order line from step 2 as invoice line.
- Change order line fund distribution to a different fund by deleting existing fund distribution via clicking on trash icon and adding new (not just selection other fund from dropdown)
- Approve invoice.
- Pay invoice.
Expected Results:
Invoice payment is successful.
Actual Results:
Invoice payment fails because it has link to a deleted encumbrance.
Additional Information:
Response:
{ "errors" : [ { "message" : "One or more transactions record(s) failed to be created", "code" : "transactionCreationFailure", "parameters" : [ { "key" : "invoiceLineId", "value" : "29e8f0dc-b274-4b88-ab1c-a2be79b89167" }, { "key" : "fundId", "value" : "55f48dc6-efa7-4cfe-bc7c-4786efe493e3" } ] } ], "total_records" : 1 }
mod-finance-storage logs:
2021-11-26T13:19:28,360 ERROR [vert.x-eventloop-thread-1] TemporaryInvoiceTransactionDAO Transaction creation with id=c52ce966-2655-44ab-b779-96c4b1631352 failed io.vertx.pgclient.PgException: { "message": "insert or update on table \"temporary_invoice_transactions\" violates foreign key constraint \"paymentencumbranceid_transaction_fkey\"", "severity": "ERROR", "code": "23503", "detail": "Key (paymentencumbranceid)=(6e7dd118-e116-4b9c-bd92-d8ff04be9f36) is not present in table \"transaction\".", "file": "ri_triggers.c", "line": "2463", "routine": "ri_ReportViolation", "schema": "diku_mod_finance_storage", "table": "temporary_invoice_transactions", "constraint": "paymentencumbranceid_transaction_fkey" }
Potential resolution:
In mod-orders, when removing a fund distribution, check if an invoice is linked with order-invoice-relns and if so remove all related encumbrance links from invoice lines, in EncumbranceService$deleteEncumbrances (requires adding permission invoice.invoice-lines.item.put).
TestRail: Results
Attachments
Issue Links
- defines
-
UXPROD-3310 Thunderjet - Lotus (R1 2022) Tech Debt, NFR
-
- Closed
-
- is cloned by
-
MODORDERS-688 Kiwi (R3 2021) Hot Fix #3 - Invoice payment fails if order line fund distribution is changed before invoice approval
-
- Closed
-
- relates to
-
MODINVOICE-331 Juniper - Approval failed invoice which built from order line with cost 0
-
- Closed
-
-
MODORDERS-640 Invoice payment failed if related order was opened after invoice approval
-
- Closed
-
-
MODORDERS-654 POL encumbrance "expended" value not updated
-
- Open
-
-
MODORDERS-731 Invoices cannot be approved/paid
-
- Closed
-