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 104-109 $(document).ready(function(){ Link Here
104
    <h1>Inventory/Stocktaking</h1>
104
    <h1>Inventory/Stocktaking</h1>
105
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>[% END %]
105
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]</div>[% END %]
106
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
106
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile %] can't be opened</div>[% END %]
107
    [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
108
    [% IF (err_length && err_length>1) %]<div class="dialog alert">There were [% err_length %] barcodes that were too long.</div>[% END %]
109
    [% IF (err_data && err_data==1) %]<div class="dialog alert">There was 1 barcode that contained at least one unprintable character.</div>[% END %]
110
    [% IF (err_data && err_data>1) %]<div class="dialog alert">There were [% err_data %] barcodes that contained at least one unprintable character.</div>[% END %]
107
    [% FOREACH error IN errorloop %]
111
    [% FOREACH error IN errorloop %]
108
        <div class="dialog alert">
112
        <div class="dialog alert">
109
            [% error.barcode %]
113
            [% error.barcode %]
(-)a/tools/inventory.pl (-1 / +26 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
165
    my $sth = $dbh->column_info(undef,undef,"items","barcode");
166
    my $barcode_def = $sth->fetchall_hashref('COLUMN_NAME');
167
    my $barcode_size = $barcode_def->{barcode}->{COLUMN_SIZE};
168
    my $err_length=0;
169
    my $err_data=0;
163
    while (my $barcode=<$uploadbarcodes>){
170
    while (my $barcode=<$uploadbarcodes>){
164
        $barcode =~ s/\r?\n$//;
171
        $barcode =~ s/\r?\n$//;
165
        next unless $barcode;
172
        next unless $barcode;
173
        if (length($barcode)>$barcode_size) {
174
            $err_length += 1;
175
        }
176
        if ($barcode =~ /[^[:print:]]/) { # Only printable characters allowed.
177
            $err_data += 1;
178
        }
179
        next if length($barcode)>$barcode_size;
180
        next if ( $barcode =~ /[^[:print:]]/ );
181
        push @barcodes,$barcode;
182
    }
183
    if (! @barcodes) {
184
        push @errorloop, {'barcode'=>'No valid barcodes!'};
185
        $op=''; # force the initial inventory screen again.
186
    }
187
    else {
188
        $template->param( err_length => $err_length,
189
                          err_data   => $err_data );
190
    }
191
    foreach my $barcode (@barcodes) {
166
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
192
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
167
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
193
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
168
        } else {
194
        } else {
169
- 

Return to bug 4162