diff --git a/C4/Items.pm b/C4/Items.pm index a7c190ca45..cc137367c1 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -954,7 +954,7 @@ $statushash requires a hashref that has the authorized values fieldname (intems. =cut sub GetItemsForInventory { - my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branch, $offset, $size, $statushash ) = @_; + my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $branch, $offset, $size, $statushash ) = @_; my $dbh = C4::Context->dbh; my ( @bind_params, @where_strings ); @@ -993,10 +993,14 @@ END_SQL push @where_strings, 'items.location = ?'; push @bind_params, $location; } - - if ( $branch ) { + + if ( $branchcode ) { + if($branch eq "homebranch"){ push @where_strings, 'items.homebranch = ?'; - push @bind_params, $branch; + }else{ + push @where_strings, 'items.holdingbranch = ?'; + } + push @bind_params, $branchcode; } if ( $itemtype ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl index 0b350006fb..480441da82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl @@ -76,6 +76,10 @@ $(document).ready(function(){