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: Pushed to main
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: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks: 40334
  Show dependency treegraph
 
Reported: 2025-07-09 13:42 UTC by Martin Renvoize (ashimema)
Modified: 2025-10-22 15:49 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
The invoice display page now includes a section showing information about the EDIFACT interchange file that was used to create the invoice, with the ability to view the raw EDIFACT message data. Previously, when troubleshooting EDIFACT invoices or verifying invoice data against the original EDIFACT message, staff had to navigate separately to the EDIFACT messages administration page and search for the corresponding message file. This enhancement provides direct access from the invoice page, improving workflow efficiency and traceability. **Key features:** - **EDIFACT interchange information**: Display of message type, transfer date, status, and filename directly on the invoice page - **Raw message viewer**: "View EDIFACT interchange" button opens a modal displaying the complete raw EDIFACT data - **Error visibility**: Any EDIFACT processing errors are displayed prominently on the invoice page in a warning box - **Smart display**: The EDIFACT section only appears when the EDIFACT system is enabled and the invoice has an associated message **For acquisitions staff:** When viewing an invoice that was created from an EDIFACT message, you'll now see an "EDIFACT interchange" section after the vendor information. This section shows: - The interchange filename - Message type (e.g., INVOIC) - Transfer date and status - Any errors that occurred during processing - A button to view the complete raw EDIFACT data This enhancement is particularly useful for: - Troubleshooting invoice discrepancies - Verifying that EDIFACT data was parsed correctly - Supporting queries about invoice details - Training staff on EDIFACT processing
Version(s) released in:
25.11.00
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
Bug 40333: (follow-up) Terminology (4.14 KB, patch)
2025-10-07 17:42 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 40333: Tidy commit (14.14 KB, patch)
2025-10-07 17:42 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 40333: Add EDIFACT message view to invoice display page (15.45 KB, patch)
2025-10-07 17:42 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 40333: (follow-up) Terminology (4.14 KB, patch)
2025-10-07 19:07 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 40333: Tidy commit (14.14 KB, patch)
2025-10-07 19:07 UTC, Kyle M Hall (khall)
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.
Comment 10 Kyle M Hall (khall) 2025-10-07 17:42:24 UTC
Created attachment 187539 [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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall (khall) 2025-10-07 17:42:26 UTC
Created attachment 187540 [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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Kyle M Hall (khall) 2025-10-07 17:42:28 UTC
Created attachment 187541 [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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 13 Kyle M Hall (khall) 2025-10-07 17:42:29 UTC
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 14 Kyle M Hall (khall) 2025-10-07 19:07:50 UTC
Created attachment 187548 [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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 15 Kyle M Hall (khall) 2025-10-07 19:07:53 UTC
Created attachment 187549 [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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 16 Martin Renvoize (ashimema) 2025-10-16 10:09:03 UTC
Thanks for the QA's Kyle, this will end up one of the biggest releases for EDI improvements in some time I feel :)
Comment 17 Lucas Gass (lukeg) 2025-10-22 13:45:08 UTC
Nice work everyone!

Pushed to main for 25.11