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

(-)a/C4/Circulation.pm (+10 lines)
Lines 38-43 use C4::Branch; # GetBranches Link Here
38
use C4::Log; # logaction
38
use C4::Log; # logaction
39
use C4::Koha qw(GetAuthorisedValueByCode);
39
use C4::Koha qw(GetAuthorisedValueByCode);
40
use C4::Overdues qw(CalcFine UpdateFine);
40
use C4::Overdues qw(CalcFine UpdateFine);
41
use Algorithm::CheckDigits;
42
41
use Data::Dumper;
43
use Data::Dumper;
42
use Koha::DateUtils;
44
use Koha::DateUtils;
43
use Koha::Calendar;
45
use Koha::Calendar;
Lines 169-174 sub barcodedecode { Link Here
169
				$barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
171
				$barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
170
			}
172
			}
171
		}
173
		}
174
	} elsif ($filter eq 'EAN13') {
175
		my $ean = CheckDigits('ean');
176
		if ( $ean->is_valid($barcode) ) {
177
			#$barcode = sprintf('%013d',$barcode); # this doesn't work on 32-bit systems
178
			$barcode = '0' x ( 13 - length($barcode) ) . $barcode;
179
		} else {
180
			warn "# [$barcode] not valid EAN-13/UPC-A\n";
181
		}
172
	}
182
	}
173
    return $barcode;    # return barcode, modified or not
183
    return $barcode;    # return barcode, modified or not
174
}
184
}
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5343-5348 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5343
    SetVersion($DBversion);
5343
    SetVersion($DBversion);
5344
}
5344
}
5345
5345
5346
$DBversion = "3.07.00.XXX"; # FIXME
5347
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5348
    $dbh->do("UPDATE systempreferences SET options=concat(options,'|EAN13') WHERE variable='itembarcodeinputfilter' AND options NOT LIKE '%EAN13%'");
5349
    print "Upgrade to $DBversion done (Add itemBarcodeInputFilter choice EAN13)\n";
5350
    SetVersion($DBversion);
5351
}
5352
5346
=head1 FUNCTIONS
5353
=head1 FUNCTIONS
5347
5354
5348
=head2 TableExists($table)
5355
=head2 TableExists($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