Bugzilla – Attachment 3024 Details for
Bug 3577
Barcode.pl does not cater variable length branch codes in hbyymmincr format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed fix for bug 3577
0001-Bug-3577-autobarcode-value_builder-doesn-t-respect.patch (text/plain), 1.50 KB, created by
Ian Walls
on 2011-01-26 15:01:59 UTC
(
hide
)
Description:
Proposed fix for bug 3577
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2011-01-26 15:01:59 UTC
Size:
1.50 KB
patch
obsolete
>From e52469c0b7ca1720a1bfb6d4ef38d0cae19a9e71 Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian.walls@bywatersolutions.com> >Date: Mon, 17 Jan 2011 16:48:56 -0500 >Subject: [PATCH] Bug 3577: autobarcode value_builder doesn't respect variable length branchcodes >Content-Type: text/plain; charset="utf-8" > >This patch changes the hardcoded substring values in the select statement to work from the right >instead of the left; that is, from position -4 (which should ALWAYS be the start of the 4-digit >increment portion) rather than position 7 (which could easily include branchcode or date-only >information) >--- > cataloguing/value_builder/barcode.pl | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > >diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl >index 3c6ef74..c247737 100755 >--- a/cataloguing/value_builder/barcode.pl >+++ b/cataloguing/value_builder/barcode.pl >@@ -99,7 +99,7 @@ sub plugin_javascript { > } > elsif ($autoBarcodeType eq 'hbyymmincr') { # Generates a barcode where hb = home branch Code, yymm = year/month catalogued, incr = incremental number, reset yearly -fbcit > $year = substr($year, -2); >- $query = "SELECT MAX(CAST(SUBSTRING(barcode,7,4) AS signed)) FROM items WHERE barcode REGEXP ?"; >+ $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4,4) AS signed)) FROM items WHERE barcode REGEXP ?"; > my $sth = $dbh->prepare($query); > $sth->execute("^[a-zA-Z]{1,}$year"); > while (my ($count)= $sth->fetchrow_array) { >-- >1.5.6.5 >
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 3577
: 3024 |
3032