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 <FONT CLASS="fsinnerbox-title"><% emt('Search options') %></FONT>
24 <TABLE CLASS="fsinnerbox">
26 % unless ( $custnum ) {
28 <& /elements/tr-select-agent.html,
29 curr_value => scalar( $cgi->param('agentnum') ),
33 <& /elements/tr-select-cust_main-status.html,
34 label => 'Customer Status',
35 field => 'cust_status',
38 %# meaning-less in the post-4.x world, customers can have multiple payment
41 %# <& /elements/tr-select-payby.html,
42 %# label => emt('Payment method:'),
43 %# payby_type => 'cust',
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',
78 <FONT CLASS="fsinnerbox-title"><% emt('Display options') %></FONT>
79 <TABLE CLASS="fsinnerbox">
81 % #"package fields" ala advanced svc_acct search?
82 % #move to /elements/tr-select-cust_pkg-fields and use it from there if so...
84 <& /elements/tr-select-cust-fields.html &>
89 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
93 <& /elements/footer.html &>
98 my $svcdb = $opt{'table'};
100 my $name = "FS::$svcdb"->table_info->{'name_plural'}
101 || PL( "FS::$svcdb"->table_info->{'name'} );
104 unless $FS::CurrentUser::CurrentUser->access_right("Services: $name: Advanced search");
106 my $title = $opt{'title'};
108 #false laziness w/report_cust_pkg.html
109 my( $custnum, $cust_main) = ('', '');
110 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
112 my $cust_main = qsearchs({
113 'table' => 'cust_main',
114 'hashref' => { 'custnum' => $custnum },
115 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
116 }) or die "unknown custnum $custnum";
117 $title = mt("$title: [_1]", $cust_main->name);