Bug 40333 - When EDIFACT is enabled, one should be able view the corresponding EDIFACT INVOICE message on the Koha Invoice page
Summary: When EDIFACT is enabled, one should be able view the corresponding EDIFACT IN...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 40334
  Show dependency treegraph
 
Reported: 2025-07-09 13:42 UTC by Martin Renvoize (ashimema)
Modified: 2025-07-18 14:32 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40333: Add EDIFACT message link to invoice display page (27.56 KB, patch)
2025-07-09 15:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Example display (88.70 KB, image/png)
2025-07-09 15:11 UTC, Martin Renvoize (ashimema)
Details
Bug 40333: Add EDIFACT message view to invoice display page (15.26 KB, patch)
2025-07-10 13:34 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 40333: Tidy commit (13.95 KB, patch)
2025-07-10 13:35 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 40333: Add EDIFACT message view to invoice display page (15.38 KB, patch)
2025-07-18 14:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 40333: Tidy commit (14.07 KB, patch)
2025-07-18 14:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 40333: (follow-up) Terminology (4.07 KB, patch)
2025-07-18 14:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2025-07-09 13:42:45 UTC
Right now, there's not link back to display the edifact invoice message associated with a Koha invoice.. it would be helpful to have a quick link back from the Invoice display page.
Comment 1 Martin Renvoize (ashimema) 2025-07-09 15:09:45 UTC Comment hidden (obsolete)
Comment 2 Martin Renvoize (ashimema) 2025-07-09 15:11:38 UTC Comment hidden (obsolete)
Comment 3 Hannah Dunne-Howrie 2025-07-09 15:54:32 UTC
Oh, I like this idea...
Comment 4 Martin Renvoize (ashimema) 2025-07-10 13:34:58 UTC
Created attachment 183941 [details] [review]
Bug 40333: Add EDIFACT message view to invoice display page

This enhancement adds an EDIFACT message section to the invoice display page.
If there's a linked EDI Message for this invice, we display the basic
details along with any parsing errors that may have been recorded and we
add a button to trigger the display of the raw message in a modal.

Changes include:
- Display EDIFACT message information on invoice page when available
- Show message type, transfer date, status, and filename
- Add "View EDIFACT message" button that opens modal with raw message
- Display EDIFACT processing errors directly on invoice page
- Create reusable modal components for EDIFACT message display

The implementation checks if the EDIFACT system is enabled and if the
invoice has an associated message_id before displaying the EDIFACT
section. Processing errors are highlighted in a warning box with
clear formatting.
Comment 5 Martin Renvoize (ashimema) 2025-07-10 13:35:01 UTC
Created attachment 183942 [details] [review]
Bug 40333: Tidy commit

The commit hook was deliverately disabled for the previous commit and
this commit added distinctly to ensure clarity between the functional
code change and the massive tidy that the hook created.

In that last commit we remove the last remaining TT variable from the
<script> block in that template and as such we unlock the JS tidying on
that block.. nice, except it hides the functional change in the mass
commit of whitespace, quoting and newline changes.
Comment 6 Martin Renvoize (ashimema) 2025-07-18 14:23:19 UTC
Created attachment 184385 [details] [review]
Bug 40333: Add EDIFACT message view to invoice display page

This enhancement adds an EDIFACT message section to the invoice display page.
If there's a linked EDI Message for this invice, we display the basic
details along with any parsing errors that may have been recorded and we
add a button to trigger the display of the raw message in a modal.

Changes include:
- Display EDIFACT message information on invoice page when available
- Show message type, transfer date, status, and filename
- Add "View EDIFACT message" button that opens modal with raw message
- Display EDIFACT processing errors directly on invoice page
- Create reusable modal components for EDIFACT message display

The implementation checks if the EDIFACT system is enabled and if the
invoice has an associated message_id before displaying the EDIFACT
section. Processing errors are highlighted in a warning box with
clear formatting.

Sponsored-by: Open Fifth <https://openfith.co.uk>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Comment 7 Martin Renvoize (ashimema) 2025-07-18 14:23:21 UTC
Created attachment 184386 [details] [review]
Bug 40333: Tidy commit

The commit hook was deliverately disabled for the previous commit and
this commit added distinctly to ensure clarity between the functional
code change and the massive tidy that the hook created.

In that last commit we remove the last remaining TT variable from the
<script> block in that template and as such we unlock the JS tidying on
that block.. nice, except it hides the functional change in the mass
commit of whitespace, quoting and newline changes.

Sponsored-by: Open Fifth <https://openfith.co.uk>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Comment 8 Martin Renvoize (ashimema) 2025-07-18 14:23:23 UTC
Created attachment 184387 [details] [review]
Bug 40333: (follow-up) Terminology

The envelope level of EDIFACT is called an 'Interchange'. This patch
updates our UI terminology to match the official protocol terminology as
what we're actually displaying here is the Interchange file that
contains the related message for the Invoice.  The interchange file will
often contain other messages of the same type that came through at the
same time of the this invoice generation.

Sponsored-by: Open Fifth <https://openfith.co.uk>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Comment 9 Hannah Dunne-Howrie 2025-07-18 14:32:32 UTC
This is a fantastic feature and saves our library systems team time when supporting queries as we don't need to spend extra time combing the edi messages area for the corresponding file to check for the edifact included regarding a particular invoice. It is working as expected and so far and we are grateful for it's inclusion in our instance of Koha.