(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: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
This commit is contained in:
Nahuel ANGELINETTI 2010-07-02 15:27:59 +02:00 committed by Henri-Damien LAURENT
parent 8def2ebb0a
commit 2d5559ffcc
3 changed files with 14 additions and 5 deletions

View File

@ -1034,7 +1034,7 @@ offset & size can be used to retrieve only a part of the whole listing (defaut b
=cut
sub GetItemsForInventory {
my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branch, $offset, $size ) = @_;
my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $branch, $offset, $size ) = @_;
my $dbh = C4::Context->dbh;
my ( @bind_params, @where_strings );
@ -1066,9 +1066,13 @@ END_SQL
push @bind_params, $location;
}
if ( $branch ) {
push @where_strings, 'items.homebranch = ?';
push @bind_params, $branch;
if ( $branchcode ) {
if($branch eq "homebranch"){
push @where_strings, 'items.homebranch = ?';
}else{
push @where_strings, 'items.holdingbranch = ?';
}
push @bind_params, $branchcode;
}
if ( $itemtype ) {

View File

@ -47,6 +47,10 @@ $(document).ready(function(){
<fieldset class="rows">
<legend>Select items you want to check</legend>
<ol><li>
<label for="branch">Branch</label>
<input type="radio" name="branch" value="homebranch">Home Branch</input>
<input type="radio" name="branch" value="holdingbranch">Holding Branch</input>
</li><li>
<label for="branchloop">Library</label><select id="branchloop" name="branchcode" style="width:12em;">
<!-- TMPL_LOOP NAME="branchloop" -->
<!-- TMPL_IF name="selected" -->

View File

@ -44,6 +44,7 @@ my $pagesize = $input->param('pagesize');
$pagesize=50 unless $pagesize;
my $uploadbarcodes = $input->param('uploadbarcodes');
my $branchcode = $input->param('branchcode');
my $branch = $input->param('branch');
my $op = $input->param('op');
# warn "uploadbarcodes : ".$uploadbarcodes;
# use Data::Dumper; warn Dumper($input);
@ -156,7 +157,7 @@ if ($uploadbarcodes && length($uploadbarcodes)>0){
}
}
if ($markseen or $op) {
my $res = GetItemsForInventory($minlocation,$maxlocation,$location,$itemtype,$ignoreissued,$datelastseen,$branchcode,$offset,$pagesize);
my $res = GetItemsForInventory($minlocation,$maxlocation,$location,$itemtype,$ignoreissued,$datelastseen,$branchcode,$branch,$offset,$pagesize);
$template->param(loop =>$res,
nextoffset => ($offset+$pagesize),
prevoffset => ($offset?$offset-$pagesize:0),