X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=95ec70c54c9dd5f3d59031e4f9e6142482551888;hb=f9b6a37aaee52d875ea9393cda79d46f8916e593;hp=5d4bc2e1c50e07396e43b937d41d4cdf5b05782a;hpb=1c051f73e8abf23206d0373e7c83279b37bed708;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 5d4bc2e1c..95ec70c54 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -2,10 +2,8 @@ ( $cgi->param('error') ? '' : 'onload="addRow()"' ), ) %> -% if ( $cgi->param('error') ) { - <% $cgi->param('error') %>

-% } +<% include('/elements/error.html') %> - -
- + + +<% include('/elements/tr-select-pkg_class.html', '') %> <% include('/elements/tr-select-taxclass.html') %> @@ -106,7 +104,7 @@ function validate_quick_charge () { % } @@ -164,3 +162,21 @@ function validate_quick_charge () { +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('One-time charge'); + +$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum'; +my $custnum = $1; + +my $amount = ''; +if ( $cgi->param('amount') =~ /^\s*\$?\s*(\d+(\.\d{1,2})?)\s*$/ ) { + $amount = $1; +} + +$cgi->param('pkg') =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]]*)$/ + or die 'illegal description'; +my $pkg = $1; + +
Amount: - $ + $
Description: - +
- " rownum="<% $row %>" onkeyup = "possiblyAddRow;" > + " rownum="<% $row %>" onkeyup = "possiblyAddRow;" >