X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=95ec70c54c9dd5f3d59031e4f9e6142482551888;hb=53547a802d5c76be967cc14301fc8a692f0fe066;hp=94682d0a6540e50aac630a6f11ec77b54a583e9e;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 94682d0a6..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 () { % } @@ -147,7 +145,7 @@ function validate_quick_charge () { description_input.setAttribute('name', 'description'+rownum); description_input.setAttribute('id', 'description'+rownum); description_input.setAttribute('size', 60); - description_input.setAttribute('maxlength', 65); + description_input.setAttribute('maxLength', 65); description_input.setAttribute('rownum', rownum); description_input.onkeyup = possiblyAddRow; description_cell.appendChild(description_input); @@ -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;" >