Acq Record Import Fails because of dollar sign in price field

Bug #1449724 reported by Chris Sharp on 2015-04-28
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Undecided
Unassigned

Bug Description

Vendor-created order records often contain a $ character in the price (020/022 $c) field, which is valid under MARC rules. However, when imported via the "Load MARC Order Records" function, the import fails with the message "Event: 2002:DATABASE_QUERY_FAILED -> The attempt to query to the DB failed" in the UI and " ERROR: invalid input syntax for type numeric: "$" at character 1575" in the database. Evergreen should accommodate the existence of these characters and strip them out before they reach the database.

Evergreen 2.7.2+
OpenSRF 2.4.0
PostgreSQL 9.3
Ubuntu LTS

Sample record file attached.

Tags: acq Edit Tag help
Chris Sharp (chrissharp123) wrote :
Chris Sharp (chrissharp123) wrote :

Correction - the price is available in 020 $c, not 022 (which lacks a $c).

Galen Charlton (gmc) wrote :

The line item attribution definition has a "remove" column that lets you specify a regular expression; anything that matches the regexp gets removed when the attributes are parsed from the MARC record. Consequently, you should be able to work around that by setting a regexp that removes the leading dollar sign and spaces.

If you get that to work, I think it would be very reasonable to write a patch to update the default set of line item attribution definitions so that new installations can benefit.

tags: added: acq
Chris Sharp (chrissharp123) wrote :

Okay, thanks to Galen, I have resolved this issue by adding the following to the "Remove" field for "estimated_price" in Admin -> Server Administration -> Acquisitions -> Line Item MARC Attribute Definitions. So not a bug.

Changed in evergreen:
status: New → Invalid
Chris Sharp (chrissharp123) wrote :

Oops, I added "[^0-9.]" which means "remove everything that's not a digit or decimal point

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

Other bug subscribers