(and REALLY fix the line-item links too, whew) fix overreporting of tax invoiced...
authorivan <ivan>
Sun, 2 Nov 2008 20:28:09 +0000 (20:28 +0000)
committerivan <ivan>
Sun, 2 Nov 2008 20:28:09 +0000 (20:28 +0000)
httemplate/search/cust_bill_pkg.cgi
httemplate/search/report_tax.cgi

index 61d9a75..1a95d01 100644 (file)
@@ -119,6 +119,13 @@ if ( $cgi->param('out') ) {
     " ( state   = $state  OR $state  = '' ) ",
     "   country = $country "
   ;
+  if ( $cgi->param('taxname') ) {
+    push @where, 'itemdesc = '. dbh->quote( $cgi->param('taxname') );
+  #} elsif ( $cgi->param('taxnameNULL') {
+  } else {
+    push @where, "( itemdesc IS NULL OR itemdesc = '' OR itemdesc = 'Tax' )";
+  }
+
   push @where, ' taxclass = '. dbh->quote( $cgi->param('taxclass') )
     if $cgi->param('taxclass');
 
index 21b42e3..0bec85d 100755 (executable)
@@ -301,7 +301,10 @@ foreach my $r ( qsearch({ 'table'     => 'cust_main_county',
 
   my $label = getlabel($r);
   $regions{$label}->{'label'} = $label;
-  $regions{$label}->{'url_param'} = join(';', map "$_=".$r->$_(), qw( county state country ) );
+  $regions{$label}->{'url_param'} =
+    join(';', map "$_=".uri_escape($r->$_()),
+                  qw( county state country taxname )
+        );
 
   my @param = @base_param;
   my $mywhere = $where;
@@ -310,7 +313,7 @@ foreach my $r ( qsearch({ 'table'     => 'cust_main_county',
 
     $mywhere .= " AND taxclass = ? ";
     push @param, 'taxclass';
-    $regions{$label}->{'url_param'} .= ';taxclass='. $r->taxclass
+    $regions{$label}->{'url_param'} .= ';taxclass='. uri_escape($r->taxclass)
       if $cgi->param('show_taxclasses');
 
   } else {
@@ -494,13 +497,9 @@ if ( $cgi->param('show_taxclasses') ) {
     $base_regions{$base_label}->{'label'} = $base_label;
 
     $base_regions{$base_label}->{'url_param'} =
-      join(';', map "$_=".$r->$_(), qw( county state country ) ); #taxname???
-
-    if ( $r->taxclass ) {
-      $base_regions{$base_label}->{'url_param'} .= ';taxclass='. $r->taxclass;
-    } else {
-      $base_regions{$base_label}->{'url_param'} .= ';taxclassNULL=1'
-    }
+      join(';', map "$_=". uri_escape($r->$_()),
+                     qw( county state country taxname )
+          );
 
     $base_regions{$base_label}->{'tax'} += $x;
     $tax += $x;