X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fquick-charge.html;h=27841063fa9459da31504739c1d11a85827501f6;hb=84c8202ee1d4d74a6ed55ac31c3f0de8cb572e04;hp=2dcbe51699dbd9d2077109574fb178135ce58ff5;hpb=fba0d3390b1d53199777735ea0366b450aa2576b;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 2dcbe5169..27841063f 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -1,9 +1,13 @@ -<% include("/elements/header-popup.html", 'One-time charge entry', '', +<& /elements/header-popup.html, mt('One-time charge'), '', ( $cgi->param('error') ? '' : 'onload="addRow()"' ), - ) -%> +&> -<% include('/elements/error.html') %> + + + + + +<& /elements/error.html &> -
@@ -167,16 +254,39 @@ function validate_quick_charge () { 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'; +my $money_char = $conf->config('money_char') || '$'; + $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; +$start_date = $start_date ? time2str($format, $start_date) : ''; my $amount = ''; if ( $cgi->param('amount') =~ /^\s*\$?\s*(\d+(\.\d{1,2})?)\s*$/ ) { $amount = $1; } +my $quantity = 1; +if ( $cgi->param('quantity') =~ /^\s*(\d+)\s*$/ ) { + $quantity = $1; +} + $cgi->param('pkg') =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]]*)$/ or die 'illegal description'; my $pkg = $1; +my $default_terms; +if ( $cust_main->invoice_terms ) { + $default_terms = emt("Customer default ([_1])", $cust_main->invoice_terms); +} else { + $default_terms = emt("Default ([_1])", + ($conf->config('invoice_default_terms') || emt('Payable upon receipt')) + ); +} + %init>