summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2009-09-17 01:37:36 +0000
committerivan <ivan>2009-09-17 01:37:36 +0000
commit116ae8901c51a8e491de6c69d3e55d65369166d5 (patch)
tree091dd045b01a9b50dfcc267c7315bdd59d5adf6d /httemplate/search
parentdf2b4d94d5eaef3e9635d7a519fa297d017d42ea (diff)
fix sales tax report w/part_pkg overrides, RT#6197
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cust_bill_pkg.cgi67
1 files changed, 38 insertions, 29 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index 62954ea18..52f59de1e 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -119,36 +119,43 @@ if ( $cgi->param('classnum') =~ /^(\d+)$/ ) {
}
}
-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?)
+ )
+{
+
+ #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 {
+
+ push @where,
+ ' ( '. join(' OR ',
+ map ' part_pkg.taxclass = '.dbh->quote($_),
+ $cgi->param('taxclass')
+ ).
+ ' ) ';
+
+ #}
-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?)
-
-#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
-# ";
-#
-#}
+}
if ( $cgi->param('out') ) {
@@ -319,6 +326,8 @@ if ( $cgi->param('cust_tax') ) {
push @where, $cust_exempt;
}
+my $use_usage = $cgi->param('use_usage');
+
my $count_query;
if ( $cgi->param('pkg_tax') ) {