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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+4 lines)
Lines 96-101 $(document).ready(function(){ Link Here
96
    <h1>Inventory/Stocktaking</h1>
96
    <h1>Inventory/Stocktaking</h1>
97
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>[% END %]
97
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>[% END %]
98
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
98
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
99
    [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
100
    [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length %] barcodes that were too long.</div>[% END %]
101
    [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one non-alphanumeric character.</div>[% END %]
102
    [% IF (err_data && err_data>1) %]<div class="dialog alert">There were [% err_data %] barcodes that contained at least one non-alphanumeric character.</div>[% END %]
99
    [% FOREACH error IN errorloop %]
103
    [% FOREACH error IN errorloop %]
100
        <div class="dialog alert">
104
        <div class="dialog alert">
101
            [% error.barcode %]
105
            [% error.barcode %]
(-)a/tools/inventory.pl (-1 / +22 lines)
Lines 160-168 if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { Link Here
160
160
161
    my $count = 0;
161
    my $count = 0;
162
162
163
    my @barcodes;
164
    my $err_length=0;
165
    my $err_data=0;
163
    while (my $barcode=<$uploadbarcodes>){
166
    while (my $barcode=<$uploadbarcodes>){
164
        $barcode =~ s/\r?\n$//;
167
        $barcode =~ s/\r?\n$//;
165
        next unless $barcode;
168
        next unless $barcode;
169
        if (length($barcode)>20) {
170
            $err_length += 1;
171
        }
172
        if ($barcode =~ /[^0-9a-zA-Z]/) {
173
            $err_data += 1;
174
        }
175
        next if length($barcode)>20; # 20 is the current length of barcode.
176
        next if ( $barcode =~ /[^0-9a-zA-Z]/ ); # Only 0-9a-zA-Z are valid.
177
        push @barcodes,$barcode;
178
    }
179
    if (! @barcodes) {
180
        push @errorloop, {'barcode'=>'No valid barcodes!'};
181
        $op=''; # force the initial inventory screen again.
182
    }
183
    else {
184
        $template->param( err_length => $err_length,
185
                          err_data   => $err_data );
186
    }
187
    foreach my $barcode (@barcodes) {
166
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
188
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
167
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
189
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
168
        } else {
190
        } else {
169
- 

Return to bug 4162