freeside/httemplate/search report_receivables.cgi,1.18,1.19

ivan ivan at pouncequick.420.am
Wed May 18 09:55:26 PDT 2005


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory pouncequick:/tmp/cvs-serv28212/search

Modified Files:
	report_receivables.cgi 
Log Message:
add agent-specific A/R aging report, closes: bug#1229

Index: report_receivables.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_receivables.cgi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- report_receivables.cgi	15 May 2005 13:49:39 -0000	1.18
+++ report_receivables.cgi	18 May 2005 16:55:23 -0000	1.19
@@ -91,6 +91,12 @@
          )
 END
 
+  my $agentnum = '';
+  if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
+    $agentnum = $1;
+    $where .= " AND agentnum = '$agentnum' ";
+  }
+
   my $count_sql = "select count(*) from cust_main $where";
 
   my $sql_query = {
@@ -100,6 +106,10 @@
     'extra_sql' => "$where order by coalesce(lower(company), ''), lower(last)",
   };
 
+  if ( $agentnum ) {
+    $owed_cols =~
+      s/cust_bill\.custnum/cust_bill.custnum AND cust_main.agentnum = '$agentnum'/g;
+  }
   my $total_sql = "select $owed_cols";
   my $total_sth = dbh->prepare($total_sql) or die dbh->errstr;
   $total_sth->execute or die $total_sth->errstr;




More information about the freeside-commits mailing list