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 289-294 $(document).ready(function(){ Link Here
289
                <p>Change item status</p>
293
                <p>Change item status</p>
290
            [% ELSIF result.problem == 'not_scanned' %]
294
            [% ELSIF result.problem == 'not_scanned' %]
291
                <p>Item should have been scanned</p>
295
                <p>Item should have been scanned</p>
296
            [% ELSIF result.problem == 'out_of_order' %]
297
                <p>Item may be shelved out of order</p>
292
            [% END %]
298
            [% END %]
293
            </td>
299
            </td>
294
        </tr>
300
        </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 254-260 if ( $compareinv2barcd ) { Link Here
254
# insert "wrongplace" to all scanned items that are not supposed to be in this range
255
# insert "wrongplace" to all scanned items that are not supposed to be in this range
255
# note this list is always displayed, whatever the librarian has choosen for comparison
256
# note this list is always displayed, whatever the librarian has choosen for comparison
256
my $moddatecount = 0;
257
my $moddatecount = 0;
257
foreach my $item ( @scanned_items ) {
258
for ( my $i = 0; $i < @scanned_items; $i++ ) {
259
  my $item = $scanned_items[$i];
260
261
  # Check for items shelved out of order
262
    if ($out_of_order) {
263
        unless ( $i == 0 ) {
264
            my $previous_item = $scanned_items[ $i - 1 ];
265
            if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) {
266
                $item->{problem} = 'out_of_order';
267
                push( @items_with_problems, {%$item} );
268
            }
269
        }
270
        unless ( $i == scalar(@scanned_items) ) {
271
            my $next_item = $scanned_items[ $i + 1 ];
272
            if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) {
273
                $item->{problem} = 'out_of_order';
274
                push( @items_with_problems, {%$item} );
275
            }
276
        }
277
    }
258
278
259
  # Saving notforloan code before it's replaced by it's authorised value for later comparison
279
  # Saving notforloan code before it's replaced by it's authorised value for later comparison
260
  $item->{notforloancode} = $item->{notforloan};
280
  $item->{notforloancode} = $item->{notforloan};
Lines 276-284 foreach my $item ( @scanned_items ) { Link Here
276
    next if $item->{onloan}; # skip checked out items
296
    next if $item->{onloan}; # skip checked out items
277
297
278
    # If we have scanned items with a non-matching notforloan value
298
    # If we have scanned items with a non-matching notforloan value
279
    if (none { $item->{'notforloancode'} eq $_ } @notforloans) {
299
    if ( $item->{notforloancode} ) {
280
        $item->{problem} = 'changestatus';
300
        if ( none { $item->{'notforloancode'} eq $_ } @notforloans ) {
281
        push @items_with_problems, { %$item };
301
            $item->{problem} = 'changestatus';
302
            push @items_with_problems, {%$item};
303
        }
282
    }
304
    }
283
    if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) {
305
    if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) {
284
        $item->{problem} = 'wrongplace';
306
        $item->{problem} = 'wrongplace';
Lines 309-319 for my $item ( @items_with_problems ) { Link Here
309
331
310
# If a barcode file is given, we want to show problems, else all items
332
# If a barcode file is given, we want to show problems, else all items
311
my @results;
333
my @results;
312
@results = $uploadbarcodes
334
@results =
313
            ? @items_with_problems
335
    $uploadbarcodes ? @items_with_problems
314
            : $op
336
  : $op             ? @$inventorylist
315
                ? @$inventorylist
337
  :                   undef;
316
                : ();
317
338
318
$template->param(
339
$template->param(
319
    moddatecount => $moddatecount,
340
    moddatecount => $moddatecount,
320
- 

Return to bug 11405