1 <% include('/elements/header.html', $title ) %>
3 %# extensive false laziness with svc_acct
5 <FORM ACTION="svc_broadband.cgi" METHOD="POST">
6 <INPUT TYPE="hidden" NAME="magic" VALUE="advanced">
7 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
9 <FONT CLASS="fsinnerbox-title"><% emt('Search options') %></FONT>
10 <TABLE CLASS="fsinnerbox">
12 % unless ( $custnum ) {
13 <% include( '/elements/tr-select-agent.html',
14 'curr_value' => scalar( $cgi->param('agentnum') ),
19 <% include( '/elements/tr-select-table.html',
22 'name_col' => 'routername',
23 'curr_value' => $routernum,
25 'multiple' => 'multiple',
30 <td><input type="checkbox" name="routernum" value="none" checked> Include services with no router</td>
33 <% include( '/elements/tr-selectmultiple-part_pkg.html',
38 % if ( FS::tower_sector->count > 0 ) {
39 <& /elements/tr-select-tower_sector.html,
41 'label' => 'Tower/Sector',
50 <FONT CLASS="fsinnerbox-title"><% emt('Display options') %></FONT>
51 <TABLE CLASS="fsinnerbox">
53 % #move to /elements/tr-select-cust_pkg-fields if anything else needs it...
55 <TH ALIGN="right">Package fields</TD>
57 <SELECT NAME="cust_pkg_fields">
58 <OPTION VALUE="">(none)
59 <OPTION VALUE="setup,last_bill,bill,cancel">Setup date | Last bill date | Next bill date | Cancel date
60 <OPTION VALUE="package,setup,last_bill,bill,cancel">Package Name | Setup date | Last bill date | Next bill date | Cancel date
65 <% include( '/elements/tr-select-cust-fields.html' ) %>
70 <INPUT TYPE="submit" VALUE="Get Report">
74 <% include('/elements/footer.html') %>
78 unless $FS::CurrentUser::CurrentUser->access_right('Services: Wireless broadband services: Advanced search');
80 my $title = 'Broadband Service Report';
81 my $routernum = [ $cgi->param('routernum') || '' ];
82 $routernum = join(',', @$routernum);
84 #false laziness w/report_cust_pkg.html
86 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
88 my $cust_main = qsearchs({
89 'table' => 'cust_main',
90 'hashref' => { 'custnum' => $custnum },
91 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
92 }) or die "unknown custnum $custnum";
93 $title .= ': '. $cust_main->name;
96 # exclude one-time charges, disabled packages, and packages with no
100 WHERE freq != '0' AND disabled IS NULL AND 0 < (
101 SELECT COUNT(*) FROM part_svc JOIN pkg_svc USING ( svcpart )
102 WHERE pkg_svc.pkgpart = part_pkg.pkgpart AND part_svc.svcdb = 'svc_broadband'
103 AND pkg_svc.quantity > 0