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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+6 lines)
Lines 214-219 $(document).ready(function(){ Link Here
214
            <label for="compareinv2barcd">Compare barcodes list to results: </label>
214
            <label for="compareinv2barcd">Compare barcodes list to results: </label>
215
            <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
215
            <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
216
        </li>
216
        </li>
217
        <li>
218
            <label for="out_of_order">Check barcodes list for items shelved out of order: </label>
219
            <input type="checkbox" name="out_of_order" id="out_of_order" />
220
        </li>
217
        </ol>
221
        </ol>
218
  </fieldset>
222
  </fieldset>
219
            <input type="hidden" name="op" value="do_it" />
223
            <input type="hidden" name="op" value="do_it" />
Lines 293-298 $(document).ready(function(){ Link Here
293
                <p>Change item status</p>
297
                <p>Change item status</p>
294
            [% ELSIF result.problem == 'not_scanned' %]
298
            [% ELSIF result.problem == 'not_scanned' %]
295
                <p>Item should have been scanned</p>
299
                <p>Item should have been scanned</p>
300
            [% ELSIF result.problem == 'out_of_order' %]
301
                <p>Item may be shelved out of order</p>
296
            [% END %]
302
            [% END %]
297
            </td>
303
            </td>
298
        </tr>
304
        </tr>
(-)a/tools/inventory.pl (-10 / +30 lines)
Lines 52-57 my $branchcode = $input->param('branchcode') || ''; Link Here
52
my $branch     = $input->param('branch');
52
my $branch     = $input->param('branch');
53
my $op         = $input->param('op');
53
my $op         = $input->param('op');
54
my $compareinv2barcd = $input->param('compareinv2barcd');
54
my $compareinv2barcd = $input->param('compareinv2barcd');
55
my $out_of_order = $input->param('out_of_order');
55
56
56
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
57
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
57
    {   template_name   => "tools/inventory.tt",
58
    {   template_name   => "tools/inventory.tt",
Lines 294-300 if ( $compareinv2barcd ) { Link Here
294
# insert "wrongplace" to all scanned items that are not supposed to be in this range
295
# insert "wrongplace" to all scanned items that are not supposed to be in this range
295
# note this list is always displayed, whatever the librarian has chosen for comparison
296
# note this list is always displayed, whatever the librarian has chosen for comparison
296
my $moddatecount = 0;
297
my $moddatecount = 0;
297
foreach my $item ( @scanned_items ) {
298
for ( my $i = 0; $i < @scanned_items; $i++ ) {
299
  my $item = $scanned_items[$i];
300
301
  # Check for items shelved out of order
302
    if ($out_of_order) {
303
        unless ( $i == 0 ) {
304
            my $previous_item = $scanned_items[ $i - 1 ];
305
            if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) {
306
                $item->{problem} = 'out_of_order';
307
                push( @items_with_problems, {%$item} );
308
            }
309
        }
310
        unless ( $i == scalar(@scanned_items) ) {
311
            my $next_item = $scanned_items[ $i + 1 ];
312
            if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) {
313
                $item->{problem} = 'out_of_order';
314
                push( @items_with_problems, {%$item} );
315
            }
316
        }
317
    }
298
318
299
  # Saving notforloan code before it's replaced by it's authorised value for later comparison
319
  # Saving notforloan code before it's replaced by it's authorised value for later comparison
300
  $item->{notforloancode} = $item->{notforloan};
320
  $item->{notforloancode} = $item->{notforloan};
Lines 316-324 foreach my $item ( @scanned_items ) { Link Here
316
    next if $item->{onloan}; # skip checked out items
336
    next if $item->{onloan}; # skip checked out items
317
337
318
    # If we have scanned items with a non-matching notforloan value
338
    # If we have scanned items with a non-matching notforloan value
319
    if (none { $item->{'notforloancode'} eq $_ } @notforloans) {
339
    if ( $item->{notforloancode} ) {
320
        $item->{problem} = 'changestatus';
340
        if ( none { $item->{'notforloancode'} eq $_ } @notforloans ) {
321
        push @items_with_problems, { %$item };
341
            $item->{problem} = 'changestatus';
342
            push @items_with_problems, {%$item};
343
        }
322
    }
344
    }
323
    if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$wrongplacelist) {
345
    if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$wrongplacelist) {
324
        $item->{problem} = 'wrongplace';
346
        $item->{problem} = 'wrongplace';
Lines 349-359 for my $item ( @items_with_problems ) { Link Here
349
371
350
# If a barcode file is given, we want to show problems, else all items
372
# If a barcode file is given, we want to show problems, else all items
351
my @results;
373
my @results;
352
@results = $uploadbarcodes
374
@results =
353
            ? @items_with_problems
375
    $uploadbarcodes ? @items_with_problems
354
            : $op
376
  : $op             ? @$inventorylist
355
                ? @$inventorylist
377
  :                   undef;
356
                : ();
357
378
358
$template->param(
379
$template->param(
359
    moddatecount => $moddatecount,
380
    moddatecount => $moddatecount,
360
- 

Return to bug 11405