Custom/local EDI reader module for ORDRSP and INVOIC (etc)

Provides a new perl module (OpenILS::Utils::EDIReader) for reading
inbound EDI messages and producing data structures more easily
understood by the ACQ code.  Through this, extraction of EDI data is
focused in one module instead of spread through various layers.

EDIReader is a small, purpose built module focusing solely on extracting
the needed EDI data and is not meant to be a general purpose EDI library.

* Updates edi_fetcher and the ORDRSP and INVOIC handling code to use the
  new libs.

* Removes Business::EDI Evergreen dependency, since it's no longer used (and
  is quite large).

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
EDIReader : detect SAN vs. account number in buyer/seller

NAD+BY+XXXXXXX::31B' -- SAN
NAD+BY+YYYYYYY::91' -- Account number

For invoices, try the SAN first followed by the account number to
determine the receiving org unit.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
EDI: protect against invalid order response

Do not attempt to createI EDI messages for order responses which
reference nonexistent purchase orders, since it results in
transaction commit errors on invalid foreign keys, preventing
subsequent EDI files from getting processed.  Instead, log it
and skip it.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
EDI response honor lineitem-level status; debit cleanup

* Honor lineitem-level order status info (FTX+LIN) which indicates, in
  some cases, that all ordered copies should be cancelled because the LI
  as a whole is cancelled

* Delete fund debits for cancelled lineitem details when appropriate

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
EDI: ensure lineitem 'state' matches cancel state

When cancelling a lineitem becuase all linked copies are cancelled,
ensure that the lineitem state is set to "cancelled".

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
EDI invoice date; invoice paid quantity/amount

* capture the invoice date in EDIReader
* apply the invoice date to inbound invoices when available instead of
  defaulting to 'now'
* apply the quantity/amount billed to the quantity/amount paid to reduce
  staff data entry needs

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
EDIReader: improve monetary regexes

Make no attempt to enforce/decipher monetary amounts in the regexes,
simply capture the values.  If they are invalid, Postgres will let us
know.

This change allows us to capture non-numeric (\d) characters (e.g. "."),
which are of course common in monetary amounts.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Handle cancelled (back-order) lineitems in EDI invoice

Receiving an invoice for a cancelled lineitem mean the lineitem is no
longer cancelled.  Identify such lineitems and uncancel them along with
the requested number of not-yet-invoiced copies.

This work flow is common for back-order items.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
EDIReader release notes

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Upgrade script numbering for edireader branch

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>