https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41297

--- Comment #2 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 189963
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189963&action=edit
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

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to