[Koha-patches] [PATCH] kohabug 2224 Third installment: Further corrections for NULL fields

Galen Charlton galen.charlton at liblime.com
Fri Jul 25 17:37:51 CEST 2008


From: Chris Nighswonger <chris.nighswonger at liblime.com>

This patch adds code to clean out any NULL fields in rows returned
since NULL fields do not truly meet the filter criteria

It also corrects a bad db field reference.

Signed-off-by: Galen Charlton <galen.charlton at liblime.com>
---
 .../en/modules/reports/acquisitions_stats.tmpl     |    4 ++--
 reports/acquisitions_stats.pl                      |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tmpl
index 2631882..50eb946 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tmpl
@@ -156,8 +156,8 @@
 			</tr>
 			<tr>
 				<td>Received On</td>
-				<td><input type="radio" name="Line" value="aqorderbreakdown.datereceived" /></td>
-				<td><input type="radio" name="Column" value="aqorderbreakdown.datereceived" /></td>
+				<td><input type="radio" name="Line" value="aqorders.datereceived" /></td>
+				<td><input type="radio" name="Column" value="aqorders.datereceived" /></td>
 				<td> From <input type="text" size="10" id="fromRO" name="Filter" value="" />
 							<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openCalendarFromRO" style="cursor: pointer;" />
 									<script type="text/javascript">
diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl
index ce0f37d..c5c4036 100755
--- a/reports/acquisitions_stats.pl
+++ b/reports/acquisitions_stats.pl
@@ -620,10 +620,10 @@ sub calculate {
     $strcalc .= " AND aqbasket.closedate <= '" . @$filters[1] . "'"
       if ( @$filters[1] );
     @$filters[2] =~ s/\*/%/g if ( @$filters[2] );
-    $strcalc .= " AND aqorderbreakdown.datereceived >= '" . @$filters[2] . "'"
+    $strcalc .= " AND aqorders.datereceived >= '" . @$filters[2] . "'"
       if ( @$filters[2] );
     @$filters[3] =~ s/\*/%/g if ( @$filters[3] );
-    $strcalc .= " AND aqorderbreakdown.datereceived <= '" . @$filters[3] . "'"
+    $strcalc .= " AND aqorders.datereceived <= '" . @$filters[3] . "'"
       if ( @$filters[3] );
 #    @$filters[4] =~ s/\*/%/g if ( @$filters[4] );
 #    $strcalc .= " AND aqbasket.closedate >= '" . @$filters[4] . "'"
@@ -655,6 +655,7 @@ sub calculate {
     #       warn "filling table";
     my $emptycol;
     while ( my ( $row, $col, $value ) = $dbcalc->fetchrow ) {
+		next if ($row eq undef || $col eq undef);
 		#warn "filling table $row / $col / $value ";
         $emptycol = 1         if ( $col eq undef );
         $col      = "zzEMPTY" if ( $col eq undef );
-- 
1.5.5.GIT




More information about the Koha-patches mailing list