https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44311 Bug ID: 44311 Summary: hbyymmincr autoBarcode shares one 9999 sequence between all libraries Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- When autoBarcode is set to "generated in the form <branchcode>yymm0001" (hbyymmincr), the next sequence number is the highest number used by any library in that month. All libraries share one sequence, so the whole consortium is limited to 9999 items a month, and a busy library uses up the numbers for every other library. When the sequence reaches 9999 it starts again at 0001, which returns a barcode that already exists, so the item cannot be saved. The barcode value builder also returns JavaScript from C4::Barcodes::ValueBuilder::hbyymmincr::get_barcode, unlike the other barcode types, and the REST API (POST /api/v1/biblios/{biblio_id}/items) builds its own barcode from an unpadded month, so in January to September it generates barcodes in a different format (for example CPL2610001). The sequence should be kept for each library, the REST API should use the same code as the staff interface, and a library that has used all of its numbers should get no generated barcode instead of a duplicate. Test plan: 1. Set the autoBarcode system preference to "generated in the form <branchcode>yymm0001". 2. Add an item to a record, choosing Centerville (CPL) as the home library, and click in the barcode field (952$p). Note the barcode, for example CPL26110001, and save the item. 3. Add another item and choose Fairview (FFL) as the home library. Click in the barcode field. => The barcode is FFL26110001. The CPL items do not affect the FFL sequence. 4. Change the home library back to CPL, clear the barcode field and click in it again. => The barcode is CPL26110002. 5. Add several items at once with the same home library. => Each item gets a different barcode. 6. Set the barcode of a CPL item to CPL26119999 and try to add another CPL item. => The barcode field is left empty and a warning is logged. Depends on bug 44309. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.