From 1203e278e2ec38fcf1468da2e4f10862004bebeb Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 5 Jun 2008 19:24:33 +0000 Subject: voxlinesystems CDRs and quantity bs --- httemplate/edit/process/quick-charge.cgi | 6 ++++++ httemplate/edit/quick-charge.html | 27 ++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 22f96852f..4c4927f4d 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -30,6 +30,11 @@ $param->{"amount"} =~ /^\s*(\d+(\.\d{1,2})?)\s*$/ or $error .= "Illegal amount " . $param->{"amount"} . " "; my $amount = $1; +my $quantity = 1; +if ( $cgi->param('quantity') =~ /^\s*(\d+)\s*$/ ) { + $quantity = $1; +} + if ( $param->{'taxclass'} eq '(select)' ) { $error .= "Must select a tax class. "; } @@ -40,6 +45,7 @@ unless ( $error ) { $error ||= $cust_main->charge( { 'amount' => $amount, + 'quantity' => $quantity, 'pkg' => scalar($cgi->param('pkg')), 'taxclass' => scalar($cgi->param('taxclass')), 'classnum' => scalar($cgi->param('classnum')), diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 2dcbe5169..d51015054 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -78,18 +78,32 @@ function validate_quick_charge () { - + + + +% 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') ) %> - + + + @@ -114,7 +128,7 @@ function validate_quick_charge () {
Amount:Amount: $
Quantity: + +
Description:
Optional additional description:

-param('error') ? '' :' DISABLED' %>> +param('error') ? '' :' DISABLED' %>> @@ -167,6 +181,8 @@ 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; @@ -175,6 +191,11 @@ 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; -- cgit v1.2.1