[Koha-bugs] [Bug 7516] New: Create Subroutine For GetMarcPrice that will discern the actual price from a given price field value.
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Feb 9 15:51:51 CET 2012
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7516
Bug #: 7516
Summary: Create Subroutine For GetMarcPrice that will discern
the actual price from a given price field value.
Classification: Unclassified
Change sponsored?: ---
Product: Koha
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Acquisitions
AssignedTo: henridamien at koha-fr.org
ReportedBy: kyle.m.hall at gmail.com
QAContact: koha.sekjal at gmail.com
The acquisitions system in Koha uses GetMarcPrice to get the price from a bib
record, but unless it is in a very specific format ( e.g. 123.45 ), the data
passed back is often no processed, and and no value is used. Currently, there
is no single function that attempts to find a good value if the field is not in
this particular format. I propose a new subroutine, MungeMarcPrice, that would
make a best attempt at finding a real number value in the price field. It
should do the following.
1) First, look to see if there are *any* numbers in the field, if not, fail
out.
2) Check for multiple price-like substrings in the price string, if multiple
are found, use the first.
3) Convert decimal commas, to decimal periods, as that is the format Koha uses.
Here is a question; do all common currency formats use only two trailing
digits?
Examples:
"$1.95" => "1.95"
"$5.99 ($7.75 CAN)" => "5.99"
"Rs15.76 ($5.60 U.S.)" => "15.75"
Here, we could use the currency and exchange rates table to attempt to fine the
active currency, and search for that first, in which case the output would be
"5.60"
"Rental material" => ""
"For sale ($450.00) or rent ($45.00)" => "450.00"
"For sale ($200.00 for 3/4 in.; $150.00 for 1/2 in." => "200.00"
"$4.95 (lib. bdg.)" => "4.95"
--
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the Koha-bugs
mailing list