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

Return to bug 11405