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

(-)a/C4/Items.pm (+6 lines)
Lines 583-588 sub GetItemsForInventory { Link Here
583
    my $minlocation          = $parameters->{'minlocation'}  // '';
583
    my $minlocation          = $parameters->{'minlocation'}  // '';
584
    my $maxlocation          = $parameters->{'maxlocation'}  // '';
584
    my $maxlocation          = $parameters->{'maxlocation'}  // '';
585
    my $class_source         = $parameters->{'class_source'} // C4::Context->preference('DefaultClassificationSource');
585
    my $class_source         = $parameters->{'class_source'} // C4::Context->preference('DefaultClassificationSource');
586
    my $items_bundle         = $parameters->{'items_bundle'} // '';
586
    my $location             = $parameters->{'location'}     // '';
587
    my $location             = $parameters->{'location'}     // '';
587
    my $itemtype             = $parameters->{'itemtype'}     // '';
588
    my $itemtype             = $parameters->{'itemtype'}     // '';
588
    my $ignoreissued         = $parameters->{'ignoreissued'} // '';
589
    my $ignoreissued         = $parameters->{'ignoreissued'} // '';
Lines 636-641 sub GetItemsForInventory { Link Here
636
        push @bind_params,   $max_cnsort;
637
        push @bind_params,   $max_cnsort;
637
    }
638
    }
638
639
640
    if ($items_bundle) {
641
        push @where_strings, 'items.itemnumber IN (SELECT itemnumber FROM items_bundle_item WHERE items_bundle_id = ?)';
642
        push @bind_params,   $items_bundle;
643
    }
644
639
    if ($datelastseen) {
645
    if ($datelastseen) {
640
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
646
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
641
        push @bind_params,   $datelastseen;
647
        push @bind_params,   $datelastseen;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (-1 / +19 lines)
Lines 181-186 Link Here
181
                            [% END %]
181
                            [% END %]
182
                        </select>
182
                        </select>
183
                    </li>
183
                    </li>
184
                    [% IF items_bundles.size > 0 %]
185
                        <li>
186
                            <label for="items_bundle">Items bundle:</label>
187
                            <select id="items_bundle" name="items_bundle">
188
                                <option value=""></option>
189
                                [% FOREACH items_bundle IN items_bundles %]
190
                                    <option value="[% items_bundle.items_bundle_id | html %]">[% items_bundle.biblionumber.title | html %]</option>
191
                                [% END %]
192
                            </select>
193
                        </li>
194
                    [% END %]
184
                </ol>
195
                </ol>
185
            </fieldset>
196
            </fieldset>
186
197
Lines 420-426 Link Here
420
                    $('#locationloop').val() ||
431
                    $('#locationloop').val() ||
421
                    $('#minlocation').val()  ||
432
                    $('#minlocation').val()  ||
422
                    $('#maxlocation').val()  ||
433
                    $('#maxlocation').val()  ||
423
                    $('#statuses input:checked').length
434
                    $('#statuses input:checked').length ||
435
                    $('#items_bundle').val()
424
                ) ) {
436
                ) ) {
425
                    return confirm(
437
                    return confirm(
426
                        _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
438
                        _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
Lines 561-566 Link Here
561
            });
573
            });
562
        });
574
        });
563
    </script>
575
    </script>
576
    [% INCLUDE 'select2.inc' %]
577
    <script>
578
        $(document).ready(function () {
579
            $("#items_bundle").select2();
580
        });
581
    </script>
564
[% END %]
582
[% END %]
565
583
566
[% INCLUDE 'intranet-bottom.inc' %]
584
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/tools/inventory.pl (-1 / +13 lines)
Lines 49-54 my $minlocation = $input->param('minlocation') || ''; Link Here
49
my $maxlocation  = $input->param('maxlocation');
49
my $maxlocation  = $input->param('maxlocation');
50
my $class_source = $input->param('class_source');
50
my $class_source = $input->param('class_source');
51
$maxlocation = $minlocation . 'Z' unless ( $maxlocation || !$minlocation );
51
$maxlocation = $minlocation . 'Z' unless ( $maxlocation || !$minlocation );
52
my $items_bundle         = $input->param('items_bundle');
52
my $location             = $input->param('location') || '';
53
my $location             = $input->param('location') || '';
53
my $ignoreissued         = $input->param('ignoreissued');
54
my $ignoreissued         = $input->param('ignoreissued');
54
my $ignore_waiting_holds = $input->param('ignore_waiting_holds');
55
my $ignore_waiting_holds = $input->param('ignore_waiting_holds');
Lines 70-75 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
70
    }
71
    }
71
);
72
);
72
73
74
my $schema          = Koha::Database->new()->schema();
75
my $items_bundle_rs = $schema->resultset('ItemsBundle');
76
my @items_bundles   = $items_bundle_rs->search(
77
    undef,
78
    {
79
        order_by => { -asc => ['biblionumber.title'] },
80
        join     => ['biblionumber'],
81
    }
82
);
73
my @authorised_value_list;
83
my @authorised_value_list;
74
my $authorisedvalue_categories = '';
84
my $authorisedvalue_categories = '';
75
85
Lines 166-171 foreach my $itemtype (@itemtypes) { Link Here
166
176
167
$template->param(
177
$template->param(
168
    authorised_values    => \@authorised_value_list,
178
    authorised_values    => \@authorised_value_list,
179
    items_bundles        => \@items_bundles,
169
    today                => dt_from_string,
180
    today                => dt_from_string,
170
    minlocation          => $minlocation,
181
    minlocation          => $minlocation,
171
    maxlocation          => $maxlocation,
182
    maxlocation          => $maxlocation,
Lines 291-296 if ( $op eq 'cud-inventory' && ( !$uploadbarcodes || $compareinv2barcd ) ) { Link Here
291
            minlocation          => $minlocation,
302
            minlocation          => $minlocation,
292
            maxlocation          => $maxlocation,
303
            maxlocation          => $maxlocation,
293
            class_source         => $class_source,
304
            class_source         => $class_source,
305
            items_bundle         => $items_bundle,
294
            location             => $location,
306
            location             => $location,
295
            ignoreissued         => $ignoreissued,
307
            ignoreissued         => $ignoreissued,
296
            datelastseen         => $datelastseen,
308
            datelastseen         => $datelastseen,
Lines 315-320 if (@scanned_items) { Link Here
315
            maxlocation          => $maxlocation,
327
            maxlocation          => $maxlocation,
316
            class_source         => $class_source,
328
            class_source         => $class_source,
317
            location             => $location,
329
            location             => $location,
330
            items_bundle         => $items_bundle,
318
            ignoreissued         => undef,
331
            ignoreissued         => undef,
319
            datelastseen         => undef,
332
            datelastseen         => undef,
320
            branchcode           => $branchcode,
333
            branchcode           => $branchcode,
321
- 

Return to bug 29099