Koha-clms/acqui
Martin Renvoize 68123ef9fc
Bug 40587: Auto-select EAN from QUOTE message when creating EDIFACT orders
When a basket is generated via an EDI QUOTE message, the QUOTE message
includes a library's EAN code (buyer_ean). This patch makes the 'Create
EDIFACT order' button automatically use the EAN from the original QUOTE
message instead of requiring manual EAN selection.

This patch also fixes a bug in process_quote where all baskets in
multi-message QUOTE transports incorrectly used the first message's
buyer_ean, even when subsequent messages had different EANs.

Changes made:

1. Fixed Koha/EDI.pm process_quote auto-order creation to use the correct
   buyer_ean for each message/basket pair in multi-message transports
2. Enhanced acqui/basket.pl to extract and provide the quote_ean from
   QUOTE messages, handling both single and multi-message scenarios
3. Updated basket.tt template to automatically select the EAN from the
   original QUOTE message when available and matching

Test plan:
1. Create a vendor with EDI account and multiple EANs configured
2. Process a QUOTE message that creates a basket
3. Go to the basket page and click "Create EDIFACT order"
4. Verify it automatically uses the EAN from the QUOTE message
   (shows tooltip "Using EAN from original QUOTE message")
5. Test with multi-message QUOTE files to ensure each basket uses
   the correct EAN from its corresponding message
6. Verify fallback behavior when no QUOTE EAN matches available EANs

Sponsored-by: OpenFifth <https://openfifth.co.uk/>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 47546f0849)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-10-29 10:02:20 +01:00
..
acqui-home.pl Bug 39044: Pass budgets to template 2025-02-13 15:31:00 +01:00
addorder.pl Bug 35044: (QA follow-up): DRY code before set_additional_fields 2024-08-23 18:21:26 +02:00
addorderiso2709.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
ajax-getauthvaluedropbox.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
basket.pl Bug 40587: Auto-select EAN from QUOTE message when creating EDIFACT orders 2025-10-29 10:02:20 +01:00
basketgroup.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
basketheader.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
booksellers.pl Bug 40066: Restore budget check to booksellers.pl 2025-06-17 21:43:04 +02:00
cancelorder.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
check_budget_total.pl Bug 39325: Manual fixes 2025-04-28 18:51:23 +02:00
check_uniqueness.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
duplicate_orders.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
edifactmsgs.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
edimsg.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
finishreceive.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
histsearch.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
invoice-files.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
invoice.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
invoices.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
lateorders-export.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
lateorders.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
moddeliverydate.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
modordernotes.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
neworderempty.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
newordersubscription.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
newordersuggestion.pl Bug 31632: (QA follow-up) Align behavior with order from suggestion 2025-07-10 22:47:25 +02:00
ordered.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
orderreceive.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
parcel.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
parcels.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
showorder.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
spent.pl Bug 39319: Fixes for Pod::Checker 2025-04-14 08:51:21 +02:00
transferorder.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
uncertainprice.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
vendor_issues.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
vendors.pl Bug 38010: (QA follow-up) Move syspref values to config endpoint 2025-05-02 17:19:26 +02:00
z3950_search.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00