5 <& elements/report_svc_Common.html,
8 'table' => 'svc_something',
9 'title' => 'Page title',
12 'action' => 'svc_tablename.html', #defaults to svc_tablename.html
17 <& /elements/header.html, $title &>
19 <FORM ACTION="<% $opt{'action'} || $opt{'table'}. '.html' %>" METHOD="GET">
20 <INPUT TYPE="hidden" NAME="magic" VALUE="advanced">
21 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
23 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
26 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Search options') |h %></FONT></TH>
29 % unless ( $custnum ) {
31 <& /elements/tr-select-agent.html,
32 curr_value => scalar( $cgi->param('agentnum') ),
36 <& /elements/tr-select-cust_main-status.html,
37 label => 'Customer Status',
38 field => 'cust_status',
41 <& /elements/tr-select-payby.html,
42 label => emt('Payment method:'),
48 <& /elements/tr-input-money.html,
49 label => 'Balance over',
53 <& /elements/tr-input-text.html,
54 label => 'Balance age (days)',
55 field => 'balance_days',
61 % # just this customer's domains?
62 %# <& /elements/tr-select-domain.html,
63 %# 'element_name' => 'domsvc',
64 %# 'curr_value' => scalar( $cgi->param('domsvc') ),
65 %# 'disable_empty' => 0,
68 <& /elements/tr-selectmultiple-part_pkg.html &>
70 <& /elements/tr-select-part_svc.html,
72 'label' => 'Services',
76 <TH CLASS="background" COLSPAN=2> </TH>
80 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
83 % #"package fields" ala advanced svc_acct search?
84 % #move to /elements/tr-select-cust_pkg-fields and use it from there if so...
86 <& /elements/tr-select-cust-fields.html &>
91 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
95 <& /elements/footer.html &>
100 my $svcdb = $opt{'table'};
102 my $name = "FS::$svcdb"->table_info->{'name_plural'}
103 || PL( "FS::$svcdb"->table_info->{'name'} );
106 unless $FS::CurrentUser::CurrentUser->access_right("Services: $name: Advanced search");
108 my $title = $opt{'title'};
110 #false laziness w/report_cust_pkg.html
111 my( $custnum, $cust_main) = ('', '');
112 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
114 my $cust_main = qsearchs({
115 'table' => 'cust_main',
116 'hashref' => { 'custnum' => $custnum },
117 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
118 }) or die "unknown custnum $custnum";
119 $title = mt("$title: [_1]", $cust_main->name);