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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+1 lines)
Lines 57-62 Link Here
57
        <div class="dialog alert">
57
        <div class="dialog alert">
58
            [% error.barcode | html %]
58
            [% error.barcode | html %]
59
            [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
59
            [% IF (error.ERR_BARCODE) %]: barcode not found[% END %]
60
            [% IF (error.ERR_DUPLICATE_BARCODES) %]: duplicate barcodes with leading zeroes[% END %]
60
            [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
61
            [% IF (error.ERR_WTHDRAWN) %]: item withdrawn[% END %]
61
            [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
62
            [% IF (error.ERR_ONLOAN_RET) %]: item was on loan. It was returned before marked as seen[% END %]
62
            [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
63
            [% IF (error.ERR_ONLOAN_NOT_RET) %]: item was on loan. couldn't be returned.[% END %]
(-)a/tools/inventory.pl (-3 / +7 lines)
Lines 213-220 if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length Link Here
213
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
213
        if ( $qwithdrawn->execute($barcode) && $qwithdrawn->rows ) {
214
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
214
            push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };
215
        } else {
215
        } else {
216
            my $item = Koha::Items->find({barcode => $barcode});
216
            my $barcode_nz = $barcode;
217
            if ( $item ) {
217
            $barcode_nz =~ s/^0*//;
218
            my $item_rs = Koha::Items->search({barcode => { 'regexp', "^0*${barcode_nz}\$" }});
219
            if ( $item_rs->count == 1 ) {
220
                my $item = $item_rs->next;
218
                # Modify date last seen for scanned items, remove lost status
221
                # Modify date last seen for scanned items, remove lost status
219
                $item->set({ itemlost => 0, datelastseen => $date_dt })->store;
222
                $item->set({ itemlost => 0, datelastseen => $date_dt })->store;
220
                my $item_unblessed = $item->unblessed;
223
                my $item_unblessed = $item->unblessed;
Lines 233-238 if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length Link Here
233
                    }
236
                    }
234
                }
237
                }
235
                push @scanned_items, $item_unblessed;
238
                push @scanned_items, $item_unblessed;
239
            } elsif( $item_rs->count > 1 ) { # duplicates like 1 and 01
240
                push @errorloop, { barcode => $barcode_nz, ERR_DUPLICATE_BARCODES => 1 };
236
            } else {
241
            } else {
237
                push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 };
242
                push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 };
238
            }
243
            }
239
- 

Return to bug 28491