From 315a541682cb5b62d2174b6310b6666159dc74df Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Sat, 15 Aug 2009 09:50:24 -0400 Subject: [PATCH] Bug 3420: Fixes 'Patrons with no checkouts' report. Fixed typo in SQL statement. Commented out some unused SQL statements. Removed limit for itemtype (column not available in results) and added limit for branchcode. Signed-off-by: Galen Charlton --- .../prog/en/modules/reports/borrowers_out.tmpl | 4 ++-- reports/borrowers_out.pl | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tmpl index ce7c4a978e..452510310d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tmpl @@ -88,8 +88,8 @@
  • diff --git a/reports/borrowers_out.pl b/reports/borrowers_out.pl index 361102169b..2bd831be22 100755 --- a/reports/borrowers_out.pl +++ b/reports/borrowers_out.pl @@ -172,7 +172,7 @@ sub calculate { my $colfield; my $colorder; if ($column){ - $column = "borrowers.".$column if $column=~/categorycode/; + $column = "borrowers.".$column if $column=~/categorycode/ || $column=~/branchcode/; my @colfilter ; $colfilter[0] = @$filters[0] if ($column =~ /category/ ) ; # $colfilter[0] = @$filters[11] if ($column =~ /sort2/ ) ; @@ -183,7 +183,7 @@ sub calculate { $colorder .= $column; my $strsth2; - $strsth2 .= "select distinctrow $colfield FROM borrowers LEFT JOIN `old_issues` ON issues.borrowernumber=borrowers.borrowernumber"; + $strsth2 .= "select distinctrow $colfield FROM borrowers LEFT JOIN `old_issues` ON old_issues.borrowernumber=borrowers.borrowernumber"; if ($colfilter[0]) { $colfilter[0] =~ s/\*/%/g; $strsth2 .= " and $column LIKE '$colfilter[0]' " ; @@ -233,7 +233,7 @@ sub calculate { $strcalc .= " AND borrowers.categorycode like '" . @$filters[0] ."'" if ( @$filters[0] ); if (@$filters[1]){ my $strqueryfilter="SELECT DISTINCT borrowernumber FROM old_issues where old_issues.timestamp> @$filters[1] "; - my $queryfilter = $dbh->prepare("SELECT DISTINCT borrowernumber FROM old_issues where old_issues.timestamp> ".format_date_in_iso(@$filters[1])); +# my $queryfilter = $dbh->prepare("SELECT DISTINCT borrowernumber FROM old_issues where old_issues.timestamp> ".format_date_in_iso(@$filters[1])); $strcalc .= " AND borrowers.borrowernumber not in ($strqueryfilter)"; # $queryfilter->execute(@$filters[1]); @@ -242,8 +242,8 @@ sub calculate { # } } else { my $strqueryfilter="SELECT DISTINCT borrowernumber FROM old_issues "; - my $queryfilter = $dbh->prepare("SELECT DISTINCT borrowernumber FROM old_issues "); - $queryfilter->execute; +# my $queryfilter = $dbh->prepare("SELECT DISTINCT borrowernumber FROM old_issues "); +# $queryfilter->execute; $strcalc .= " AND borrowers.borrowernumber not in ($strqueryfilter)"; # while (my ($borrowernumber)=$queryfilter->fetchrow){ # $strcalc .= " AND borrowers.borrowernumber <> $borrowernumber "; -- 2.39.5