https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44260 Bug ID: 44260 Summary: Adding orders from a staged file does not generate the barcode of the new items with autoBarcode 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: --- When adding orders from a staged file (acqui/addorderiso2709.pl) in a basket that creates the items when placing an order, the items are created in Koha::MarcOrder::create_items_and_generate_order_hash, and their barcode is never generated, even if autoBarcode is enabled and the barcode is empty. There are two paths, and neither uses C4::Barcodes: - With MarcItemFieldsToOrder, the items are created with Koha::Item->new, with the barcode of the file, or without barcode if the file does not have one. - Without MarcItemFieldsToOrder ("Item information" tab), a single MARC item is built from the form and reused for each copy with AddItemFromMarc. If the barcode is empty, all the copies are created without barcode. (If the user types a barcode and the quantity is greater than 1, the following copies fail because of the duplicate barcode.) This is inconsistent with placing an order manually: acqui/addorder.pl generates the barcode with autoBarcode, for every format, when it is empty. Bug 31344 asks for autoBarcode in the MARC import tools, which is an enhancement. This bug is about acquisitions only, where the two ways of creating items on order should behave the same. To reproduce: 1. Set AcqCreateItem to "placing an order" and autoBarcode to "incremental" 2. Set MarcItemFieldsToOrder to: homebranch: 975$a holdingbranch: 975$b itype: 975$y 3. Stage a MARC file with two records: one with two 975 fields without barcode ($a CPL, $b CPL, $y BK and $a MPL, $b MPL, $y BK) and one without 975 fields 4. Create a basket and add to it from the staged file 5. Select both records. For the record without 975 fields, set the quantity to 2. In the "Item information" tab, choose an item type and leave the barcode empty 6. Click Save => The 4 items are created without barcode Note: with autoBarcode set to hbyymmincr, the barcode cannot be generated when the highest hbyymmincr barcode belongs to another library (the counter is shared between libraries, and the format is deprecated according to the NOTICE in C4/Barcodes/hbyymmincr.pm). This also happens when placing an order manually, and is not addressed here. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.