X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Forder_pkg.html;h=2511a3deb547ac7fd555fbe91db878d39e6f8a23;hb=4117c20f85ce085d7dd42b8970ce9c65b95d7e27;hp=a7571ca5851e5893d387c57c3f44aae8cacdbb0b;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index a7571ca58..2511a3deb 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -10,8 +10,14 @@ 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; } } @@ -54,12 +60,29 @@ +% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { +% my $what = lc(FS::payby->shortname($cust_main->payby)); + + Disable automatic <% $what %> charge + + +% } + +% if ( $curuser->access_right('Discount customer package') ) { + <% include('/elements/tr-select-discount.html', + 'element_etc' => 'DISABLED', + 'colspan' => 7, + 'cgi' => $cgi, + ) + %> +% } + % 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, @@ -86,10 +109,13 @@ <%init> +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Order customer package'); + 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; @@ -101,8 +127,12 @@ my $cust_main = qsearchs({ my $pkgpart = scalar($cgi->param('pkgpart')); -my $format = "%m/%d/%Y %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 $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi? +my $start_date = ''; +if(! $conf->exists('order_pkg-no_start_date') ) { + warn "foo"; + $cust_main->next_bill_date; + $start_date = $start_date ? time2str($format, $start_date) : ''; +}