[freeside-commits] freeside/httemplate/search cust_bill_pkg.cgi, 1.27, 1.28

Ivan,,, ivan at wavetail.420.am
Wed Sep 16 18:37:38 PDT 2009


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

Modified Files:
	cust_bill_pkg.cgi 
Log Message:
fix sales tax report w/part_pkg overrides, RT#6197

Index: cust_bill_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_pkg.cgi,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- cust_bill_pkg.cgi	24 Aug 2009 05:09:27 -0000	1.27
+++ cust_bill_pkg.cgi	17 Sep 2009 01:37:36 -0000	1.28
@@ -119,36 +119,43 @@
   }
 }
 
-my $use_usage = $cgi->param('use_usage');
+if ( $cgi->param('taxclass')
+     && ! $cgi->param('istax')  #no part_pkg.taxclass in this case
+                                #(should we save a taxclass or a link to taxnum
+                                # in cust_bill_pkg or something like
+                                # cust_bill_pkg_tax_location?)
+   )
+{
 
-push @where, ' ( '. join(' OR ',
-                      map ' taxclass = '.dbh->quote($_), $cgi->param('taxclass')
-                    ).
-             ' ) '
-  if $cgi->param('taxclass')
-  && ! $cgi->param('istax'); #no part_pkg.taxclass in this case
-                             #(should we save a taxclass or a link to taxnum
-                             # in cust_bill_pkg or something like
-                             # cust_bill_pkg_tax_location?)
+  #override taxclass when use_override is specified?  probably
+  #if ( $use_override ) {
+  #
+  #  push @where,
+  #    ' ( '. join(' OR ',
+  #                  map {
+  #                        ' (    part_pkg.taxclass = '. dbh->quote($_).
+  #                        '      AND pkgpart_override IS NULL '.
+  #                        '   OR '.
+  #                        '      override.taxclass = '. dbh->quote($_).
+  #                        '      AND pkgpart_override IS NOT NULL '.
+  #                        ' ) '
+  #                      }
+  #                      $cgi->param('taxclass')
+  #               ).
+  #    ' ) ';
+  #
+  #} else {
 
-#sub _where {
-# my $table = shift;
-# my $prefix = @_ ? shift : '';
-# "
-#      (    cust_main_county.county  = $table.${prefix}.county
-#      OR ( cust_main_county.county IS NULL AND $table.${prefix}.county  =  '' )
-#      OR ( cust_main_county.county  =  ''  AND $table.${prefix}.county IS NULL)
-#      OR ( cust_main_county.county IS NULL AND $table.${prefix}.county IS NULL)
-#      )
-#  AND (    cust_main_county.state   = $table.${prefix}.state
-#      OR ( cust_main_county.state  IS NULL AND $table.${prefix}.state  =  ''  )
-#      OR ( cust_main_county.state   =  ''  AND $table.${prefix}.state IS NULL )
-#      OR ( cust_main_county.state  IS NULL AND $table.${prefix}.state IS NULL )
-#      )
-#  AND cust_main_county.country = $table.${prefix}.country
-# ";
-#
-#}
+    push @where,
+      ' ( '. join(' OR ',
+                    map ' part_pkg.taxclass = '.dbh->quote($_),
+                        $cgi->param('taxclass')
+                 ).
+      ' ) ';
+
+  #}
+
+}
 
 if ( $cgi->param('out') ) {
 
@@ -319,6 +326,8 @@
   push @where, $cust_exempt;
 }
 
+my $use_usage = $cgi->param('use_usage');
+
 my $count_query;
 if ( $cgi->param('pkg_tax') ) {
 



More information about the freeside-commits mailing list