]> git.evergreen-ils.org Git - Evergreen.git/commit
Acq: Improvements to account-matching incoming EDI messages
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 14 Oct 2013 21:28:07 +0000 (17:28 -0400)
committerBen Shum <bshum@biblio.org>
Fri, 8 Nov 2013 22:24:30 +0000 (17:24 -0500)
commit58e051181ea229d3260d4dd1483bb359904623e5
tree05d52011ac32ca882aaacc3b77a1ca3ab0a23d11
parent53b95bb34f395848ef7da78e6b6497eb269bcd63
Acq: Improvements to account-matching incoming EDI messages

The way the EDI fetcher works gives us a problem. That process iterates
over EDI accounts for which it has FTP host and credential information,
downloads documents from each of those sites, and files the messages
within those documents under the EDI account from which the login
credentials came. The problem is that in practice the exact same host
and login information is used by multiple accounts under the same
vendor, and files relating to these sub-accounts are commingled, so that
you can't make the decision about which messages should be filed under
which accounts based on the name of the document or its location. You
have to make that decision later, based on its contents.

We are already incompletely doing this, distinguishing between
sub-accounts under which we could file our messages when the vendor
specifies the buyer's SAN next to the specific sub-account number *and*
those sub-accounts belong to different Evergreen org units. We still
need ways to distinguish in other cases.

This will do what is natural for at least one vendor, and match the
message content against the vendacct field of the acq.edi_account table.

*Also,*

We were re-retrieving the working acq.edi_message row from the database
before writing it, throwing away possible changes to the object in hand
made by O::A::Acq::EDI::process_parsed_msg(). We should only do that in
the case where that function has raised an exception.

We were doing the same kind of thing in another place actually inside
process_parsed_msg() where we set the edi_message's purchase_order field
based on the first lineitem encountered if the message itself didn't
specify a valid PO identifier.

This supports making account-correction work for ORDRSP messages in
addition to INVOIC messages.

We also propagate that same correction to the provider and shipper
fields of any invoices that get created from said edi_message.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm