EDI: Evergreen ignores NAD+BY lines that end in ::91

Bug #1736228 reported by Jane Sandberg
This bug affects 3 people
Affects Status Importance Assigned to Milestone

Bug Description

Our vendor places our SAN in a line that ends with ::91, rather than the expected ::31B. This leads Evergreen 2.12 to give us the following error:

create_acq_invoice_from_edi(..., ): unable to determine buyer (org unit) in invoice; buyer_san=; buyer_acct= at /usr/local/share/perl/5.14.2/OpenILS/Application/Acq/EDI.pm line 1040.

However, even if the vendor used the ::91 lines as they are expected to be used (locally defined values, rather than official SANs), they would still be disregarded by Evergreen, which is expecting that locally defined values end with ::92. The difference between ::91 vs ::92 is that ::91 codes are assigned by the supplier, while ::92 codes are assigned by the buyer -- it seems like it would be nice to accept both types of codes.

So, I'd propose two changes:

1) If Evergreen can't find a valid ::31B, it should check for a valid SAN in ::91 and ::92 NAD+BY lines
2) Evergreen should accept buyer_accts from both ::91 and ::92 lines.


Thanks very much to berick for helping me understand this; EDI makes my head spin. :-)

Revision history for this message
Jane Sandberg (sandbej) wrote :

Related bug talks about yet another location for vendcodes: https://bugs.launchpad.net/evergreen/+bug/1713138

Jane Sandberg (sandbej)
tags: added: edi
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Tiffany Little (tslittle) wrote :

To add to this bug, although I'm not sure it's *exactly* the same since the bug is a few years old. In both cases, the NAD+BY::91 seems to be ignored, so adding it here.

We have two vendors that are sending us ORDSRP messages like:
NAD+BY::31B -- library's SAN
NAD+BY::91 -- Account number

Evergreen doesn't seem to be recognizing the NAD+BY::91 line is there--it completely ignores it and just attaches the message to one of the EDI accounts with the same FTP login info.

I don't understand Perl well enough to read this correctly, but looking at EDI.pm starting at line 518:

 process_message_buyer() is used in processing both INVOIC
# messages as well as ORDRSP ones. As such, the $eg_inv parameter is
# optional.
sub process_message_buyer {
    my ($class, $e, $msg_hash, $message, $log_prefix, $eg_inv) = @_;

    # some vendors encode the account number as the SAN.
    # starting with the san value, then the account value,
    # treat each as a san, then an acct number until the first success
    for my $buyer ( ($msg_hash->{buyer_san}, $msg_hash->{buyer_acct}) ) {
        next unless $buyer;

So does that mean it looks, finds the buyer_san first in the NAD+BY::31B, and then exits without ever seeing the buyer_acct?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers