X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=ea14c6c15988ddf83bf53b1fee26247edf55862f;hb=a70239efdaeddf0b20fea7f5126a2e3f0a962eb6;hp=2dcbe51699dbd9d2077109574fb178135ce58ff5;hpb=fba0d3390b1d53199777735ea0366b450aa2576b;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 2dcbe5169..ea14c6c15 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -1,8 +1,13 @@ -<% include("/elements/header-popup.html", 'One-time charge entry', '', +<% include("/elements/header-popup.html", 'One-time charge', '', ( $cgi->param('error') ? '' : 'onload="addRow()"' ), ) %> + + + + + <% include('/elements/error.html') %> -
+ - + + + +% if ( $conf->exists('invoice-unitprice') ) { + + + + +% } + <% include('/elements/tr-select-pkg_class.html', 'curr_value' => $cgi->param('classnum') ) %> -<% include('/elements/tr-select-taxclass.html', 'curr_value' => $cgi->param('taxclass') ) %> + + + + - + + + + + + + + + +<% include('/elements/tr-select-taxclass.html', 'curr_value' => $cgi->param('taxclass') ) %> + +<% include('/elements/tr-select-taxproduct.html', 'label' => 'Tax product', 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') ) %> + +<% include('/elements/tr-select-taxoverride.html', 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') ) %> + + + + - + % my $row = 0; -% if ( $cgi->param('error') ) { +% if ( $cgi->param('error') || $cgi->param('magic') ) { % my $param = $cgi->Vars; % % for ( $row = 0; exists($param->{"description$row"}); $row++ ) { @@ -114,7 +154,7 @@ function validate_quick_charge () {
Amount:Amount - $ + $
Quantity + +
Charge date + + + (leave blank to charge immediately) +
Description:
Tax exempt param('setuptax') ? 'CHECKED' : '' %>>
Description - +
Optional additional description: Optional additional description (also printed on invoice):

-param('error') ? '' :' DISABLED' %>> +param('error') ? '' :' DISABLED' %>>
@@ -167,14 +207,26 @@ function validate_quick_charge () { die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('One-time charge'); +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; +$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;