[Bug 44260] New: Adding orders from a staged file does not generate the barcode of the new items with autoBarcode
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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44260 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |adolfo.rodriguez@xercode.es |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44260 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31344 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org