From 7e368366b4b1c3b6a2b1990f34d79a15289cadcc Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 29 May 2009 00:22:48 +0000 Subject: don't require a leading 0 in the quick charge amount --- httemplate/edit/quick-charge.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/quick-charge.html') diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index c18b2bc64..8aca34a0d 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -20,7 +20,7 @@ function validate_quick_charge () { var pkg = document.QuickChargeForm.pkg.value; var pkg_regex = /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]]*)$/ ; var amount = document.QuickChargeForm.amount.value; - var amount_regex = /^\s*\$?\s*(\d+(\.\d{1,2})?)\s*$/ ; + var amount_regex = /^\s*\$?\s*(\d*(\.?\d{1,2}))\s*$/ ; var rval = true; if ( ! amount_regex.test(amount) ) { -- cgit v1.2.1 From 0376f47e1ec2ec9b8702a0e6c5146af9c66beb5e Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Jun 2009 12:28:38 +0000 Subject: one-time charge "hold for later" / any package future start date, RT#5347 --- httemplate/edit/quick-charge.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'httemplate/edit/quick-charge.html') diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 8aca34a0d..ad26bff66 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -3,6 +3,11 @@ ) %> + + + + + <% include('/elements/error.html') %> + Tax exempt @@ -179,6 +211,12 @@ my $conf = new FS::Conf; $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum'; my $custnum = $1; +my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); #XXX agent-virt + +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 = ''; if ( $cgi->param('amount') =~ /^\s*\$?\s*(\d+(\.\d{1,2})?)\s*$/ ) { -- cgit v1.2.1 From a70239efdaeddf0b20fea7f5126a2e3f0a962eb6 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Jun 2009 12:32:47 +0000 Subject: remove debugging --- httemplate/edit/quick-charge.html | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/edit/quick-charge.html') diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index ad26bff66..ea14c6c15 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -215,7 +215,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 = ''; -- cgit v1.2.1 From 802a2689374720d9bd65da023dd3ef61547a3019 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 22 Aug 2009 00:29:20 +0000 Subject: comments --- httemplate/edit/quick-charge.html | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/edit/quick-charge.html') diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index ea14c6c15..75e3fee14 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -84,6 +84,7 @@ function validate_quick_charge () { <% include('/elements/tr-select-pkg_class.html', 'curr_value' => $cgi->param('classnum') ) %> +%# false laziness w/misc/order_pkg.html Charge date -- cgit v1.2.1 From bdf4497fd8d3778e9cc0f8b90dd8a742f3a84158 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 10 Oct 2009 00:00:32 +0000 Subject: change invoice terms for one-time charges (& bill them immediately), RT#5891 --- httemplate/edit/quick-charge.html | 63 +++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) (limited to 'httemplate/edit/quick-charge.html') diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 75e3fee14..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,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) @@ -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'). + ')'; +} + -- cgit v1.2.1