| Summary: | Add duplicate invoice number detection on EDI invoice import | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
| Component: | Acquisitions | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
| Status: | Needs Signoff --- | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | hdunne-howrie |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | Sponsored | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Bug Depends on: | 40383 | ||
| Bug Blocks: | 38195 | ||
| Attachments: |
Bug 41297: Block duplicate EDIFACT invoice processing
Bug 41297: Block duplicate EDIFACT invoice processing Bug 41297: Block duplicate EDIFACT invoice processing |
||
|
Description
Martin Renvoize (ashimema)
2025-11-25 10:25:10 UTC
Created attachment 189962 [details] [review] Bug 41297: Block duplicate EDIFACT invoice processing This patch adds duplicate invoice detection and blocking for EDIFACT invoice processing, with email notifications to library staff and vendors. Key features: 1. System preferences to enable/disable duplicate blocking and email notifications 2. Database index on aqinvoices (invoicenumber, booksellerid) for performance 3. Email notifications using the message_queue (GetPreparedLetter → EnqueueLetter pattern) 4. Vendor contact-based notifications via a new aqcontacts.edi_error_notification flag 5. Two notice templates (EDI_DUP_INV_LIBRARY and EDI_DUP_INV_VENDOR) Changes: - Add EdiBlockDuplicateInvoice system preference - Add EdiBlockDuplicateInvoiceEmailNotice system preference - Add EdiBlockDuplicateInvoiceEmailAddresses system preference - Add edi_error_notification column to aqcontacts table - Add duplicate invoice detection logic to Koha::EDI::process_invoice - Add email notification support using standard Koha messaging queue - Add "Contact about EDI errors" checkbox to vendor contacts UI - Add notice templates to sample_notices.yml for fresh installations - Add test coverage in t/db_dependent/Koha/EDI.t Test plan: 1. Run database update: perl installer/data/mysql/updatedatabase.pl 2. Enable system preferences: - Set EdiBlockDuplicateInvoice to "Block" - Set EdiBlockDuplicateInvoiceEmailNotice to "Send" - Set EdiBlockDuplicateInvoiceEmailAddresses to valid email(s) 3. Edit a vendor and add a contact with "Contact about EDI errors" enabled 4. Process an EDIFACT invoice 5. Attempt to process the same invoice again - should be blocked 6. Check message_queue table for queued notifications 7. Run tests: prove t/db_dependent/Koha/EDI.t :: duplicate_invoice_blocking Created attachment 189963 [details] [review] Bug 41297: Block duplicate EDIFACT invoice processing This patch adds duplicate invoice detection and blocking for EDIFACT invoice processing, with email notifications to library staff and vendors. Key features: 1. System preferences to enable/disable duplicate blocking and email notifications 2. Database index on aqinvoices (invoicenumber, booksellerid) for performance 3. Email notifications using the message_queue (GetPreparedLetter → EnqueueLetter pattern) 4. Vendor contact-based notifications via a new aqcontacts.edi_error_notification flag 5. Two notice templates (EDI_DUP_INV_LIBRARY and EDI_DUP_INV_VENDOR) Changes: - Add EdiBlockDuplicateInvoice system preference - Add EdiBlockDuplicateInvoiceEmailNotice system preference - Add EdiBlockDuplicateInvoiceEmailAddresses system preference - Add edi_error_notification column to aqcontacts table - Add duplicate invoice detection logic to Koha::EDI::process_invoice - Add email notification support using standard Koha messaging queue - Add "Contact about EDI errors" checkbox to vendor contacts UI - Add notice templates to sample_notices.yml for fresh installations - Add test coverage in t/db_dependent/Koha/EDI.t Test plan: 1. Run database update: perl installer/data/mysql/updatedatabase.pl 2. Enable system preferences: - Set EdiBlockDuplicateInvoice to "Block" - Set EdiBlockDuplicateInvoiceEmailNotice to "Send" - Set EdiBlockDuplicateInvoiceEmailAddresses to valid email(s) 3. Edit a vendor and add a contact with "Contact about EDI errors" enabled 4. Process an EDIFACT invoice 5. Attempt to process the same invoice again - should be blocked 6. Check message_queue table for queued notifications 7. Run tests: prove t/db_dependent/Koha/EDI.t :: duplicate_invoice_blocking Created attachment 189964 [details] [review] Bug 41297: Block duplicate EDIFACT invoice processing This patch adds duplicate invoice detection and blocking for EDIFACT invoice processing, with email notifications to library staff and vendors. Key features: 1. System preferences to enable/disable duplicate blocking and email notifications 2. Database index on aqinvoices (invoicenumber, booksellerid) for performance 3. Email notifications using the message_queue (GetPreparedLetter → EnqueueLetter pattern) 4. Vendor contact-based notifications via a new aqcontacts.edi_error_notification flag 5. Two notice templates (EDI_DUP_INV_LIBRARY and EDI_DUP_INV_VENDOR) Changes: - Add EdiBlockDuplicateInvoice system preference - Add EdiBlockDuplicateInvoiceEmailNotice system preference - Add EdiBlockDuplicateInvoiceEmailAddresses system preference - Add edi_error_notification column to aqcontacts table - Add duplicate invoice detection logic to Koha::EDI::process_invoice - Add email notification support using standard Koha messaging queue - Add "Contact about EDI errors" checkbox to vendor contacts UI - Add notice templates to sample_notices.yml for fresh installations - Add test coverage in t/db_dependent/Koha/EDI.t Test plan: 1. Run database update: perl installer/data/mysql/updatedatabase.pl 2. Enable system preferences: - Set EdiBlockDuplicateInvoice to "Block" - Set EdiBlockDuplicateInvoiceEmailNotice to "Send" - Set EdiBlockDuplicateInvoiceEmailAddresses to valid email(s) 3. Edit a vendor and add a contact with "Contact about EDI errors" enabled 4. Process an EDIFACT invoice 5. Attempt to process the same invoice again - should be blocked 6. Check message_queue table for queued notifications 7. Run tests: prove t/db_dependent/Koha/EDI.t :: duplicate_invoice_blocking Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/> Sponsored-by: Royal Borough of Kensington and Chelsea <https://www.rbkc.gov.uk/> |