From 31ace6a9347a8260532f6cc50d55fc36f87f1b44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 3 Dec 2018 18:02:03 +0100 Subject: [PATCH] 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 Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- C4/Barcodes/ValueBuilder.pm | 2 +- .../prog/en/modules/admin/preferences/cataloguing.pref | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Barcodes/ValueBuilder.pm b/C4/Barcodes/ValueBuilder.pm index 81747dee67..ef9f28e057 100644 --- a/C4/Barcodes/ValueBuilder.pm +++ b/C4/Barcodes/ValueBuilder.pm @@ -89,7 +89,7 @@ sub get_barcode { my $nextnum; my $query = "select max(cast( substring_index(barcode, '-',-1) as signed)) from items where barcode like ?"; my $sth=C4::Context->dbh->prepare($query); - $sth->execute("$args->{year}%"); + $sth->execute($args->{year} . '-%'); while (my ($count)= $sth->fetchrow_array) { warn "Examining Record: $count" if $DEBUG; $nextnum = $count if $count; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index 414ce47ea9..0f547e4df5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -105,8 +105,8 @@ Cataloging: - pref: autoBarcode choices: incremental: generated in the form 1, 2, 3. - annual: generated in the form <year>-0001, <year>-0002. - hbyymmincr: generated in the form <branchcode>yymm0001. + annual: generated in the form -0001, -0002. + hbyymmincr: generated in the form yymm0001. EAN13: incremental EAN-13 barcodes "OFF": not generated automatically. - -- 2.39.5