Merge remote branch 'kc/new/bug_5649' into kcmaster
[koha.git] / C4 / Barcodes.pm
old mode 100755 (executable)
new mode 100644 (file)
index 6fce7bb..a528bd9
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 package C4::Barcodes;
 
 # Copyright 2008 LibLime
@@ -15,9 +13,9 @@ package C4::Barcodes;
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
@@ -137,14 +135,11 @@ sub next_value ($;$) {
                # Note, this enlargement might be undesireable for some barcode formats.
                # Those should override next_value() to work accordingly.
        $incr++;
-       my $width = $self->width || undef;
-       # we would want to use %$x.$xd, but that would break on large values, like 2160700004168
-       # so we let the object tell us if it has a width to focus on.  If not, we use float.
-       my $format = ($width ? '%'."$width.$width".'d' : '%.0f');
-       $debug and warn "sprintf(\"$format\",$incr)";
+
+       $debug and warn "$incr";
        $head = $self->process_head($head,$max,$specific);
        $tail = $self->process_tail($tail,$max,$specific);
-       my $next_value = $head . sprintf($format,$incr) . $tail;
+       my $next_value = $head . $incr . $tail;
        $debug and print STDERR "(  next ) max barcode found: $next_value\n";
        return $next_value;
 }
@@ -244,8 +239,6 @@ sub new_object {
 1;
 __END__
 
-=doc
-
 =head1 Barcodes
 
 Note that the object returned by new is actually of the type requested (or set by syspref).
@@ -263,7 +256,7 @@ To add a new barcode format, a developer should:
        add to the $types hashref in this file; 
        add tests under the "t" directory; and
        edit autoBarcode syspref to include new type.
-       
+
 =head2 Adding a new module
 
 Each new module that needs differing behavior must override these subs: