X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Funprovisioned_services.html;h=0ef1ff633a4baec782f2b86dc1c1c399e4dae675;hp=f85e4fb19ddb89bc4615307509f163a476d159c1;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984 diff --git a/httemplate/search/unprovisioned_services.html b/httemplate/search/unprovisioned_services.html index f85e4fb19..0ef1ff633 100644 --- a/httemplate/search/unprovisioned_services.html +++ b/httemplate/search/unprovisioned_services.html @@ -1,4 +1,4 @@ -<% include( 'elements/search.html', +<& elements/search.html, 'title' => 'Unprovisioned Service Search Results', 'name' => 'packages with unprovisioned services', 'query' => { @@ -54,8 +54,8 @@ '', FS::UI::Web::cust_styles(), ], - ) -%> + +&> <%init> die "access denied" @@ -69,12 +69,16 @@ foreach my $svcpart ( @svcpart ) { $svcpart_limit = " and pkg_svc.svcpart in (". join(',',@svcpart) . ")" if scalar(@svcpart); +## here is the agent virtualization +my $agentnums_sql = $FS::CurrentUser::CurrentUser->agentnums_sql; + my $search = " where cust_pkg.cancel is null and pkg_svc.quantity > 0 and " . " pkg_svc.quantity > (select count(1) from cust_svc where " . " cust_svc.pkgnum = cust_pkg.pkgnum and " - . " cust_svc.svcpart = pkg_svc.svcpart) $svcpart_limit"; + . " cust_svc.svcpart = pkg_svc.svcpart) $svcpart_limit and $agentnums_sql"; -my $addl_from = " join pkg_svc using (pkgpart) join cust_main using (custnum) "; +my $addl_from = " join pkg_svc using (pkgpart) ". + FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg'); # this was very painful to derive but it appears correct #select cust_pkg.custnum,cust_pkg.pkgpart,cust_pkg.pkgnum, pkg_svc.svcpart from cust_pkg join