[Koha-bugs] [Bug 14999] Adding to basket orders from staged files mixes up the prices and quantities between different orders

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Oct 2 14:11:58 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14999

--- Comment #8 from Joonas Kylmälä <joonas.kylmala at iki.fi> ---
So this turned out to be tricky to reproduce but I finally found at least one
bug where this happens! So if there is a duplicate matched then we have not
shifted away for the previous biblio to be added the replacement and price
parameters:

>                 replacementprice   => shift( @orderreplacementprices ),

>             my $price= shift( @prices ) || GetMarcPrice($marcrecord, C4::Context->preference('marcflavour'));


So when the line:

>                 $duplinbatch = $import_batch_id and next if $duplifound;

is called we are leaving the shifts undone. I wonder if we should go with the
originally proposed patch here or just move the shifts to the beginning. If we
just move the shifts to the beginning then I feel like it could be a bit more
prone to someone re-introducing this bug later if a new field is added.

To reproduce this bug:
 1) Download two records from koha to marcxml file, then cat those
   cat bib1.marcxml bib2.marcxml > bibs.marcxml
 2) Delete bib2 from koha
 3) Stage bibs.marcxml for import
 4) Add new basket -> import from a staged file
 5) Select both bib1 and bib2 and set price for bib1 to be 99.00 and for bib2
to be 88.00
 6) Click save and notice bib2 was imported with the wrong price, 99.00!!

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


More information about the Koha-bugs mailing list