1 <% include('/elements/header.html', $title ) %>
3 <FORM ACTION="svc_broadband.cgi" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="advanced">
5 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
6 %# extensive false laziness with svc_acct
7 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
10 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
13 % unless ( $custnum ) {
14 <% include( '/elements/tr-select-agent.html',
15 'curr_value' => scalar( $cgi->param('agentnum') ),
20 <% include( '/elements/tr-select-table.html',
23 'name_col' => 'routername',
24 'curr_value' => $routernum,
26 'multiple' => 'multiple',
31 <% include( '/elements/tr-selectmultiple-part_pkg.html',
37 <TH CLASS="background" COLSPAN=2> </TH>
41 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
44 % #move to /elements/tr-select-cust_pkg-fields if anything else needs it...
46 <TD ALIGN="right">Package fields</TD>
48 <SELECT NAME="cust_pkg_fields">
49 <OPTION VALUE="">(none)
50 <OPTION VALUE="setup,last_bill,bill,cancel">Setup date | Last bill date | Next bill date | Cancel date
55 <% include( '/elements/tr-select-cust-fields.html' ) %>
60 <INPUT TYPE="submit" VALUE="Get Report">
64 <% include('/elements/footer.html') %>
68 unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?
70 my $title = 'Broadband Service Report';
71 my $routernum = [ $cgi->param('routernum') || '' ];
72 $routernum = join(',', @$routernum);
74 #false laziness w/report_cust_pkg.html
76 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
78 my $cust_main = qsearchs({
79 'table' => 'cust_main',
80 'hashref' => { 'custnum' => $custnum },
81 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
82 }) or die "unknown custnum $custnum";
83 $title .= ': '. $cust_main->name;
86 # exclude one-time charges, disabled packages, and packages with no
90 WHERE freq != '0' AND disabled IS NULL AND 0 < (
91 SELECT COUNT(*) FROM part_svc JOIN pkg_svc USING ( svcpart )
92 WHERE pkg_svc.pkgpart = part_pkg.pkgpart AND part_svc.svcdb = 'svc_broadband'
93 AND pkg_svc.quantity > 0