summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-01-23 13:06:32 -0600
committerJonathan Prykop <jonathan@freeside.biz>2015-01-23 13:06:32 -0600
commit0c8c5a5727dda5f8e5cf6f999d5b671a77556c6a (patch)
tree6b0efb64dd0d51985f5af5791cda6a7c9fb2269a /httemplate
parent3a8fa4f27ef08792e3d653cee167979a411f89d1 (diff)
RT 32226, only displaying DID order link if customer has DID order
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/view/cust_main/packages/services.html17
1 files changed, 15 insertions, 2 deletions
diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html
index 5fe41a38c..fa193d636 100644
--- a/httemplate/view/cust_main/packages/services.html
+++ b/httemplate/view/cust_main/packages/services.html
@@ -97,9 +97,22 @@ function clearhint_search_cust_svc(obj, str) {
% 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 (
+% qsearch({
+% 'table' => 'did_order',
+% 'hashref' => { 'custnum' => $cust_pkg->custnum },
+% 'extra_sql' => ' LIMIT 1'
+% })
+% ||
+% qsearch({
+% 'table' => 'did_order_item',
+% 'hashref' => { 'custnum' => $cust_pkg->custnum },
+% 'addl_from' => ' INNER JOIN did_order ON did_order_item.ordernum = did_order.ordernum',
+% 'extra_sql' => ' LIMIT 1'
+% })
+% ) {
<BR><A HREF="<%$p%>browse/did_order.html?custnum=<%$cust_pkg->custnum%>"><% mt('Browse Received DID Inventory') |h %></A>
-% #}
+% }
% }
</TD>
</TR>