View | Details | Raw Unified | Return to bug 6448
Collapse All | Expand All

(-)a/C4/Circulation.pm (+9 lines)
Lines 36-41 use C4::Message; Link Here
36
use C4::Debug;
36
use C4::Debug;
37
use C4::Branch; # GetBranches
37
use C4::Branch; # GetBranches
38
use C4::Log; # logaction
38
use C4::Log; # logaction
39
use Algorithm::CheckDigits;
39
40
40
use Data::Dumper;
41
use Data::Dumper;
41
use Koha::DateUtils;
42
use Koha::DateUtils;
Lines 168-173 sub barcodedecode { Link Here
168
				$barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
169
				$barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
169
			}
170
			}
170
		}
171
		}
172
	} elsif ($filter eq 'EAN13') {
173
		my $ean = CheckDigits('ean');
174
		if ( $ean->is_valid($barcode) ) {
175
			#$barcode = sprintf('%013d',$barcode); # this doesn't work on 32-bit systems
176
			$barcode = '0' x ( 13 - length($barcode) ) . $barcode;
177
		} else {
178
			warn "# [$barcode] not valid EAN-13/UPC-A\n";
179
		}
171
	}
180
	}
172
    return $barcode;    # return barcode, modified or not
181
    return $barcode;    # return barcode, modified or not
173
}
182
}
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5086-5091 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5086
    SetVersion($DBversion);
5086
    SetVersion($DBversion);
5087
}
5087
}
5088
5088
5089
$DBversion = "XXX"; # FIXME
5090
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5091
    $dbh->do("UPDATE systempreferences SET options=concat(options,'|EAN13') WHERE variable='itembarcodeinputfilter' AND options NOT LIKE '%EAN13%'");
5092
    print "Upgrade to $DBversion done (Add itemBarcodeInputFilter choice EAN13)\n";
5093
    SetVersion($DBversion);
5094
}
5095
5089
=head1 FUNCTIONS
5096
=head1 FUNCTIONS
5090
5097
5091
=head2 DropAllForeignKeys($table)
5098
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+1 lines)
Lines 16-21 Circulation: Link Here
16
                  cuecat: Convert from CueCat form
16
                  cuecat: Convert from CueCat form
17
                  T-prefix: Remove the first number from T-prefix style
17
                  T-prefix: Remove the first number from T-prefix style
18
                  libsuite8: Convert from Libsuite8 form
18
                  libsuite8: Convert from Libsuite8 form
19
                  EAN13: EAN-13 or zero-padded UPC-A from
19
            - scanned item barcodes.
20
            - scanned item barcodes.
20
        -
21
        -
21
            - Sort previous checkouts on the circulation page from
22
            - Sort previous checkouts on the circulation page from
(-)a/t/Circulation_barcodedecode.t (-2 / +3 lines)
Lines 4-10 Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
use Test::More tests => 24;
7
use Test::More tests => 26;
8
C4::Context->_new_userenv(123456);
8
C4::Context->_new_userenv(123456);
9
C4::Context->set_userenv(1,'kmkale' , 1, 'kk1' , 'IMS', 0, 'kmkale@anantcorp.com');
9
C4::Context->set_userenv(1,'kmkale' , 1, 'kk1' , 'IMS', 0, 'kmkale@anantcorp.com');
10
10
Lines 18-23 our %inputs = ( Link Here
18
    whitespace => [" 26002315", "26002315 ", "\n\t26002315\n"],
18
    whitespace => [" 26002315", "26002315 ", "\n\t26002315\n"],
19
    'T-prefix' => [qw(T0031472 T32)],
19
    'T-prefix' => [qw(T0031472 T32)],
20
    'libsuite8' => ['b000126', 'b12', 'B0126', 'IMS-B-126', 'ims-b-126','CD0000024','00123','11998'],
20
    'libsuite8' => ['b000126', 'b12', 'B0126', 'IMS-B-126', 'ims-b-126','CD0000024','00123','11998'],
21
    EAN13      => [qw(892685001928 695152)],
21
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
22
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
22
);
23
);
23
our %outputs = (
24
our %outputs = (
Lines 25-30 our %outputs = ( Link Here
25
    whitespace => [qw(26002315 26002315 26002315)],
26
    whitespace => [qw(26002315 26002315 26002315)],
26
    'T-prefix' => [qw(T0031472 T0000002         )],
27
    'T-prefix' => [qw(T0031472 T0000002         )],
27
    'libsuite8' => ['IMS-b-126', 'IMS-b-12', 'IMS-B-126', 'IMS-B-126', 'ims-b-126','IMS-CD-24','IMS-b-123','IMS-b-11998'],
28
    'libsuite8' => ['IMS-b-126', 'IMS-b-12', 'IMS-B-126', 'IMS-B-126', 'ims-b-126','IMS-CD-24','IMS-b-123','IMS-b-11998'],
29
    EAN13      => [qw(0892685001928 0000000695152)],
28
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
30
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
29
);
31
);
30
    
32
    
31
- 

Return to bug 6448