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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+1 lines)
Lines 31-36 Link Here
31
        <div class="dialog alert">
31
        <div class="dialog alert">
32
            [% error.barcode | html %]
32
            [% error.barcode | html %]
33
            [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
33
            [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
34
            [% IF (error.ERR_DUPLICATE_BARCODES) %]: duplicate barcodes with/without leading zeroes[% END %]
34
            [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
35
            [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
35
            [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
36
            [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
36
            [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
37
            [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
(-)a/tools/inventory.pl (-3 / +7 lines)
Lines 197-204 if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { Link Here
197
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
197
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
198
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
198
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
199
        } else {
199
        } else {
200
            my $item = Koha::Items->find({barcode => $barcode});
200
            my $barcode_nz = $barcode;
201
            if ( $item ) {
201
            $barcode_nz =~ s/^0*//;
202
            my $item_rs = Koha::Items->search({barcode => { 'regexp', "^0*${barcode_nz}\$" }});
203
            if ( $item_rs->count == 1 ) {
204
                my $item = $item_rs->next;
202
                # Modify date last seen for scanned items, remove lost status
205
                # Modify date last seen for scanned items, remove lost status
203
                $item->set({ itemlost => 0, datelastseen => $date })->store;
206
                $item->set({ itemlost => 0, datelastseen => $date })->store;
204
                my $item_unblessed = $item->unblessed;
207
                my $item_unblessed = $item->unblessed;
Lines 217-222 if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { Link Here
217
                    }
220
                    }
218
                }
221
                }
219
                push @scanned_items, $item_unblessed;
222
                push @scanned_items, $item_unblessed;
223
            } elsif( $item_rs->count > 1 ) { # duplicates like 1 and 01
224
                push @errorloop, { barcode => $barcode_nz, ERR_DUPLICATE_BARCODES => 1 };
220
            } else {
225
            } else {
221
                push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 };
226
                push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 };
222
            }
227
            }
223
- 

Return to bug 20206