[Koha-bugs] [Bug 3577] New: Barcode.pl does not cater variable length branch codes in hbyymmincr format

bugzilla-daemon at kohaorg.ec2.liblime.com bugzilla-daemon at kohaorg.ec2.liblime.com
Thu Sep 3 15:51:07 CEST 2009


http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3577

           Summary: Barcode.pl does not cater variable length branch codes
                    in hbyymmincr format
           Product: Koha
           Version: unspecified
          Platform: PC
        OS/Version: Linux - Debian
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Acquisitions
        AssignedTo: rch at liblime.com
        ReportedBy: mwilson at globaladvisors.biz
   Estimated Hours: 0.0
 Change sponsored?: ---


The Barcode.pl script attempts to auto-increment the barcode by isolating the
maximum barcode in the item database. It does this by isolating the last four
numerals of the barcodes and choosing the maximum value.

The problem is that the SELECT query assumes a two letter branch code. If the
branch code varies, the SELECT query fails to isolate the correct portion of
the branch code. It therefore incorrectly maximises and the increment is wrong
causing duplicate barcodes.

The exact line is:

$query = "SELECT MAX(CAST(SUBSTRING(barcode,7,4) AS signed)) FROM items WHERE
barcode REGEXP ?";

The solution would be to limit branch codes to two letters or to isolate only
the last four numerals of the barcode string before maximising.

Incidently, surely this also limits the barcode to 9999 items?


-- 
Configure bugmail: http://bugs.koha.org/cgi-bin/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the Koha-bugs mailing list