X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_svc_broadband.html;fp=httemplate%2Fsearch%2Freport_svc_broadband.html;h=8571ef1849381867f75a2de74cbf40dcaefdb115;hp=0000000000000000000000000000000000000000;hb=6c9cd1c36adbb9fc950fcf0a0b269fa6f16838a1;hpb=853fca259ec006d4a5f3ce046e5334210412baac diff --git a/httemplate/search/report_svc_broadband.html b/httemplate/search/report_svc_broadband.html new file mode 100755 index 000000000..8571ef184 --- /dev/null +++ b/httemplate/search/report_svc_broadband.html @@ -0,0 +1,100 @@ +<% include('/elements/header.html', $title ) %> + +
+ +<% include('/elements/footer.html') %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #? + +my $title = 'Broadband Service Report'; +my $routernum = [ $cgi->param('routernum') || '' ]; +$routernum = join(',', @$routernum); + +#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; +} + +# exclude one-time charges, disabled packages, and packages with no +# broadband services +my %pkg_search = ( + 'extra_sql' => " +WHERE freq != '0' AND disabled IS NULL AND 0 < ( + SELECT COUNT(*) FROM part_svc JOIN pkg_svc USING ( svcpart ) + WHERE pkg_svc.pkgpart = part_pkg.pkgpart AND part_svc.svcdb = 'svc_broadband' + AND pkg_svc.quantity > 0 +)", +); + +%init> +<%once> + +%once>