https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44221 Bug ID: 44221 Summary: Items added in the acquisitions and serials forms are created in random order Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: adolfo.rodriguez@xercode.es QA Contact: testopia@bugs.koha-community.org Target Milestone: --- The forms that add several items before saving (placing an order with items created on order, receiving an order with items created on receipt, and receiving serials with "Create an item record when receiving this serial") create the items in random order. Each item block in the form gets an itemid, and acqui/addorder.pl, acqui/finishreceive.pl and serials/serials-edit.pl group the submitted subfields in a hash by itemid, then create the items with foreach ( keys %itemhash ). Perl hash order is random, so the items are not created in the order of the form: - the itemnumbers do not follow the order in which the items were added, so the items are listed in a different order; - the barcodes generated on save (autoBarcode with an empty barcode field) are assigned in random order: the first item added can get the highest number. To reproduce: 1. Create a basket that creates the items when placing an order 2. Add an order from a new empty record with quantity 6, and add 6 items with call numbers 1, 2, 3, 4, 5 and 6, in that order 3. Save and look at the items of the record, sorted by itemnumber (or by the generated barcodes) => The call numbers are not in order (e.g. 3, 1, 2, 5, 6, 4) The same happens when receiving an order whose basket creates the items on receipt, and when receiving several serial issues at once. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.