Bugzilla – Attachment 66019 Details for
Bug 19113
Barcode value builder not working with numeric branchcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19113 - Barcode value builder not working with numeric branchcode
Bug-19113---Barcode-value-builder-not-working-with.patch (text/plain), 1.82 KB, created by
Blou
on 2017-08-15 15:11:51 UTC
(
hide
)
Description:
Bug 19113 - Barcode value builder not working with numeric branchcode
Filename:
MIME Type:
Creator:
Blou
Created:
2017-08-15 15:11:51 UTC
Size:
1.82 KB
patch
obsolete
>From 38d6206141d9777bc3c59bd3e3d94d013b18677d Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Tue, 15 Aug 2017 11:03:30 -0400 >Subject: [PATCH] Bug 19113 - Barcode value builder not working with numeric > branchcode > >The regexp for the value builder 'hbyymmincr' doesn't allow for numerics in the branchcode, so the nextnum found is always 0 and multiple Add always generate the same barcode. > >This simply allow for numerics within the regex. > >Test >- It's a bit complicated. You need > - all your branchcodes to be numerics (01,02,71...) > - all barcodes to already be a bunch of numbers >- Modify the syspref 'autobarcode' to hbyymmincr, the home branch + date one. >- Find an item in the pro-search, >- New -> New Item >- Click on the 'p' to have the value builder create the next barcode. > - Without the patch, the query won't have found anything, so it'll suggest xxxxxx0001 >- Click Add. It reprensent the form to enter another one. > - Click on the 'p' edit box, it'll offer you again xxxxxx0001 >With the patch, it'll offer valid ones everytime. >--- > C4/Barcodes/ValueBuilder.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Barcodes/ValueBuilder.pm b/C4/Barcodes/ValueBuilder.pm >index 81747de..b3f3885 100644 >--- a/C4/Barcodes/ValueBuilder.pm >+++ b/C4/Barcodes/ValueBuilder.pm >@@ -49,7 +49,7 @@ sub get_barcode { > my $month = $args->{mon}; > my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?"; > my $sth = C4::Context->dbh->prepare($query); >- $sth->execute("^[-a-zA-Z]{1,}$year$month"); >+ $sth->execute("^[-a-zA-Z0-9]{1,}$year$month"); > while (my ($count)= $sth->fetchrow_array) { > $nextnum = $count if $count; > $nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 9999 items per month >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19113
:
66019
|
67981
|
75509