X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_newtax.cgi;fp=httemplate%2Fsearch%2Freport_newtax.cgi;h=78514624c9c5f06b4a1da95a3479790ab52e9131;hb=64ccb0c8d26c387b323fb34e671b34c62d2c0c81;hp=6a2cbb0d18e59ee1dc474ed879f8e0c460cb9218;hpb=83b363898f0f95a4e85d44b88cba2f0751c27361;p=freeside.git diff --git a/httemplate/search/report_newtax.cgi b/httemplate/search/report_newtax.cgi index 6a2cbb0d1..78514624c 100755 --- a/httemplate/search/report_newtax.cgi +++ b/httemplate/search/report_newtax.cgi @@ -123,7 +123,7 @@ foreach my $t (qsearch({ table => 'cust_bill_pkg', 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 );