Acq: In EDI invoices, avoid taking reference to PO too seriously
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
2.3 |
Fix Released
|
Medium
|
Unassigned | ||
2.4 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Evergreen 2.3+
EDI Invoices from book vendors have a segment where we try to parse out a number that's supposed to point to the purchase order related to the invoice. There are problems with this.
1) Invoices usually reference lineitems that came from many different POs, and there's only ever at most one PO # in this field in practice. (And I'm not addressing this problem for now, just noting it for the record).
2) Some vendors put alphanumeric strings in here instead of the PO id. And I mean values that aren't the PO's name field, either. In some cases, the string is just the vendor's name!
It's problem 2 I'm addressing for now. Since the existing code wants to match these numbers to a PO in the system, I'm still leaving that in place as long as the string given by the vendor is all digits. If the string is not all digits, then we just proceed without looking for a PO or setting any value in the purchase_order column of the acq.edi_message row we're creating.
description: | updated |
Changed in evergreen: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in evergreen: | |
milestone: | 2.5.0-m1 → 2.5.0-m2 |
Changed in evergreen: | |
milestone: | 2.5.0-m2 → 2.5.0-alpha1 |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
After applying this patch, we got repeated errors like:
2013-06-04 22:22:51 guitar ./edi_fetcher.pl: [ERR :4797:EDI.pm:258:] create_ acq_invoice_ from_edi( ..., <acq.edi_message #1728>): no LI found with ID: 0088176455 : HASH(0x4d87d48) at /usr/local/ share/perl/ 5.14.2/ OpenILS/ Application/ Acq/EDI. pm line 944.
Previously, we were seeing random things like:
2013-06-04 22:25:11 guitar open-ils.cstore: [ERR :5160:oils_ sql.c:5645: ] open-ils.cstore: Error retrieving acq::purchase_order with query [SELECT "acqpo".id, "acqpo".owner, "acqpo" .create_ time, "acqpo".edit_time, "acqpo".provider, "acqpo".state, "acqpo" .ordering_ agency, "acqpo".creator, "acqpo".editor, "acqpo".order_date, "acqpo".name, "acqpo" .cancel_ reason, "acqpo" .prepayment_ required FROM acq.purchase_order AS "acqpo" WHERE "acqpo".id = 'TGPB31913';]: 0 ERROR: invalid input syntax for integer: "TGPB31913"#012LINE 1: ... acq.purchase_order AS "acqpo" WHERE "acqpo".id = 'TGPB31913...#012
Related to the changes or illustrating that there's some really junky stuff in the EDI files we're fetching? Interestingly, prior to the patch, edi_fetcher.pl lists zero new files grabbed, and post-adding this patch we get 103 files retrieved each time we run it. So maybe it's processing them and dying somewhere...