add waive setup fee upon package order feature, RT12568
[freeside.git] / httemplate / misc / order_pkg.html
index 233262a..4f511cc 100644 (file)
@@ -5,33 +5,7 @@
 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
 
-<SCRIPT TYPE="text/javascript">
-
-  function enable_order_pkg () {
-    if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
-      document.OrderPkgForm.submitButton.disabled = false;
-      if ( document.OrderPkgForm.pkgpart.options[document.OrderPkgForm.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) {
-        document.OrderPkgForm.discountnum.disabled = false;
-      } else {
-        document.OrderPkgForm.discountnum.disabled = true;
-      }
-    } else {
-      document.OrderPkgForm.submitButton.disabled = true;
-      document.OrderPkgForm.discountnum.disabled = true;
-    }
-  }
-
-  function standardize_new_location() {
-    var form = document.OrderPkgForm;
-    var loc = form.locationnum;
-    if (loc.type = 'select-one' && loc.options[loc.selectedIndex].value == -1) {
-      standardize_locations();
-    } else {
-      form.submit();
-    }
-  }
-
-</SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="../elements/order_pkg.js"></SCRIPT>
 
 <% include('/elements/error.html') %>
 
   %>
 % }
 
+% if ( $curuser->access_right('Waive setup fee') ) {
+    <TR>
+      <TH ALIGN="right">Waive setup fee </TH>
+      <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="waive_setup" VALUE="Y"></TD>
+    </TR>
+% }
+
 % if ( $conf->exists('pkg_referral') ) {
   <% include('/elements/tr-select-part_referral.html',
                'curr_value'    => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum,
 % my $onclick = $cgi->param('lock_locationnum')
 %                 ? 'document.OrderPkgForm.submit()'
 %                 : 'standardize_new_location()';
-<INPUT NAME="submitButton"
-       TYPE="button"
-       VALUE="Order Package"
+<INPUT NAME    = "submitButton"
+       TYPE    = "button"
+       VALUE   = "Order Package"
        onClick = "this.disabled=true; <% $onclick %>;"
        <% $pkgpart ? '' : 'DISABLED' %>
 >