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 181-186 $(document).ready(function(){ Link Here
181
            <label for="compareinv2barcd">Compare barcodes list to results: </label>
181
            <label for="compareinv2barcd">Compare barcodes list to results: </label>
182
            <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
182
            <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" />
183
        </li>
183
        </li>
184
        <li>
185
            <label for="out_of_order">Check barcodes list for items shelved out of order: </label>
186
            <input type="checkbox" name="out_of_order" id="out_of_order" />
187
        </li>
184
        </ol>
188
        </ol>
185
  </fieldset>
189
  </fieldset>
186
            <input type="hidden" name="op" value="do_it" />
190
            <input type="hidden" name="op" value="do_it" />
Lines 254-259 $(document).ready(function(){ Link Here
254
                <p>Change item status</p>
258
                <p>Change item status</p>
255
            [% ELSIF result.problem == 'not_scanned' %]
259
            [% ELSIF result.problem == 'not_scanned' %]
256
                <p>Item should have been scanned</p>
260
                <p>Item should have been scanned</p>
261
            [% ELSIF result.problem == 'out_of_order' %]
262
                <p>Item may be shelved out of order</p>
257
            [% END %]
263
            [% END %]
258
            </td>
264
            </td>
259
        </tr>
265
        </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 220-226 if ( $compareinv2barcd ) { Link Here
220
# insert "wrongplace" to all scanned items that are not supposed to be in this range
221
# insert "wrongplace" to all scanned items that are not supposed to be in this range
221
# note this list is always displayed, whatever the librarian has choosen for comparison
222
# note this list is always displayed, whatever the librarian has choosen for comparison
222
my $moddatecount = 0;
223
my $moddatecount = 0;
223
foreach my $item ( @scanned_items ) {
224
for ( my $i = 0; $i < @scanned_items; $i++ ) {
225
  my $item = $scanned_items[$i];
226
227
  # Check for items shelved out of order
228
    if ($out_of_order) {
229
        unless ( $i == 0 ) {
230
            my $previous_item = $scanned_items[ $i - 1 ];
231
            if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) {
232
                $item->{problem} = 'out_of_order';
233
                push( @items_with_problems, {%$item} );
234
            }
235
        }
236
        unless ( $i == scalar(@scanned_items) ) {
237
            my $next_item = $scanned_items[ $i + 1 ];
238
            if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) {
239
                $item->{problem} = 'out_of_order';
240
                push( @items_with_problems, {%$item} );
241
            }
242
        }
243
    }
224
244
225
  # Saving notforloan code before it's replaced by it's authorised value for later comparison
245
  # Saving notforloan code before it's replaced by it's authorised value for later comparison
226
  $item->{notforloancode} = $item->{notforloan};
246
  $item->{notforloancode} = $item->{notforloan};
Lines 242-250 foreach my $item ( @scanned_items ) { Link Here
242
    next if $item->{onloan}; # skip checked out items
262
    next if $item->{onloan}; # skip checked out items
243
263
244
    # If we have scanned items with a non-matching notforloan value
264
    # If we have scanned items with a non-matching notforloan value
245
    if (none { $item->{'notforloancode'} eq $_ } @notforloans) {
265
    if ( $item->{notforloancode} ) {
246
        $item->{problem} = 'changestatus';
266
        if ( none { $item->{'notforloancode'} eq $_ } @notforloans ) {
247
        push @items_with_problems, { %$item };
267
            $item->{problem} = 'changestatus';
268
            push @items_with_problems, {%$item};
269
        }
248
    }
270
    }
249
    if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) {
271
    if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$inventorylist) {
250
        $item->{problem} = 'wrongplace';
272
        $item->{problem} = 'wrongplace';
Lines 275-285 for my $item ( @items_with_problems ) { Link Here
275
297
276
# If a barcode file is given, we want to show problems, else all items
298
# If a barcode file is given, we want to show problems, else all items
277
my @results;
299
my @results;
278
@results = $uploadbarcodes
300
@results =
279
            ? @items_with_problems
301
    $uploadbarcodes ? @items_with_problems
280
            : $op
302
  : $op             ? @$inventorylist
281
                ? @$inventorylist
303
  :                   undef;
282
                : ();
283
304
284
$template->param(
305
$template->param(
285
    moddatecount => $moddatecount,
306
    moddatecount => $moddatecount,
286
- 

Return to bug 11405