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

(-)a/C4/Items.pm (+6 lines)
Lines 525-530 sub GetItemsForInventory { Link Here
525
    my $minlocation  = $parameters->{'minlocation'}  // '';
525
    my $minlocation  = $parameters->{'minlocation'}  // '';
526
    my $maxlocation  = $parameters->{'maxlocation'}  // '';
526
    my $maxlocation  = $parameters->{'maxlocation'}  // '';
527
    my $class_source = $parameters->{'class_source'}  // C4::Context->preference('DefaultClassificationSource');
527
    my $class_source = $parameters->{'class_source'}  // C4::Context->preference('DefaultClassificationSource');
528
    my $items_bundle = $parameters->{'items_bundle'} // '';
528
    my $location     = $parameters->{'location'}     // '';
529
    my $location     = $parameters->{'location'}     // '';
529
    my $itemtype     = $parameters->{'itemtype'}     // '';
530
    my $itemtype     = $parameters->{'itemtype'}     // '';
530
    my $ignoreissued = $parameters->{'ignoreissued'} // '';
531
    my $ignoreissued = $parameters->{'ignoreissued'} // '';
Lines 571-576 sub GetItemsForInventory { Link Here
571
        push @bind_params, $max_cnsort;
572
        push @bind_params, $max_cnsort;
572
    }
573
    }
573
574
575
    if ($items_bundle) {
576
        push @where_strings, 'items.itemnumber IN (SELECT itemnumber FROM items_bundle_item WHERE items_bundle_id = ?)';
577
        push @bind_params, $items_bundle;
578
    }
579
574
    if ($datelastseen) {
580
    if ($datelastseen) {
575
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 });
581
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 });
576
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
582
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (-1 / +19 lines)
Lines 133-138 Link Here
133
            [% END %]
133
            [% END %]
134
            </select>
134
            </select>
135
          </li>
135
          </li>
136
        [% IF items_bundles.size > 0 %]
137
            <li>
138
                <label for="items_bundle">Items bundle:</label>
139
                <select id="items_bundle" name="items_bundle">
140
                    <option value=""></option>
141
                    [% FOREACH items_bundle IN items_bundles %]
142
                        <option value="[% items_bundle.items_bundle_id | html %]">[% items_bundle.biblionumber.title | html %]</option>
143
                    [% END %]
144
                </select>
145
            </li>
146
        [% END %]
136
    </ol>
147
    </ol>
137
    </fieldset>
148
    </fieldset>
138
149
Lines 348-354 Link Here
348
                    $('#locationloop').val() ||
359
                    $('#locationloop').val() ||
349
                    $('#minlocation').val()  ||
360
                    $('#minlocation').val()  ||
350
                    $('#maxlocation').val()  ||
361
                    $('#maxlocation').val()  ||
351
                    $('#statuses input:checked').length
362
                    $('#statuses input:checked').length ||
363
                    $('#items_bundle').val()
352
                ) ) {
364
                ) ) {
353
                    return confirm(
365
                    return confirm(
354
                        _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
366
                        _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
Lines 488-493 Link Here
488
            });
500
            });
489
        });
501
        });
490
    </script>
502
    </script>
503
    [% INCLUDE 'select2.inc' %]
504
    <script>
505
        $(document).ready(function () {
506
            $('#items_bundle').select2();
507
        });
508
    </script>
491
[% END %]
509
[% END %]
492
510
493
[% INCLUDE 'intranet-bottom.inc' %]
511
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/tools/inventory.pl (-1 / +10 lines)
Lines 47-52 my $minlocation=$input->param('minlocation') || ''; Link Here
47
my $maxlocation=$input->param('maxlocation');
47
my $maxlocation=$input->param('maxlocation');
48
my $class_source=$input->param('class_source');
48
my $class_source=$input->param('class_source');
49
$maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation );
49
$maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation );
50
my $items_bundle = $input->param('items_bundle');
50
my $location=$input->param('location') || '';
51
my $location=$input->param('location') || '';
51
my $ignoreissued=$input->param('ignoreissued');
52
my $ignoreissued=$input->param('ignoreissued');
52
my $ignore_waiting_holds = $input->param('ignore_waiting_holds');
53
my $ignore_waiting_holds = $input->param('ignore_waiting_holds');
Lines 66-71 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
66
    }
67
    }
67
);
68
);
68
69
70
my $schema = Koha::Database->new()->schema();
71
my $items_bundle_rs = $schema->resultset('ItemsBundle');
72
my @items_bundles = $items_bundle_rs->search(undef, {
73
    order_by => { -asc => ['biblionumber.title'] },
74
    join => ['biblionumber'],
75
});
69
my @authorised_value_list;
76
my @authorised_value_list;
70
my $authorisedvalue_categories = '';
77
my $authorisedvalue_categories = '';
71
78
Lines 134-139 foreach my $itemtype ( @itemtypes ) { Link Here
134
141
135
$template->param(
142
$template->param(
136
    authorised_values        => \@authorised_value_list,
143
    authorised_values        => \@authorised_value_list,
144
    items_bundles            => \@items_bundles,
137
    today                    => dt_from_string,
145
    today                    => dt_from_string,
138
    minlocation              => $minlocation,
146
    minlocation              => $minlocation,
139
    maxlocation              => $maxlocation,
147
    maxlocation              => $maxlocation,
Lines 249-254 if ( $op && ( !$uploadbarcodes || $compareinv2barcd )) { Link Here
249
      minlocation  => $minlocation,
257
      minlocation  => $minlocation,
250
      maxlocation  => $maxlocation,
258
      maxlocation  => $maxlocation,
251
      class_source => $class_source,
259
      class_source => $class_source,
260
      items_bundle => $items_bundle,
252
      location     => $location,
261
      location     => $location,
253
      ignoreissued => $ignoreissued,
262
      ignoreissued => $ignoreissued,
254
      datelastseen => $datelastseen,
263
      datelastseen => $datelastseen,
Lines 267-272 if( @scanned_items ) { Link Here
267
      maxlocation  => $maxlocation,
276
      maxlocation  => $maxlocation,
268
      class_source => $class_source,
277
      class_source => $class_source,
269
      location     => $location,
278
      location     => $location,
279
      items_bundle => $items_bundle,
270
      ignoreissued => undef,
280
      ignoreissued => undef,
271
      datelastseen => undef,
281
      datelastseen => undef,
272
      branchcode   => $branchcode,
282
      branchcode   => $branchcode,
273
- 

Return to bug 29099