[freeside-commits] freeside/httemplate/search cust_bill_pkg.cgi, 1.37.2.2, 1.37.2.3 report_newtax.cgi, 1.3, 1.3.4.1
Ivan,,,
ivan at wavetail.420.am
Wed Feb 9 17:04:01 PST 2011
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv8788
Modified Files:
Tag: FREESIDE_2_1_BRANCH
cust_bill_pkg.cgi report_newtax.cgi
Log Message:
fix cch tax report for more than one cust_bill_pkg_tax_rate_location per line item, RT#11483
Index: cust_bill_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_pkg.cgi,v
retrieving revision 1.37.2.2
retrieving revision 1.37.2.3
diff -u -w -d -r1.37.2.2 -r1.37.2.3
--- cust_bill_pkg.cgi 12 Nov 2010 19:57:26 -0000 1.37.2.2
+++ cust_bill_pkg.cgi 10 Feb 2011 01:03:59 -0000 1.37.2.3
@@ -463,7 +463,8 @@
} else {
- $count_query = "SELECT COUNT(*), ";
+ #$count_query = "SELECT COUNT(*), ";
+ $count_query = "SELECT COUNT(DISTINCT billpkgnum), ";
if ( $use_usage eq 'recurring' ) {
$count_query .= "SUM(setup + recur - usage)";
@@ -472,8 +473,13 @@
} elsif ( $unearned ) {
$count_query .= "SUM(cust_bill_pkg.recur)";
} else {
+ if ( scalar( grep( /locationtaxid/, $cgi->param ) ) ||
+ $cgi->param('iscredit') eq 'rate') {
+ $count_query .= "SUM( COALESCE(amount, cust_bill_pkg.setup + cust_bill_pkg.recur))";
+ } else {
$count_query .= "SUM(cust_bill_pkg.setup + cust_bill_pkg.recur)";
}
+ }
if ( $unearned ) {
Index: report_newtax.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_newtax.cgi,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -d -r1.3 -r1.3.4.1
--- report_newtax.cgi 26 Oct 2009 07:12:12 -0000 1.3
+++ report_newtax.cgi 10 Feb 2011 01:03:59 -0000 1.3.4.1
@@ -123,7 +123,7 @@
my $taxwhere = "FROM cust_bill_pkg $addl_from $where AND payby != 'COMP' ".
"AND ". join( ' AND ', map { "( $_ = ? OR ? = '' AND $_ IS NULL)" } @taxparam );
- my $sql = "SELECT SUM(cust_bill_pkg.setup+cust_bill_pkg.recur) ".
+ my $sql = "SELECT SUM(COALESCE(amount, cust_bill_pkg.setup+cust_bill_pkg.recur)) ".
" $taxwhere AND cust_bill_pkg.pkgnum = 0";
my $x = scalar_sql($t, [ map { $_, $_ } @params ], $sql );
More information about the freeside-commits
mailing list