X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=a472915a1eb2ddfeddaa8322f280879b3e617f9c;hb=e0a26680d75fc2000bde195eba7946805a3aaa28;hp=75e3fee1430c6da91b54a27af95ae7b411790263;hpb=802a2689374720d9bd65da023dd3ef61547a3019;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 75e3fee14..a472915a1 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,25 @@ 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 @@ -93,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) @@ -106,12 +147,19 @@ function validate_quick_charge () { +% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { +% my $what = lc(FS::payby->shortname($cust_main->payby)); + + Disable automatic <% $what %> charge + + +% } Tax exempt @@ -209,6 +257,7 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('One-time charge'); my $conf = new FS::Conf; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum'; my $custnum = $1; @@ -232,4 +281,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'). + ')'; +} +