[freeside-commits] freeside/httemplate/search svc_acct.cgi, 1.33,
1.34 svc_forward.cgi, 1.6, 1.7
Ivan,,,
ivan at wavetail.420.am
Thu Jul 14 04:31:37 PDT 2005
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv8901/httemplate/search
Modified Files:
svc_acct.cgi svc_forward.cgi
Log Message:
add unlinked mail forward (svc_forward) report
Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/svc_acct.cgi,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- svc_acct.cgi 14 Jul 2005 10:52:46 -0000 1.33
+++ svc_acct.cgi 14 Jul 2005 11:31:35 -0000 1.34
@@ -94,10 +94,10 @@
FS::UI::Web::cust_sql_fields(),
),
'extra_sql' => "$extra_sql $orderby",
- 'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum ) '.
- 'LEFT JOIN part_svc USING ( svcpart ) '.
- 'LEFT JOIN cust_pkg USING ( pkgnum ) '.
- 'LEFT JOIN cust_main USING ( custnum ) ',
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN part_svc USING ( svcpart ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
};
my $link = [ "${p}view/svc_acct.cgi?", 'svcnum' ];
Index: svc_forward.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/svc_forward.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- svc_forward.cgi 14 Jul 2005 10:52:46 -0000 1.6
+++ svc_forward.cgi 14 Jul 2005 11:31:35 -0000 1.7
@@ -4,14 +4,30 @@
my($query)=$cgi->keywords;
$query ||= ''; #to avoid use of unitialized value errors
+
+
my $orderby;
+
+my $cjoin = '';
+my @extra_sql = ();
+if ( $query =~ /^UN_(.*)$/ ) {
+ $query = $1;
+ $cjoin = 'LEFT JOIN cust_svc USING ( svcnum )';
+ push @extra_sql, 'pkgnum IS NULL';
+}
+
if ( $query eq 'svcnum' ) {
$orderby = 'ORDER BY svcnum';
} else {
eidiot('unimplemented');
}
-my $count_query = 'SELECT COUNT(*) FROM svc_forward';
+my $extra_sql =
+ scalar(@extra_sql)
+ ? ' WHERE '. join(' AND ', @extra_sql )
+ : '';
+
+my $count_query = "SELECT COUNT(*) FROM svc_forward $cjoin $extra_sql";
my $sql_query = {
'table' => 'svc_forward',
'hashref' => {},
@@ -20,10 +36,11 @@
'cust_main.custnum',
FS::UI::Web::cust_sql_fields(),
),
- 'extra_sql' => $orderby,
- 'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum )'.
- 'LEFT JOIN cust_pkg USING ( pkgnum )'.
- 'LEFT JOIN cust_main USING ( custnum )',
+ 'extra_sql' => "$extra_sql $orderby",
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN part_svc USING ( svcpart ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
};
# <TH>Service #<BR><FONT SIZE=-1>(click to view forward)</FONT></TH>
More information about the freeside-commits
mailing list