summaryrefslogtreecommitdiff
path: root/httemplate/misc/order_pkg.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/order_pkg.html')
-rw-r--r--httemplate/misc/order_pkg.html60
1 files changed, 34 insertions, 26 deletions
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html
index 33b2bb3..b232deb 100644
--- a/httemplate/misc/order_pkg.html
+++ b/httemplate/misc/order_pkg.html
@@ -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;
}
}
@@ -38,34 +38,19 @@
)
%>
-%# 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>
@@ -99,10 +84,30 @@
)
%>
+<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>
@@ -128,7 +133,10 @@ my $cust_main = qsearchs({
my $pkgpart = scalar($cgi->param('pkgpart'));
my $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi?
-my $start_date = $cust_main->next_bill_date;
-$start_date = $start_date ? time2str($format, $start_date) : '';
+my $start_date = '';
+if( ! $conf->exists('order_pkg-no_start_date') ) {
+ $start_date = $cust_main->next_bill_date;
+ $start_date = $start_date ? time2str($format, $start_date) : '';
+}
</%init>