[Koha-bugs] [Bug 9593] Prices not imported correctly from a staged file

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 10 16:58:00 CEST 2013


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

Koha Team Lyon 3 <koha at univ-lyon3.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #17949|0                           |1
        is obsolete|                            |

--- Comment #23 from Koha Team Lyon 3 <koha at univ-lyon3.fr> ---
Created attachment 18070
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18070&action=edit
Prices not imported correctly from a staged file

Here is a new version of my patch that seeks to treat correctly every form of
price sequence whatever the position of the symbol and even if the iso code is
used.

It 's still possible to pick another price than the default one ( default=first
of the price zone string) but unlike the previous mechanism of MungeMarcPrice
which worked only for prices preceded by the currency sign, it's now valid
wherever the symbol is situated.
As symbol you may enter a pure currency sign as well as a string in which it's
included ('$US') or a plain latin character string ('Br'). 
Moreover, an 'isocode' column had been added in currency table (editable in the
pro interface from Administration/Currencies and exchange rates)
So you can also choose to pickup a currency from its iso code.
Isocode is checked first if provided and symbol then. 
If no active currency is defined, the first price will be systematically picked
up;
Beware that currency will be activated in currency table only if necessary,
this to avoid unusefull checkings.
Whenever active currency is enabled and neather the symbol nor the isocode is
found in the price string, the resulting price is set to 0 rather than
picking the first one. This, to avoid merging prices in different currencies.

I furnish a little test file ("sampl_multi_currencies") where the price zones
look like this :
A hauteur d'homme : 75.40 EUR, 93.5 USD, 20 250 EGP
A la conquête du Graal : $44, 23 €, 64 Br, £30
Bernanos et les âges de la vie : 25,5 EUR, $US32, $LD35
Chateaubriand et la gravité du comique : 38 Ksh, ¥300, $62
Ecrire la sculpture : 32 EUR, 45$ CAN, 46$ USD

I customized it with MarcTools : it's important to note that in MarcTools the
dollar as currency sign has to be wrote down {dollar} not to be taken as a
separator and truncate the price zone.

Test Plan for multi currencies price zone :

   1) Go to Pro interface Administration/Currencies and exchange rates and
enter the data for the currency 
      you would like to be privileged when different currencies are present.
      Mean that you make it active of course.
   2) Get on your pc, an isofile with multi currencies price zone.
   3) Go to Tools/Stage MARC records for import and stage it in koha.
   4) Go to Acquisition module, and an open basket of your choice and click on
'From a staged file'
   5) Choose your test file and add it to the basket
   6) Click on an individual 'add order' link where you know the 'active
currency' is not on first price and is following the digit part :
      the price might beeing set to 00.00 in the 'Vendor price' field of
Accounting details block.
   7) now Apply the patch
      As a modification had to be made in currency sql table, the database
update should be made eather through the Pro interface
      or if not proposed automatically, through the command line :
           cd src/installer/data/mysql
           perl updatadatabase.pl
   9) Go to Pro interface Administration/Currencies and exchange rates and add
the isocode for your active currency you would like to be privileged when
several currencies are present
      you can make different test  with both symbol AND isocode defined or only
symbol.
   10) Go back to Acquisition module and your staged test file
   11) Redo several tests on the same link changing currency/isocode sign in
currency table
      between every test, you can
      a) go back with go back function of your browser
      b) if you have 'lost' your link because it ends up to be really imported,
go to Tools/Staged MARC record management and clean your file test. Then redo
stages 3,4 and 5 
   12) The price you asked for might now be present (I hope so)
   13) Repeat the tests on another link
   14) At the end, you can disabled your active currency in Currencies and
exchange rates (setting to 0) and redo same tests.
       You will see that the first currency of price zone is picked up as
expected
   15) Sign off

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list