}
</SCRIPT>
+% 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'},
% local $opt{'num_avail'} = $part_svc->num_avail;
<BR><% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %>
% }
-% #XXX if there's orders for this customer {
+% if ($showdidlink) {
<BR><A HREF="<%$p%>browse/did_order.html?custnum=<%$cust_pkg->custnum%>"><% mt('Browse Received DID Inventory') |h %></A>
-% #}
+% }
% }
</TD>
</TR>
-% }
+% }
+
+% } #foreach part_svc
+
+% if ($cust_pkg->get('cancel')) {
+% foreach my $svc (sort { $a->{'svcpart'} <=> $b->{'svcpart'} }
+% $cust_pkg->uncancel_svc_summary('summarize_size' => $opt{'cust_pkg-large_pkg_size'})
+% ) {
+% next unless $svc->{'reprovisionable'};
+ <TR>
+ <TD ALIGN="right" VALIGN="top"><% $svc->{'svc'} |h %></TD>
+ <TD STYLE="padding-bottom:0px; font-style: italic"><% $svc->{'label'} |h %></TD>
+ </TR>
+% }
+% }
-% }
</TABLE>
</TD>
$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)'),