[freeside-commits] freeside/httemplate/search report_tax.cgi, 1.47, 1.48 cust_bill_pkg.cgi, 1.15, 1.16

Ivan,,, ivan at wavetail.420.am
Sun Nov 2 12:28:11 PST 2008


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv15849/search

Modified Files:
	report_tax.cgi cust_bill_pkg.cgi 
Log Message:
(and REALLY fix the line-item links too, whew) fix overreporting of tax invoiced when using & reporting with taxclasses, RT#4131

Index: report_tax.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_tax.cgi,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- report_tax.cgi	2 Nov 2008 20:03:30 -0000	1.47
+++ report_tax.cgi	2 Nov 2008 20:28:09 -0000	1.48
@@ -301,7 +301,10 @@
 
   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 @@
 
     $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 @@
     $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;

Index: cust_bill_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_pkg.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cust_bill_pkg.cgi	30 Sep 2008 21:05:13 -0000	1.15
+++ cust_bill_pkg.cgi	2 Nov 2008 20:28:09 -0000	1.16
@@ -119,6 +119,13 @@
     " ( 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');
 



More information about the freeside-commits mailing list