diff options
author | ivan <ivan> | 2008-06-05 19:24:37 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-06-05 19:24:37 +0000 |
commit | 7a3347315a12b7afb394a855eccf996faf0c6589 (patch) | |
tree | 0144898e68e4406ace817a67a5f12f2f389f977c /httemplate | |
parent | aa7b85d7154526990979d9df17ea1e237386365a (diff) |
voxlinesystems CDRs and quantity bs
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 6 | ||||
-rw-r--r-- | httemplate/edit/quick-charge.html | 27 | ||||
-rw-r--r-- | httemplate/search/cdr.html | 14 | ||||
-rw-r--r-- | httemplate/view/svc_phone.cgi | 6 |
4 files changed, 48 insertions, 5 deletions
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 22f9685..4c4927f 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 95ec70c..eaa9288 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -78,18 +78,32 @@ function validate_quick_charge () { <TABLE ID="QuickChargeTable" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 STYLE="background-color: #cccccc"> <TR> - <TD ALIGN="right">Amount:</TD> + <TD ALIGN="right">Amount: </TD> <TD> $<INPUT TYPE="text" NAME="amount" SIZE=6 VALUE="<% $amount %>" onChange="enable_quick_charge()" onKeyPress="enable_quick_charge_amount()"> </TD> +</TR> + +% if ( $conf->exists('invoice-unitprice') ) { + <TR> + <TD ALIGN="right">Quantity: </TD> + <TD> + <INPUT TYPE="text" NAME="quantity" SIZE=4 VALUE="<% $quantity %>"> + </TD> + </TR> +% } + <% include('/elements/tr-select-pkg_class.html', '') %> + <% include('/elements/tr-select-taxclass.html') %> -</TR> + +<TR> <TD>Description:</TD> <TD> <INPUT TYPE="text" NAME="pkg" SIZE="60" MAXLENGTH="65" VALUE="<% $pkg %>" onChange="enable_quick_charge()" onKeyPress="enable_quick_charge_desc()"> </TD> </TR> + <TR> <TD></TD> <TD><FONT SIZE="-1">Optional additional description: </FONT></TD> @@ -114,7 +128,7 @@ function validate_quick_charge () { </TABLE> <BR> -<INPUT TYPE="submit" NAME="submit" VALUE="Add one-time charge" <% $cgi->param('error') ? '' :' DISABLED' %>> +<INPUT TYPE="submit" ID="submit" NAME="submit" VALUE="Add one-time charge" <% $cgi->param('error') ? '' :' DISABLED' %>> </FORM> @@ -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; diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index 8079b5b..4bac8c1 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -61,7 +61,7 @@ push @search, FS::UI::Web::parse_lt_gt($cgi, 'duration'); push @search, FS::UI::Web::parse_lt_gt($cgi, 'billsec'); ### -# src/dest +# src/dest/charged_party ### my @qsearch = @search; @@ -78,6 +78,18 @@ if ( $cgi->param('dst') =~ /^\s*([\d\-\+ ]+)\s*$/ ) { push @search, "dst = '$dst'"; } +if ( $cgi->param('charged_party') =~ /^\s*([\d\-\+\ ]+)\s*$/ ) { + ( my $charged_party = $1 ) =~ s/\D//g; + #$hashref->{'charged_party'} = $charged_party; + #push @search, "charged_party = '$charged_party'"; + #XXX countrycode + push @search, " ( charged_party = '$charged_party' + OR charged_party = '1$charged_party' ) "; + push @qsearch, " ( charged_party = '$charged_party' + OR charged_party = '1$charged_party' ) "; +} + + ### # finish it up ### diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index 5dcf359..65442d9 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -24,8 +24,12 @@ my $html_foot = sub { my $number = $svc_phone->phonenum; + #my @links = map { + # qq(<A HREF="${p}search/cdr.html?src=$number;freesidestatus=$what{$_}">). + # "View $_ CDRs</A>"; + #} keys(%what); my @links = map { - qq(<A HREF="${p}search/cdr.html?src=$number;freesidestatus=$what{$_}">). + qq(<A HREF="${p}search/cdr.html?charged_party=$number;freesidestatus=$what{$_}">). "View $_ CDRs</A>"; } keys(%what); |