X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=c96fa6c817b87612eb107bc0a2365a922dc2fd44;hb=d0221fabd4656b3a04251ca6168cc45f54d23574;hp=ad26bff664de1ced14a7f2c2291c097e3b92776d;hpb=0376f47e1ec2ec9b8702a0e6c5146af9c66beb5e;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index ad26bff66..c96fa6c81 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -3,10 +3,10 @@ ) %> - - - - + + + + <% include('/elements/error.html') %> @@ -58,6 +58,23 @@ function validate_quick_charge () { return false; } +function bill_now_changed (what) { + var form = what.form; + if ( what.checked ) { + form.start_date_text.disabled = true; + form.start_date.style.backgroundColor = '#dddddd'; + form.start_date_button.style.display = 'none'; + form.start_date_button_disabled.style.display = ''; + form.invoice_terms.disabled = false; + } else { + form.start_date_text.disabled = false; + form.start_date.style.backgroundColor = '#ffffff'; + form.start_date_button.style.display = ''; + form.start_date_button_disabled.style.display = 'none'; + form.invoice_terms.disabled = true; + } +} +
@@ -84,6 +101,26 @@ function validate_quick_charge () { <% include('/elements/tr-select-pkg_class.html', 'curr_value' => $cgi->param('classnum') ) %> + + Invoice now + + param('bill_now') ? 'CHECKED' : '' %> + onChange = "bill_now_changed(this);" + > + with terms + <% include('/elements/select-terms.html', + 'curr_value' => scalar($cgi->param('invoice_terms')), + 'empty_value' => $default_terms, + 'disabled' => ( $cgi->param('bill_now') ? 0 : 1 ), + ) + %> + + + +%# false laziness w/misc/order_pkg.html Charge date @@ -92,11 +129,16 @@ function validate_quick_charge () { SIZE = 32 ID = "start_date_text" VALUE = "<% $start_date %>" + <% $cgi->param('bill_now') ? 'STYLE = "background-color:#dddddd" DISABLED' : '' %> > - + param('bill_now') ? '' : 'STYLE="display:none"' %> > (leave blank to charge immediately) @@ -215,7 +257,6 @@ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); #XXX agent-vi my $format = "%m/%d/%Y %T %z (%Z)"; #false laziness w/REAL_cust_pkg.cgi? my $start_date = $cust_main->next_bill_date; -warn "*** $start_date"; $start_date = $start_date ? time2str($format, $start_date) : ''; my $amount = ''; @@ -232,4 +273,14 @@ $cgi->param('pkg') =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]]*)$/ or die 'illegal description'; my $pkg = $1; +my $default_terms; +if ( $cust_main->invoice_terms ) { + $default_terms = 'Customer default ('. $cust_main->invoice_terms. ')'; +} else { + $default_terms = + 'Default ('. + ($conf->config('invoice_default_terms') || 'Payable upon receipt'). + ')'; +} +