function enable_order_pkg () {
if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
document.OrderPkgForm.submit.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.discountnum.disabled = true;
}
}
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "start_date_text",
- ifFormat: "%m/%d/%Y",
+ 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>
+ <TH ALIGN="right">Disable automatic <% $what %> charge </TH>
+ <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="no_auto" VALUE="Y"></TD>
+ </TR>
+% }
+
% if ( $curuser->access_right('Discount customer package') ) {
- <% include('/elements/tr-select-discount.html') %>
+ <% include('/elements/tr-select-discount.html',
+ 'element_etc' => 'DISABLED',
+ 'colspan' => 7,
+ 'cgi' => $cgi,
+ )
+ %>
% }
% if ( $conf->exists('pkg_referral') ) {
unless $curuser->access_right('Order customer package');
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
my $custnum = $1;
my $pkgpart = scalar($cgi->param('pkgpart'));
-my $format = "%m/%d/%Y %T %z (%Z)"; #false laziness w/REAL_cust_pkg.cgi?
+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) : '';