@@ -, +, @@ --- C4/Items.pm | 8 +++++++- .../intranet-tmpl/prog/en/modules/tools/inventory.tt | 19 +++++++++++++++++++ tools/inventory.pl | 16 ++++++++++++---- 3 files changed, 38 insertions(+), 5 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1068,12 +1068,13 @@ sub GetItemsForInventory { my $size = $parameters->{'size'} // ''; my $statushash = $parameters->{'statushash'} // ''; my $interface = $parameters->{'interface'} // ''; + my $ccode = $parameters->{'ccode'} // ''; my $dbh = C4::Context->dbh; my ( @bind_params, @where_strings ); my $select_columns = q{ - SELECT items.itemnumber, barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber + SELECT items.itemnumber, barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber, ccode }; my $select_count = q{SELECT COUNT(*)}; my $query = q{ @@ -1090,6 +1091,11 @@ sub GetItemsForInventory { } } + if ($ccode){ + push @where_strings, 'ccode = ?'; + push @bind_params, $ccode; + } + if ($minlocation) { push @where_strings, 'itemcallnumber >= ?'; push @bind_params, $minlocation; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -14,6 +14,7 @@ function checkForm() { if ( !( $('#branchloop').val() || $('#locationloop').val() || + $('#ccodeloop').val() || $('#minlocation').val() || $('#maxlocation').val() || $('#statuses input:checked').length @@ -163,6 +164,19 @@ $(document).ready(function(){ [% END %]
  • + + +
  • +
  • (items.itemcallnumber)
  • @@ -231,6 +245,7 @@ $(document).ready(function(){ + [% UNLESS compareinv2barcd %]
    [Select all] [Clear all]
    @@ -242,6 +257,7 @@ $(document).ready(function(){ [% UNLESS compareinv2barcd %]Seen[% END %] Barcode Library + Collection code Title Status Lost @@ -267,6 +283,9 @@ $(document).ready(function(){ [% result.location | html %] [% IF ( result.itemcallnumber ) %][[% result.itemcallnumber | html %]][% ELSE %][% END %] + [% result.ccode | html %] + +

    [% result.title | html %]

    [% result.author | html %]

    --- a/tools/inventory.pl +++ a/tools/inventory.pl @@ -52,6 +52,7 @@ my $branchcode = $input->param('branchcode') || ''; my $branch = $input->param('branch'); my $op = $input->param('op'); my $compareinv2barcd = $input->param('compareinv2barcd'); +my $ccode = $input->param('ccode'); my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { template_name => "tools/inventory.tt", @@ -92,6 +93,10 @@ for my $fwk (keys %$frameworks){ } } +my $collection_authorised_value = C4::Koha::GetAuthValCode("items.ccode"); +my $collections = C4::Koha::GetAuthorisedValues($collection_authorised_value) // []; +$template->param( ccode_list => $collections ); + my $statuses = []; for my $statfield (qw/items.notforloan items.itemlost items.withdrawn items.damaged/){ my $hash = {}; @@ -138,7 +143,8 @@ $template->param( branch => $branch, datelastseen => $datelastseen, compareinv2barcd => $compareinv2barcd, - notforloanlist => $notforloanlist + notforloanlist => $notforloanlist, + ccode => $ccode, ); my @notforloans; @@ -253,9 +259,10 @@ if ( $markseen or $op ) { size => undef, statushash => $staton, interface => 'staff', + ccode => $ccode, } ); - # For the items that may be marked as "wrong place", we only check the location (callnumbers, location and branch) + # For the items that may be marked as "wrong place", we only check the location (callnumbers, location, ccode and branch) ($wrongplacelist, $totalrecords) = GetItemsForInventory( { minlocation => $minlocation, maxlocation => $maxlocation, @@ -269,6 +276,7 @@ if ( $markseen or $op ) { size => undef, statushash => undef, interface => 'staff', + ccode => $ccode, } ); } @@ -382,7 +390,7 @@ if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ my @translated_keys; for my $key (qw / biblioitems.title biblio.author items.barcode items.itemnumber - items.homebranch items.location + items.homebranch items.location items.ccode items.itemcallnumber items.notforloan items.itemlost items.damaged items.withdrawn items.stocknumber @@ -394,7 +402,7 @@ if (defined $input->param('CSVexport') && $input->param('CSVexport') eq 'on'){ $csv->combine(@translated_keys); print $csv->string, "\n"; - my @keys = qw / title author barcode itemnumber homebranch location itemcallnumber notforloan lost damaged withdrawn stocknumber /; + my @keys = qw / title author barcode itemnumber homebranch location ccode itemcallnumber notforloan lost damaged withdrawn stocknumber /; for my $item ( @results ) { my @line; for my $key (@keys) { --