From 70d65c1fd34e870f12b515d55eadab3b81caf289 Mon Sep 17 00:00:00 2001 From: Sophie Meynieux Date: Tue, 7 Jun 2011 12:33:38 +0200 Subject: [PATCH] Bug 6474 Barcode not incrementing properly in format HBYYMMINCR if HB contains - Adding - to regexp for matching branch code. Wondering if other characters should not be added too. Signed-off-by: Julian Maurice Signed-off-by: Chris Cormack (cherry picked from commit 0ff16446a8f88d0e5302ada6322541e69acc816d) Signed-off-by: Chris Nighswonger --- cataloguing/value_builder/barcode.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl index c05ec48b26..c5e1fd3834 100755 --- a/cataloguing/value_builder/barcode.pl +++ b/cataloguing/value_builder/barcode.pl @@ -102,7 +102,7 @@ sub plugin_javascript { $year = substr($year, -2); $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?"; my $sth = $dbh->prepare($query); - $sth->execute("^[a-zA-Z]{1,}$year"); + $sth->execute("^[-a-zA-Z]{1,}$year"); while (my ($count)= $sth->fetchrow_array) { $nextnum = $count if $count; $nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 10000 books per month -- 2.39.5