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

            Bug ID: 43804
           Summary: Add after_edifact_action plugin hook for processed
                    EDIFACT messages
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Acquisitions
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
  Target Milestone: ---

Koha has plugin hooks around bibliographic, item, hold, circulation and account
actions, but nothing that lets a plugin react once an EDIFACT message has been
processed. Plugins can currently only take over invoice processing
(edifact_process_invoice) or alter order sending (edifact_order).

Plugins that need to act after a QUOTE, INVOICE or ORDRSP has been processed
have to poll edifact_messages for new or recently changed rows. That is racy
against the next edi_cron.pl run, and it does not work for invoices processed
manually from the staff interface.

Typical uses: finance reconciliation, exporting to external systems, alerting,
extracting data Koha does not handle itself (e.g. invoice service charges), and
post-processing records created from a quote.

This patch adds after_edifact_action, following the existing after_*_action
pattern (after_biblio_action, after_item_action, ...):

  after_edifact_action( {
      action  => 'process',
      payload => {
          message      => $row,
          message_id   => $id,
          message_type => 'QUOTE' | 'INVOICE' | 'ORDRSP',
      },
  } )

It is called from process_quote, process_invoice and process_ordrsp in
Koha::EDI once processing has finished, so it fires for both edi_cron.pl and
manual processing. For quotes it fires after any auto-orders are created. For
invoices it also fires when a vendor plugin processes the invoice itself via
edifact_process_invoice.

Test plan:
1. Apply the patch
2. prove t/db_dependent/Koha/Plugins/Edifact_hooks.t
   => Tests pass
3. Revert the Koha/EDI.pm change and run the test again
   => It fails
4. prove t/db_dependent/Koha/EDI.t
   => Tests pass

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to