diff options
author | ivan <ivan> | 2009-12-04 04:40:28 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-12-04 04:40:28 +0000 |
commit | cf49d3c860a2000cfc23a0e0db472a7d6fc58935 (patch) | |
tree | d3fa44471ab7c004f06c09ca71747b77992aa9ce /httemplate/search | |
parent | 051abf85ce0cad902a6c2b0d24a6f90d4e7c5147 (diff) |
customer-specific account report (and some small refactoring of method names to clash less), RT#6180
Diffstat (limited to 'httemplate/search')
-rwxr-xr-x | httemplate/search/477.html | 2 | ||||
-rwxr-xr-x | httemplate/search/cust_bill.html | 2 | ||||
-rw-r--r-- | httemplate/search/cust_bill_event.cgi | 2 | ||||
-rw-r--r-- | httemplate/search/cust_event.html | 2 | ||||
-rwxr-xr-x | httemplate/search/cust_main.html | 2 | ||||
-rwxr-xr-x | httemplate/search/cust_pkg.cgi | 2 | ||||
-rwxr-xr-x | httemplate/search/report_svc_acct.html | 23 |
7 files changed, 26 insertions, 9 deletions
diff --git a/httemplate/search/477.html b/httemplate/search/477.html index b48516137..0f1502f2a 100755 --- a/httemplate/search/477.html +++ b/httemplate/search/477.html @@ -106,7 +106,7 @@ foreach my $row ( sort keys %row_option_name ) { 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 ) : () ), } diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index 2f6bd9cc9..6db6006cb 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -123,7 +123,7 @@ if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) { $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(', ', diff --git a/httemplate/search/cust_bill_event.cgi b/httemplate/search/cust_bill_event.cgi index ff4168d6d..16c9acdc7 100644 --- a/httemplate/search/cust_bill_event.cgi +++ b/httemplate/search/cust_bill_event.cgi @@ -96,7 +96,7 @@ if ( $cgi->param('invnum') =~ /^(\d+)$/ ) { $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 ) '. diff --git a/httemplate/search/cust_event.html b/httemplate/search/cust_event.html index b22644efe..a0429e44f 100644 --- a/httemplate/search/cust_event.html +++ b/httemplate/search/cust_event.html @@ -173,7 +173,7 @@ my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi); $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(); diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index a1693b87d..644e0932a 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -84,7 +84,7 @@ $search_hash{'current_balance'} = # 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'}) }; diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 37e8d6c5f..ff8ee5742 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -204,7 +204,7 @@ foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { } -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)$/ diff --git a/httemplate/search/report_svc_acct.html b/httemplate/search/report_svc_acct.html index 59fd1f8b3..ee913c4f9 100755 --- a/httemplate/search/report_svc_acct.html +++ b/httemplate/search/report_svc_acct.html @@ -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> |