From: ivan Date: Tue, 15 Sep 2009 20:45:46 +0000 (+0000) Subject: fix phone# usage search, RT# X-Git-Tag: root_of_svc_elec_features~861 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=0681cc7e7224bf00988d7851c233dca6a2b0d5d7 fix phone# usage search, RT# --- diff --git a/httemplate/search/svc_phone.cgi b/httemplate/search/svc_phone.cgi index 6ee7d1d07..21e1a9233 100644 --- a/httemplate/search/svc_phone.cgi +++ b/httemplate/search/svc_phone.cgi @@ -81,8 +81,8 @@ if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) { $redirect = ''; - my $and_date = " AND startdate >= $beginning ". - " AND startdate <= $ending "; + #my $and_date = " AND startdate >= $beginning AND startdate <= $ending "; + my $and_date = " AND enddate >= $beginning AND enddate <= $ending "; my $fromwhere = " FROM cdr WHERE cdr.svcnum = svc_phone.svcnum $and_date"; @@ -106,7 +106,7 @@ if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) { $and_date; push @select, - " ( SELECT SUM(billsec) $f_w ) AS term_billsec ". + " ( SELECT SUM(billsec) $f_w ) AS term_billsec ", " ( SELECT SUM(cdr_termination.rated_price) $f_w ) AS term_rated_price"; push @header, 'Term Min', 'Term Billed'; @@ -157,8 +157,9 @@ my $sql_query = { 'select' => join(', ', 'svc_phone.*', 'part_svc.svc', - 'cust_main.custnum', - FS::UI::Web::cust_sql_fields(), + @select, + 'cust_main.custnum', + FS::UI::Web::cust_sql_fields(), ), 'extra_sql' => "$extra_sql $orderby", 'addl_from' => $addl_from,