[freeside-commits] freeside/httemplate/search cust_event.html, 1.1, 1.2 report_tax.cgi, 1.35, 1.36

Ivan,,, ivan at wavetail.420.am
Fri Sep 28 19:17:50 PDT 2007


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv1047/httemplate/search

Modified Files:
	cust_event.html report_tax.cgi 
Log Message:
fix ambiguous agentnum errors in cust_event.html & report_tax.cgi (provide a table option in access_user::agentnums_sql so this is easy to fix for other reports too)

Index: report_tax.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_tax.cgi,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- report_tax.cgi	22 May 2007 00:34:17 -0000	1.35
+++ report_tax.cgi	29 Sep 2007 02:17:48 -0000	1.36
@@ -226,7 +226,7 @@
   my $agent = qsearchs('agent', { 'agentnum' => $1 } );
   die "agent not found" unless $agent;
   $agentname = $agent->agent;
-  $where .= ' AND agentnum = '. $agent->agentnum;
+  $where .= ' AND cust_main.agentnum = '. $agent->agentnum;
 }
 
 my $gotcust = "

Index: cust_event.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_event.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_event.html	1 Aug 2007 22:26:45 -0000	1.1
+++ cust_event.html	29 Sep 2007 02:17:48 -0000	1.2
@@ -151,7 +151,7 @@
 my @search = ();
 
 if ( $cgi->param('agentnum') && $cgi->param('agentnum') =~ /^(\d+)$/ ) {
-  push @search, "agentnum = $1";
+  push @search, "cust_main.agentnum = $1";
   #my $agent = qsearchs('agent', { 'agentnum' => $1 } );
   #die "unknown agentnum $1" unless $agent;
 }
@@ -183,9 +183,7 @@
 }
 
 #here is the agent virtualization
-my $agent_sql = $curuser->agentnums_sql;
-$agent_sql =~ s/agentnum/cust_main.agentnum/g;
-push @search, $agent_sql;
+push @search, $curuser->agentnums_sql( 'table' => 'cust_main' );
 
 my $where = 'WHERE '. join(' AND ', @search );
 



More information about the freeside-commits mailing list