[freeside-commits] freeside/httemplate/search cust_bill_pkg.cgi, 1.36, 1.37

Ivan,,, ivan at wavetail.420.am
Fri Nov 5 11:16:24 PDT 2010


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

Modified Files:
	cust_bill_pkg.cgi 
Log Message:
fix line item report when linked from CCH tax report... credits may still be off w/pkg locations?  RT#10472

Index: cust_bill_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_pkg.cgi,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -w -d -r1.36 -r1.37
--- cust_bill_pkg.cgi	29 Jun 2010 05:22:55 -0000	1.36
+++ cust_bill_pkg.cgi	5 Nov 2010 18:16:22 -0000	1.37
@@ -502,26 +502,29 @@
 } elsif ( $cgi->param('istax') ) {
 
   #false laziness w/report_tax.cgi $taxfromwhere
-  if ( $conf->exists('tax-pkg_address') ) {
+  if ( scalar( grep( /locationtaxid/, $cgi->param ) ) ||
+            $cgi->param('iscredit') eq 'rate') {
+
+    $join_pkg .=
+      ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ) '.
+      ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) ';
+
+  } elsif ( $conf->exists('tax-pkg_address') ) {
+
     $join_pkg .= ' LEFT JOIN cust_bill_pkg_tax_location USING ( billpkgnum )
                    LEFT JOIN cust_location              USING ( locationnum ) ';
 
     #quelle kludge, somewhat false laziness w/report_tax.cgi
     s/cust_pkg\.locationnum/cust_bill_pkg_tax_location.locationnum/g for @where;
-  } elsif ( scalar( grep( /locationtaxid/, $cgi->param ) ) ||
-            $cgi->param('iscredit') eq 'rate') {
-    $join_pkg .=
-      ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ) '.
-      ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) ';
   }
 
   if ( $cgi->param('iscredit') ) {
     $join_pkg .= ' JOIN cust_credit_bill_pkg USING ( billpkgnum';
-    if ( $conf->exists('tax-pkg_address') ) {
+    if ( $cgi->param('iscredit') eq 'rate' ) {
+      $join_pkg .= ', billpkgtaxratelocationnum )';
+    } elsif ( $conf->exists('tax-pkg_address') ) {
       $join_pkg .= ', billpkgtaxlocationnum )';
       push @where, "billpkgtaxratelocationnum IS NULL";
-    } elsif ( $cgi->param('iscredit') eq 'rate' ) {
-      $join_pkg .= ', billpkgtaxratelocationnum )';
     } else {
       $join_pkg .= ' )';
       push @where, "billpkgtaxratelocationnum IS NULL";



More information about the freeside-commits mailing list