[Bug 7516] New: Create Subroutine For GetMarcPrice that will discern the actual price from a given price field value.
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@koha-fr.org ReportedBy: kyle.m.hall@gmail.com QAContact: koha.sekjal@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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7516 --- Comment #1 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-09 16:46:11 UTC --- This should also perhaps take into account commas and decimal commas. Examples: "1,000,00" => "1000.00" "$12,232,342.00" => "12232242.00" -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7516 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE --- Comment #2 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-09 19:15:49 UTC --- *** This bug has been marked as a duplicate of bug 7112 *** -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org