When autoBarcode is set to 'annual', and there is an existing barcode beginning with the 4 digit of the current year, the auto generated barcode may be wrong. For example, you have this barcode '20184526546'. If you ask for the next 2018-000X barcode, you will 20184526547
Created attachment 82828 [details] [review] Bug 21937: Syspref autoBarcode annual doesn't increment properly barcode in some cases This patch show the issue. If the DB contains a barcode (not auto attributed by Koha) which begin with the year used to generate automatically a new one, there may be a 'collision'. prove -v t/db_dependent/Barcodes_ValueBuilder.t
Created attachment 82829 [details] [review] Bug 21937: syspref autoBarcode annual doesn't increment properly barcode This patch fix the barcode annual builder. The test wil work.
Created attachment 87953 [details] [review] Bug 21937: Syspref autoBarcode annual doesn't increment properly barcode in some cases This patch show the issue. If the DB contains a barcode (not auto attributed by Koha) which begin with the year used to generate automatically a new one, there may be a 'collision'. prove -v t/db_dependent/Barcodes_ValueBuilder.t Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 87954 [details] [review] Bug 21937: syspref autoBarcode annual doesn't increment properly barcode This patch fix the barcode annual builder. The test wil work. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 88162 [details] [review] Bug 21937: Add test to show autoBarcode annual increment bug This patch show the issue. If the DB contains a barcode (not auto attributed by Koha) which begin with the year used to generate automatically a new one, there may be a 'collision'. prove -v t/db_dependent/Barcodes_ValueBuilder.t Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 88163 [details] [review] Bug 21937: Syspref autoBarcode annual doesn't increment properly barcode This patch fix the barcode annual builder. The test should pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
No regressions found, QA scripts pass and patches make sense. Passing QA
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.05
backported t0 18.05.x for 18.05.13