X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fservices.html;h=a23a4c2fefd9d1ad3a0d7c8ae6691a2129df323a;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hp=5fe41a38cc803eb37aa48115b20bdd79b77fb942;hpb=4d364d506c717b1b73858dd287413d3788ec586d;p=freeside.git diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 5fe41a38c..a23a4c2fe 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -10,6 +10,7 @@ function clearhint_search_cust_svc(obj, str) { } +% my $showdidlink = browse_received_did_inventory($cust_pkg->custnum); % foreach my $part_svc ( % $cust_pkg->part_svc( % 'summarize_size' => $opt{'cust_pkg-large_pkg_size'}, @@ -97,16 +98,32 @@ function clearhint_search_cust_svc(obj, str) { % local $opt{'num_avail'} = $part_svc->num_avail;
<% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %> % } -% #XXX if there's orders for this customer { +% if ($showdidlink) {
<% mt('Browse Received DID Inventory') |h %> -% #} +% } % } -% } +% } + +% } #foreach part_svc + +% if ($cust_pkg->get('cancel')) { +% foreach my $svc ( +% $cust_pkg->uncancel_svc_summary('summarize_size' => $opt{'cust_pkg-large_pkg_size'}, 'no_test_reprovision' => 1) +% ) { + + <% $svc->{'svc'} |h %> + + <% $svc->{'num_cust_svc'} + ? $svc->{'num_cust_svc'} . ' ' . emt('services in history') + : (defined($svc->{'label'}) ? $svc->{'label'} : emt('(cannot load svc label)')) |h %> + + +% } +% } -% } @@ -170,6 +187,21 @@ sub svc_provision_link { $link; } +sub browse_received_did_inventory { + local($FS::Record::qsearch_qualify_columns) = 1; + qsearch({ + 'table' => 'did_order', + 'hashref' => { 'custnum' => $_[0] }, + 'extra_sql' => ' LIMIT 1' + }) || + qsearch({ + 'table' => 'did_order_item', + 'hashref' => { 'custnum' => $_[0] }, + 'addl_from' => ' INNER JOIN did_order ON did_order_item.ordernum = did_order.ordernum', + 'extra_sql' => ' LIMIT 1' + }); +} + my %hints = ( svc_acct => emt('(user or email)'), svc_domain => emt('(domain)'),