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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+6 lines)
Lines 252-257 Link Here
252
                                <label for="CSVexport">Export to CSV file: </label>
252
                                <label for="CSVexport">Export to CSV file: </label>
253
                                <input type="checkbox" name="CSVexport" id="CSVexport" />
253
                                <input type="checkbox" name="CSVexport" id="CSVexport" />
254
                            </li>
254
                            </li>
255
                            <li>
256
                                <label for="ReportLostItems">Add losts items to the report: </label>
257
                                <input type="checkbox" name="ReportLostItems" id="ReportLostItems" />
258
                            </li>
255
                        </ol>
259
                        </ol>
256
                    </fieldset>
260
                    </fieldset>
257
261
Lines 368-373 Link Here
368
                                                    <span>No barcode</span><br/>
372
                                                    <span>No barcode</span><br/>
369
                                                [% ELSIF problem.key == 'out_of_order' %]
373
                                                [% ELSIF problem.key == 'out_of_order' %]
370
                                                    <span>Item may be shelved out of order</span><br/>
374
                                                    <span>Item may be shelved out of order</span><br/>
375
                                                [% ELSIF problem.key == 'lost' %]
376
                                                    <span>Item was lost and is now marked as found</span><br/>
371
                                                [% END %]
377
                                                [% END %]
372
                                            [% END %]
378
                                            [% END %]
373
                                        </td>
379
                                        </td>
(-)a/tools/inventory.pl (-1 / +18 lines)
Lines 123-128 for my $authvfield (@$statuses) { Link Here
123
    }
123
    }
124
}
124
}
125
125
126
my $report_lost_items;
127
if ( defined $input->param('ReportLostItems') && $input->param('ReportLostItems') eq 'on' ) {
128
    $report_lost_items = "1";
129
}
130
126
# if there's a list of not for loans types selected use it rather than
131
# if there's a list of not for loans types selected use it rather than
127
# the full set.
132
# the full set.
128
@notforloans = @{$staton->{'items.notforloan'}} if defined $staton->{'items.notforloan'} and scalar @{$staton->{'items.notforloan'}} > 0;
133
@notforloans = @{$staton->{'items.notforloan'}} if defined $staton->{'items.notforloan'} and scalar @{$staton->{'items.notforloan'}} > 0;
Lines 162-167 my $results = {}; Link Here
162
my @scanned_items;
167
my @scanned_items;
163
my @errorloop;
168
my @errorloop;
164
my $moddatecount = 0;
169
my $moddatecount = 0;
170
my @lost_items;
165
if ( $op eq 'cud-inventory'
171
if ( $op eq 'cud-inventory'
166
    && ( ( $uploadbarcodes && length($uploadbarcodes) > 0 ) || ( $barcodelist && length($barcodelist) > 0 ) ) )
172
    && ( ( $uploadbarcodes && length($uploadbarcodes) > 0 ) || ( $barcodelist && length($barcodelist) > 0 ) ) )
167
{
173
{
Lines 225-230 if ( $op eq 'cud-inventory' Link Here
225
                next;
231
                next;
226
            }
232
            }
227
            # Modify date last seen for scanned items, remove lost status
233
            # Modify date last seen for scanned items, remove lost status
234
            if ( $item->unblessed->{itemlost} ) {
235
                push @lost_items, $barcode;
236
            }
228
            $item->set({ itemlost => 0, datelastseen => $date_dt })->store;
237
            $item->set({ itemlost => 0, datelastseen => $date_dt })->store;
229
            my $item_unblessed = $item->unblessed;
238
            my $item_unblessed = $item->unblessed;
230
            $moddatecount++;
239
            $moddatecount++;
Lines 335-340 for ( my $i = 0; $i < @scanned_items; $i++ ) { Link Here
335
        $item->{problems}->{wrongplace} = 1;
344
        $item->{problems}->{wrongplace} = 1;
336
        additemtoresults( $item, $results );
345
        additemtoresults( $item, $results );
337
    }
346
    }
347
348
    # Report a lost item if asked
349
    if ( @lost_items && ( scalar grep { $_ eq $item->{barcode} } @lost_items ) && $report_lost_items ) {
350
        $item->{problems}->{lost} = 1;
351
        additemtoresults( $item, $results );
352
    }
338
}
353
}
339
354
340
# Compare barcodes with inventory list, report no_barcode and not_scanned.
355
# Compare barcodes with inventory list, report no_barcode and not_scanned.
Lines 418-425 if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ Link Here
418
                $errstr .= "checked out,";
433
                $errstr .= "checked out,";
419
            } elsif( $key eq 'out_of_order' ) {
434
            } elsif( $key eq 'out_of_order' ) {
420
                $errstr .= "shelved out of order,";
435
                $errstr .= "shelved out of order,";
436
            } elsif ( $key eq 'lost' ) {
437
                $errstr .= "item was lost";
421
            }
438
            }
422
        }
439
        }
440
423
        $errstr =~ s/,$//;
441
        $errstr =~ s/,$//;
424
        push @line, $errstr;
442
        push @line, $errstr;
425
        $csv->combine(@line);
443
        $csv->combine(@line);
426
- 

Return to bug 18657