LP1770202: Handle EDI order statuses 220, 221, 222, 223, 401, 402 user/sandbergja/lp1770202_more_edi_order_statuses
authorJane Sandberg <sandbej@linnbenton.edu>
Wed, 23 May 2018 17:14:47 +0000 (10:14 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Wed, 23 May 2018 17:18:07 +0000 (10:18 -0700)
To test:
1) Apply this commit
2) Create a purchase order and activate it
3) Create an ORDRSP EDI file relevant to the items on the purchase order
that makes use of one of these order statuses.  Process it.
4) Make sure that those order statuses cause items to be canceled or
backordered properly in the acq interface.

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm

index 49feb96..871e61f 100644 (file)
@@ -788,7 +788,11 @@ sub process_parsed_msg {
                     if ($stat eq '200') { 
                         $reason_id = 1007; # not accepted
 
-                    } elsif ($stat eq '400') { 
+                    } elsif ($stat =~ /22[0-3]/) { 
+                        $reason_id = 1285; # canceled by vendor
+                    }
+
+                    } elsif ($stat =~ /40[0-2]/) { 
                         $reason_id = 1283; # back-order
                     }