EDIFACT quote processing will detect duplicate purchase order numbers and block basket creation from those orders when using the po_is_basketname setting for EDIfact processing. We should add the ability to notify the supplier, and alert library staff.
Created attachment 194517 [details] [review] Bug 42001: Database updates Adds system preferences and notice templates for duplicate EDI purchase order email notifications. New preferences: - EdiDuplicateOrderEmailNotice (YesNo) - EdiDuplicateOrderEmailAddresses (Textarea) New notice templates: - EDI_DUP_ORD_LIBRARY - library staff notification - EDI_DUP_ORD_VENDOR - vendor contact notification Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/> Sponsored-by: Royal Borough of Kensington and Chelsea <https://www.rbkc.gov.uk/>
Created attachment 194523 [details] [review] Bug 42001: Database updates Adds system preferences and notice templates for duplicate EDI purchase order email notifications. New preferences: - EdiDuplicateOrderEmailNotice (YesNo) - EdiDuplicateOrderEmailAddresses (Textarea) New notice templates: - EDI_DUP_ORD_LIBRARY - library staff notification - EDI_DUP_ORD_VENDOR - vendor contact notification Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/> Sponsored-by: Royal Borough of Kensington and Chelsea <https://www.rbkc.gov.uk/>
Created attachment 194524 [details] [review] Bug 42001: Email notifications for duplicate EDI purchase orders When create_edi_order detects a duplicate purchase order number (basket name conflict with po_is_basketname enabled), send email notifications to library staff and vendor EDI contacts, mirroring the behaviour already in place for duplicate EDIFACT invoices (bug 41297). New preference EdiDuplicateOrderEmailNotice enables/disables the feature. EdiDuplicateOrderEmailAddresses specifies library recipients. Vendor contacts flagged with edi_error_notification also receive notification via EDI_DUP_ORD_VENDOR. Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/> Sponsored-by: Royal Borough of Kensington and Chelsea <https://www.rbkc.gov.uk/>
Created attachment 194525 [details] [review] Bug 42001: Unit tests for duplicate order email notifications Adds a new top-level subtest 'duplicate_order_email_notifications' with three cases: 1. email_notification_disabled - verifies no mail is queued when EdiDuplicateOrderEmailNotice is off, while the duplicate PO block still fires correctly. 2. library_email_notification - verifies EDI_DUP_ORD_LIBRARY is enqueued to the configured library addresses, with subject and content checks. 3. vendor_email_notification - verifies EDI_DUP_ORD_VENDOR is enqueued for vendor contacts with edi_error_notification set. Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/> Sponsored-by: Royal Borough of Kensington and Chelsea <https://www.rbkc.gov.uk/>
Created attachment 194526 [details] [review] Bug 42001: (follow-up) Send new EDI duplicate order preferences to HEA Add EdiBlockDuplicateInvoice, EdiBlockDuplicateInvoiceEmailAddresses, EdiBlockDuplicateInvoiceEmailNotice, EdiDuplicateOrderEmailAddresses, and EdiDuplicateOrderEmailNotice to the list of system preferences reported to the Koha usage statistics service (HEA).