X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=a472915a1eb2ddfeddaa8322f280879b3e617f9c;hb=3714fa41c5306981c9f500df13eea52c72d82545;hp=ea14c6c15988ddf83bf53b1fee26247edf55862f;hpb=a70239efdaeddf0b20fea7f5126a2e3f0a962eb6;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index ea14c6c15..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; + } +} +
@@ -85,6 +102,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 param('bill_now') ? 'STYLE = "background-color:#dddddd" DISABLED' : '' %> > - + param('bill_now') ? '' : 'STYLE="display:none"' %> > (leave blank to charge immediately) @@ -105,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 @@ -208,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; @@ -231,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'). + ')'; +} +