add Net 3 terms, RT#11641
[freeside.git] / httemplate / misc / order_pkg.html
index 8479a75..dcbc016 100644 (file)
@@ -9,14 +9,14 @@
 
   function enable_order_pkg () {
     if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
-      document.OrderPkgForm.submit.disabled = false;
+      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.submit.disabled = true;
+      document.OrderPkgForm.submitButton.disabled = true;
       document.OrderPkgForm.discountnum.disabled = true;
     }
   }
@@ -28,6 +28,9 @@
 <FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/quick-cust_pkg.cgi" METHOD="POST">
 
 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>">
+% if ( $svcpart ) {
+    <INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
+% }
 
 <% ntable("#cccccc", 2) %>
 <% include('/elements/tr-select-cust-part_pkg.html',
           )
 %>
 
-%# false laziness w/edit/quick-charge.html
 <TR>
   <TH ALIGN="right">Start date </TD>
   <TD COLSPAN=6>
-    <INPUT TYPE  = "text"
-           NAME  = "start_date"
-           SIZE  = 32
-           ID    = "start_date_text"
-           VALUE = "<% $start_date %>"
-    >
-    <IMG SRC   = "../images/calendar.png"
-         ID    = "start_date_button"
-         STYLE = "cursor: pointer"
-         TITLE = "Select date"
-    >
+    <% include('/elements/input-date-field.html',{
+                'name'      => 'start_date',
+                'format'    => $date_format,
+                'value'     => $start_date,
+                'noinit'    => 1,
+              }) %>
     <FONT SIZE=-1>(leave blank to start immediately)</FONT>
   </TD>
 </TR>
 
-<SCRIPT TYPE="text/javascript">
-  Calendar.setup({
-    inputField: "start_date_text",
-    ifFormat:   "<% $date_format %>",
-    button:     "start_date_button",
-    align:      "BR"
-  });
-</SCRIPT>
-
 % if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) {
 %   my $what = lc(FS::payby->shortname($cust_main->payby));
     <TR>
           )
 %>
 
+<TR>
+  <TH ALIGN="right">Contract end date </TD>
+  <TD COLSPAN=6>
+    <% include('/elements/input-date-field.html',{
+                'name'      => 'contract_end',
+                'format'    => $date_format,
+                'value'     => '',
+                'noinit'    => 1,
+                }) %>
+  </TD>
+</TR>
+
 </TABLE>
 
+<% include( '/elements/standardize_locations.html',
+            'form'       => "OrderPkgForm",
+            'onlyship'   => 1,
+            'no_company' => 1,
+            'callback'   => 'document.OrderPkgForm.submit();',
+          )
+%>
+
 <BR>
-<INPUT NAME="submit" TYPE="submit" VALUE="Order Package" <% $pkgpart ? '' : 'DISABLED' %>>
+<INPUT NAME="submitButton" TYPE="button" VALUE="Order Package" onClick = "this.disabled=true; standardize_locations();" <% $pkgpart ? '' : 'DISABLED' %>>
 
 </FORM>
 </BODY>
@@ -134,4 +142,6 @@ if( ! $conf->exists('order_pkg-no_start_date') ) {
   $start_date = $start_date ? time2str($format, $start_date) : '';
 }
 
+my $svcpart = $cgi->param('svcpart');
+
 </%init>