[freeside-commits] freeside/httemplate/search cust_pay.cgi, 1.24,
1.25 cust_credit.html, 1.8, 1.9 report_receivables.cgi, 1.24, 1.25
Ivan,,,
ivan at wavetail.420.am
Wed Jul 12 20:54:09 PDT 2006
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv11714/httemplate/search
Modified Files:
cust_pay.cgi cust_credit.html report_receivables.cgi
Log Message:
fix multiple-agent virtualization properly for these reports
Index: cust_credit.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_credit.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cust_credit.html 5 Aug 2005 00:57:59 -0000 1.8
+++ cust_credit.html 13 Jul 2006 03:54:07 -0000 1.9
@@ -36,9 +36,10 @@
push @search, " _date < $1 ";
}
- my $where = scalar(@search)
- ? 'WHERE '. join(' AND ', @search)
- : '';
+ #here is the agent virtualization
+ push @search, $FS::CurrentUser::CurrentUser->agentnums_sql;
+
+ my $where = 'WHERE '. join(' AND ', @search);
my $count_query = 'SELECT COUNT(*), SUM(amount) '.
'FROM cust_credit LEFT JOIN cust_main USING ( custnum ) '.
Index: cust_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pay.cgi,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cust_pay.cgi 21 Nov 2005 10:47:12 -0000 1.24
+++ cust_pay.cgi 13 Jul 2006 03:54:07 -0000 1.25
@@ -96,10 +96,10 @@
die "unknown search magic: ". $cgi->param('magic');
}
- my $search = '';
- if ( @search ) {
- $search = ' WHERE '. join(' AND ', @search);
- }
+ #here is the agent virtualization
+ push @search, $FS::CurrentUser::CurrentUser->agentnums_sql;
+
+ my $search = ' WHERE '. join(' AND ', @search);
$count_query = "SELECT COUNT(*), SUM(paid) ".
"FROM cust_pay LEFT JOIN cust_main USING ( custnum )".
@@ -125,14 +125,16 @@
$cgi->param('payby') =~ /^(\w+)$/ or die "illegal payby";
my $payby = $1;
- $count_query = "SELECT COUNT(*), SUM(paid) FROM cust_pay ".
- "WHERE payinfo = '$payinfo' AND payby = '$payby'";
+ $count_query = "SELECT COUNT(*), SUM(paid) FROM cust_pay".
+ " WHERE payinfo = '$payinfo' AND payby = '$payby'".
+ " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql;
$sql_query = {
'table' => 'cust_pay',
'hashref' => { 'payinfo' => $payinfo,
'payby' => $payby },
- 'extra_sql' => "ORDER BY _date",
+ 'extra_sql' => $FS::CurrentUser::CurrentUser->agentnums_sql.
+ " ORDER BY _date",
};
}
Index: report_receivables.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_receivables.cgi,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- report_receivables.cgi 12 May 2006 13:57:23 -0000 1.24
+++ report_receivables.cgi 13 Jul 2006 03:54:07 -0000 1.25
@@ -92,6 +92,9 @@
$where .= " AND agentnum = '$agentnum' ";
}
+ #here is the agent virtualization
+ $where .= ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql;
+
my $count_sql = "select count(*) from cust_main $where";
my $sql_query = {
More information about the freeside-commits
mailing list