[freeside-commits] freeside/httemplate/search report_svc_acct.html, 1.5, 1.6 cust_bill.html, 1.34, 1.35 cust_bill_event.cgi, 1.17, 1.18 cust_event.html, 1.7, 1.8 477.html, 1.3, 1.4 cust_pkg.cgi, 1.60, 1.61 cust_main.html, 1.18, 1.19
Ivan,,,
ivan at wavetail.420.am
Thu Dec 3 20:40:29 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv29572/httemplate/search
Modified Files:
report_svc_acct.html cust_bill.html cust_bill_event.cgi
cust_event.html 477.html cust_pkg.cgi cust_main.html
Log Message:
customer-specific account report (and some small refactoring of method names to clash less), RT#6180
Index: cust_main.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_main.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cust_main.html 14 Nov 2009 00:08:13 -0000 1.18
+++ cust_main.html 4 Dec 2009 04:40:27 -0000 1.19
@@ -84,7 +84,7 @@
# etc
###
-my $sql_query = FS::cust_main->search_sql(\%search_hash);
+my $sql_query = FS::cust_main->search(\%search_hash);
my $count_query = delete($sql_query->{'count_query'});
my @extra_headers = @{ delete($sql_query->{'extra_headers'}) };
my @extra_fields = @{ delete($sql_query->{'extra_fields'}) };
Index: cust_event.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_event.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cust_event.html 30 Oct 2009 23:29:18 -0000 1.7
+++ cust_event.html 4 Dec 2009 04:40:27 -0000 1.8
@@ -173,7 +173,7 @@
$search{'beginning'} = $beginning;
$search{'ending'} = $ending;
-my $where = ' WHERE '. FS::cust_event->search_sql( \%search );
+my $where = ' WHERE '. FS::cust_event->search_sql_where( \%search );
my $join = FS::cust_event->join_sql();
Index: cust_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_event.cgi,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cust_bill_event.cgi 13 Jan 2008 20:57:36 -0000 1.17
+++ cust_bill_event.cgi 4 Dec 2009 04:40:27 -0000 1.18
@@ -96,7 +96,7 @@
$search{invnum} = $1;
}
-my $where = 'WHERE '. FS::cust_bill_event->search_sql( \%search );
+my $where = 'WHERE '. FS::cust_bill_event->search_sql_where( \%search );
my $join = 'LEFT JOIN part_bill_event USING ( eventpart ) '.
'LEFT JOIN cust_bill USING ( invnum ) '.
Index: 477.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/477.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- 477.html 1 Nov 2009 22:12:55 -0000 1.3
+++ 477.html 4 Dec 2009 04:40:27 -0000 1.4
@@ -106,7 +106,7 @@
if $column_option_name{$column};
my $report_option = join(',', @report_option) if @report_option;
- my $sql_query = FS::cust_pkg->search_sql(
+ my $sql_query = FS::cust_pkg->search(
{ %search_hash,
($report_option ? ( 'report_option' => $report_option ) : () ),
}
Index: cust_bill.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill.html,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- cust_bill.html 16 Nov 2009 03:55:18 -0000 1.34
+++ cust_bill.html 4 Dec 2009 04:40:27 -0000 1.35
@@ -123,7 +123,7 @@
$count_query = "SELECT COUNT(DISTINCT cust_bill.custnum), 'N/A', 'N/A'";
}
- my $extra_sql = ' WHERE '. FS::cust_bill->search_sql( \%search );
+ my $extra_sql = ' WHERE '. FS::cust_bill->search_sql_where( \%search );
unless ( $count_query ) {
$count_query = 'SELECT COUNT(*), '. join(', ',
Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pkg.cgi,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- cust_pkg.cgi 28 Oct 2009 06:13:24 -0000 1.60
+++ cust_pkg.cgi 4 Dec 2009 04:40:27 -0000 1.61
@@ -204,7 +204,7 @@
}
-my $sql_query = FS::cust_pkg->search_sql(\%search_hash);
+my $sql_query = FS::cust_pkg->search(\%search_hash);
my $count_query = delete($sql_query->{'count_query'});
my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/
Index: report_svc_acct.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_svc_acct.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- report_svc_acct.html 24 Jan 2009 21:04:17 -0000 1.5
+++ report_svc_acct.html 4 Dec 2009 04:40:27 -0000 1.6
@@ -1,7 +1,8 @@
-<% include('/elements/header.html', 'Account Report' ) %>
+<% include('/elements/header.html', $title ) %>
<FORM ACTION="svc_acct.cgi" METHOD="GET">
<INPUT TYPE="hidden" NAME="magic" VALUE="advanced">
+<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
@@ -9,19 +10,21 @@
<TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
</TR>
+% unless ( $custnum ) {
<% include( '/elements/tr-select-agent.html',
'curr_value' => scalar( $cgi->param('agentnum') ),
'disable_empty' => 0,
)
%>
+% # just this customer's domains?
<% include( '/elements/tr-select-domain.html',
'element_name' => 'domsvc',
'curr_value' => scalar( $cgi->param('domsvc') ),
'disable_empty' => 0,
)
%>
-
+% }
<SCRIPT type="text/javascript">
function toggle(what) {
@@ -92,7 +95,21 @@
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('List packages');
+ unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?
+
+my $title = 'Account Report';
+
+#false laziness w/report_cust_pkg.html
+my $custnum = '';
+if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+ $custnum = $1;
+ my $cust_main = qsearchs({
+ 'table' => 'cust_main',
+ 'hashref' => { 'custnum' => $custnum },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+ }) or die "unknown custnum $custnum";
+ $title .= ': '. $cust_main->name;
+}
</%init>
<%once>
More information about the freeside-commits
mailing list