From 35b47b6ff71ea2bcfc699ec35132756d01bfadd3 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Wed, 2 Feb 2011 19:40:10 -0500 Subject: [PATCH] Bug 4931: Stocking can be by homebranch or holding branch Squashed commit of the following: commit 105de81639cbac5084e4a5c099b19569043e69ff Author: Nahuel ANGELINETTI Date: Tue Jul 13 11:58:01 2010 +0200 (bug #4931) fix forgottens input in buttons the previous patch missed an hidden input in next buttons that break next page. This fix it. commit db00295a6b9d1d36fc888ba6a0558011fd6884ba Author: Nahuel ANGELINETTI Date: Fri Jul 2 15:27:59 2010 +0200 (bug #4931) add the ability to choose home or holding branch in stocktaking This add radio box in stocktaking to base it on home or holdingbranch Signed-off-by: Chris Nighswonger Bug 4391 Followup: Adding back lost declaration of $branchcode Signed-off-by: Chris Cormack --- C4/Items.pm | 12 ++++++++---- .../prog/en/modules/tools/inventory.tmpl | 6 ++++++ tools/inventory.pl | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) 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(){
Select items you want to check
  1. + + Home Branch + Holding Branch +
  2. " /> " /> " /> " /> @@ -241,6 +246,7 @@ $(document).ready(function(){
    + " /> " /> " /> " /> diff --git a/tools/inventory.pl b/tools/inventory.pl index c87a7e9aff..f8903e5e7b 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -49,6 +49,7 @@ $offset=0 unless $offset; my $pagesize = $input->param('pagesize'); $pagesize=50 unless $pagesize; my $branchcode = $input->param('branchcode'); +my $branch = $input->param('branch'); my $op = $input->param('op'); my $res; #contains the results loop # warn "uploadbarcodes : ".$uploadbarcodes; @@ -129,6 +130,7 @@ $template->param(branchloop => \@branch_loop, location=>$location, ignoreissued=>$ignoreissued, branchcode=>$branchcode, + branch => $branch, offset => $offset, pagesize => $pagesize, datelastseen => $datelastseen, @@ -183,7 +185,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa } } if ($markseen or $op) { - $res = GetItemsForInventory($minlocation,$maxlocation,$location, $ignoreissued,$itemtype,$datelastseen,$branchcode,$offset,$pagesize,$staton); + $res = GetItemsForInventory( $minlocation, $maxlocation, $location, $ignoreissued, $itemtype, $datelastseen, $branchcode, $branch, $offset, $pagesize, $staton ); $template->param(loop =>$res, nextoffset => ($offset+$pagesize), prevoffset => ($offset?$offset-$pagesize:0), -- 2.39.5