[Koha-bugs] [Bug 7112] Having two prices in 020$c causes basket creation to fail from staged marc import

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 8 18:28:57 CET 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7112

--- Comment #3 from Kyle M Hall <kyle.m.hall at gmail.com> 2012-02-08 17:28:57 UTC ---
Created attachment 7512
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7512
Bug 7112 - Having two prices in 020$c causes basket creation to fail from
staged marc import

The root problem here is that the price is being pulled from the MARC record
and is then run through Number::Format::unformat_number. This routine is
really being misused, and should only be used to reverse the effects of
Number::Format on a number string. We are apparently using it to strip
out currency characters and the like.

Number::Format::unformat_number will choke if there is more than one period (.)
in the price field. MARC standards do not limit this field to a single period,
so unless there is only one period, we should skip number unformatting.
Examples of that break unformat_number include '18.95 (U.S.)', and
'$5.99 ($7.75 CAN)', both of which are perfectly valid.

This commit tests to see of $price contains more than one period,
if it does have multiple periods, it will skip running the string
though number_unformat.

The variable $price may fail to have an actual price, in which case
the price then defauls to '0.00', which would be rarely if ever the
correct price. To combat this, I have added highlighting to any
price in the Order Details table that begins with 0 ( i.e. '0.00' ).

Also, fixed the incomplete table footer, adding a new td with a
span of 3 to fill in the nonexistant cells.

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list