summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-12-17 13:44:48 -0800
committerIvan Kohler <ivan@freeside.biz>2012-12-17 13:44:48 -0800
commit0ed24da8397a00b70aa03fe8bc494aad5cbb1d0c (patch)
tree95acb695b52d9d0c9b3ec5129ecc31e0dfd6e055
parentac53786ee24160a38b7f32ba2bf7370449c949a5 (diff)
add line item report, RT#18676
-rw-r--r--httemplate/search/cust_bill_pkg.cgi19
1 files changed, 15 insertions, 4 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index 917ec8940..48c7684f3 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -552,12 +552,23 @@ if ( $cgi->param('pkg_tax') ) {
$join_cust = ' JOIN cust_bill USING ( invnum )
LEFT JOIN cust_main USING ( custnum ) ';
+# then we want the package and its definition
+$join_pkg =
+' LEFT JOIN cust_pkg USING (pkgnum)
+ LEFT JOIN part_pkg USING (pkgpart)';
+
+#my $part_pkg = 'part_pkg';
+#if ( $cgi->param('use_override') ) {
+ # still need the real part_pkg for tax applicability,
+ # so alias this one
+ $join_pkg .= " LEFT JOIN part_pkg AS override ON (
+ COALESCE(cust_bill_pkg.pkgpart_override, cust_pkg.pkgpart, 0) = part_pkg.pkgpart
+ )";
+# $part_pkg = 'override';
+#}
+
if ( $cgi->param('nottax') ) {
- $join_pkg .= ' LEFT JOIN cust_pkg USING ( pkgnum )
- LEFT JOIN part_pkg USING ( pkgpart )
- LEFT JOIN part_pkg AS override
- ON pkgpart_override = override.pkgpart ';
$join_pkg .= ' LEFT JOIN cust_location USING ( locationnum ) '
if $conf->exists('tax-pkg_address');