summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/edit/cust_pkg_discount.html2
-rw-r--r--httemplate/elements/tr-select-discount.html8
2 files changed, 10 insertions, 0 deletions
diff --git a/httemplate/edit/cust_pkg_discount.html b/httemplate/edit/cust_pkg_discount.html
index 0bb84b8f2..e814c96c5 100755
--- a/httemplate/edit/cust_pkg_discount.html
+++ b/httemplate/edit/cust_pkg_discount.html
@@ -30,6 +30,7 @@
'empty_label' => ( $pkgdiscountnum ? '' : 'Select discount' ),
'onchange' => 'enable_discount_pkg()',
'cgi' => $cgi,
+ 'setup_only' => $setup_only,
)
%>
@@ -72,5 +73,6 @@ my $cust_pkg =
# " ( pkgnum ". cust_pkg->pkgnum. ")";
my $part_pkg = $cust_pkg->part_pkg;
+my $setup_only = ($part_pkg->freq eq '0') ? 1 : 0;
</%init>
diff --git a/httemplate/elements/tr-select-discount.html b/httemplate/elements/tr-select-discount.html
index ee862519f..faa65e1f7 100644
--- a/httemplate/elements/tr-select-discount.html
+++ b/httemplate/elements/tr-select-discount.html
@@ -53,6 +53,13 @@
)
%>
+% if ( $opt{'setup_only'} ) {
+ <& /elements/hidden.html,
+ 'field' => $name.'_setup',
+ 'id' => $name.'_setup',
+ 'value' => 'Y'
+ &>
+% } else { # normal case, allow the user to choose
<% include( '/elements/tr-input-text.html',
'label' => '<B>Discount duration (months)</B>',
'field' => $name. '_months',
@@ -73,6 +80,7 @@
'colspan' => $opt{'colspan'},
)
%>
+% }
%# <% include( '/elements/tr-checkbox.html',
%# 'label' => '<B>Apply discount to add-on packages</B>',