https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44260 --- Comment #1 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 212540 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212540&action=edit Bug 44260: Generate the barcode of the items created when adding orders from a staged file When an order is placed manually, acqui/addorder.pl generates the barcode of the new items with autoBarcode if it is empty. When adding orders from a staged file, Koha::MarcOrder creates the items without any barcode: - Items from MarcItemFieldsToOrder are created with the barcode of the file, or without barcode if the file does not have one. - Items from the "Item information" tab are created from a single MARC item reused for each copy: all the copies are created without barcode. This patch generates the empty barcodes in both cases, with the same logic as acqui/addorder.pl (the home library of the item is used by the hbyymmincr format). In the "Item information" tab, a different barcode is generated for each copy. The barcodes that come in the file are kept. Test plan: 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 7. Apply the patch and repeat 3-6 => The 4 items are created with a barcode, all different 8. Run prove t/db_dependent/Koha/MarcOrder.t -- You are receiving this mail because: You are watching all bug changes.