http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9593 Bug ID: 9593 Summary: Prices not imported correctly from a staged file Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: koha@univ-lyon3.fr Created attachment 15269 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=15269&action=edit Prices not imported correctly from a staged file When importing a record from a staged file, sometimes, the price is set to 0 in the Vendor price field (Accounting details block) even if initially present. it occurs when the price is written without decimals : example : 19 EUR. In this case it's not captured by the regular expression in MungeMarcPrice routine (Biblio.pm) : ( $price ) = $price =~ m/([\d\,\.]+[[\,\.]\d\d]?)/; Same thing if the currency symbol was used after the digits, the result would be the same because of this : $price = $parts[1]; If I got it well, seems that the whole routine can be replaced by 2 regular expressions (may be we could even go up to a single one) integrated in GetMarcprice : the first part (symbol treatment) is unusefull as it can be treated directly by the regular expression that's following it. The part concerning groups of more than 2 digits ( if I got it, it 's come out to delete the eventual separator between thousands and hundreds) can be replaced by another regular expression. Test Plan : 1) get on your pc, the joined example file (testfile.elc). That's the kind of file most currently used in France for our acquisitions. Most of the prices in it match the pattern '[digit][digit] EUR' except 2 titles out of them : La méthodologie appliquée du commentaire de texte (14,20 EUR) Le tournant artiste de la littérature française (54,80 EUR) 2) Go to Tools/Stage MARC records for import and stage it in koha. 3) Go to Acquisition module, and an open basket of your choice and click on 'From a staged file' 4) Choose testfile.elc and add it to the basket 5) Click on the first individual 'add order' link : the price might beeing set to 00.00 in the 'Vendor price' field of Accounting details block. 6) Now go back with go back function of your browser : 7) Apply the patch 8) Click again on the same link 9) The price is now present (I hope so) 10 Sign off (I hope so again) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.