fix top subtotals on refund reports
[freeside.git] / httemplate / search / cust_tax_adjustment.html
index dfc638e..6125a1c 100644 (file)
@@ -1,4 +1,4 @@
-<% include( 'elements/search.html',
+<& elements/search.html,
               'title'         => $title,
               'name_singular' => 'tax adjustment',
               'query'         => $query,
@@ -12,9 +12,8 @@
                                        },
                                  ],
               'links'         => [ '', '', '', $ilink ],
-          )
-%>
-
+          
+&>
 <%init>
 
 die "access denied"
@@ -27,11 +26,13 @@ my $count_query = 'SELECT COUNT(*) FROM cust_tax_adjustment';
 
 my $hashref = {};
 
-my $custnum = $cgi->param('custnum');
-my $cust_main;
-if ( $custnum ) {
+my $custnum = '';
+my $cust_main = '';
+if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+  $custnum = $1;
   $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
   $hashref->{'custnum'} = $custnum;
+  $count_query .= " WHERE custnum = $custnum ";
 }
 
 my $title = 'Tax adjustments';