From a1e8310e557c6a0e20a898c2b077cea33a69448d Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Mon, 4 Jun 2012 10:30:03 +0530 Subject: [PATCH] 6809 branch filter in holds to pull report --- circ/pendingreserves.pl | 9 +++++++++ .../prog/en/modules/circ/pendingreserves.tt | 13 +++++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 52a0450..c8b0b46 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -32,10 +32,12 @@ use C4::Auth; use C4::Dates qw/format_date format_date_in_iso/; use C4::Debug; use Date::Calc qw/Today Add_Delta_YMD/; +use C4::Branch; # GetBranches GetBranchesLoop my $input = new CGI; my $startdate=$input->param('from'); my $enddate=$input->param('to'); +my $branch =$input->param('branch'); my $run_report=$input->param('run_report'); my $theme = $input->param('theme'); # only used if allowthemeoverride is set @@ -89,6 +91,7 @@ my @reservedata; if ( $run_report ) { my $dbh = C4::Context->dbh; my $sqldatewhere = ""; + my $sqlbranch = ""; $debug and warn format_date_in_iso($startdate) . "\n" . format_date_in_iso($enddate); my @query_params = (); if ($startdate) { @@ -99,6 +102,10 @@ if ( $run_report ) { $sqldatewhere .= " AND reservedate <= ?"; push @query_params, format_date_in_iso($enddate); } + if ($branch) { + $sqlbranch .= " AND items.homebranch= ?"; + push @query_params,($branch); + } my $strsth = "SELECT min(reservedate) as l_reservedate, @@ -138,6 +145,7 @@ if ( $run_report ) { WHERE reserves.found IS NULL $sqldatewhere + $sqlbranch AND (reserves.itemnumber IS NULL OR reserves.itemnumber = items.itemnumber) AND items.itemnumber NOT IN (SELECT itemnumber FROM branchtransfers where datearrived IS NULL) AND issues.itemnumber IS NULL @@ -196,6 +204,7 @@ $template->param( todaysdate => format_date($todaysdate), from => $startdate, to => $enddate, + branchloop => GetBranchesLoop(), run_report => $run_report, reserveloop => \@reservedata, "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt index c79a231..23dfecc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -210,6 +210,19 @@ Calendar.setup( } ); +
  • + +
  • (Inclusive, default is two days ago to today, set other date ranges as needed. )

    -- 1.6.4.2