<% include('/elements/header-popup.html', 'Recharge Service' ) %> <% include('/elements/error.html') %>


<% "Recharge $svcnum: $label - $value" %> <% ntable("#cccccc", 2) %> % if ($recharge_label) { > Prepaid Card > <% $recharge_label %> % } else { % $payby = 'PREP'; % } Enter prepaid card: >
<% include('/elements/footer.html') %> <%once> my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Recharge customer service'); my($svcnum, $prepaid, $payby); if ( $cgi->param('error') ) { $svcnum = $cgi->param('svcnum'); $prepaid = $cgi->param('prepaid'); $payby = $cgi->param('payby'); } elsif ( $cgi->param('svcnum') =~ /^(\d+)$/ ) { $svcnum = $1; $prepaid = ''; } else { die "illegal query ". $cgi->keywords; } my $title = 'Recharge Service'; my $cust_svc = qsearchs('cust_svc', {'svcnum' => $svcnum}); die "No such service: $svcnum" unless $cust_svc; my($label, $value) = $cust_svc->label; $payby = $cust_svc->cust_pkg->cust_main->payby unless $payby; my $part_pkg = $cust_svc->cust_pkg->part_pkg; my $amount = $part_pkg->option('recharge_amount', 1) || 0; my $recharge_label = "Charge $money_char$amount for "; $recharge_label .= $part_pkg->option('recharge_seconds', 1) . 's ' if $part_pkg->option('recharge_seconds', 1); $recharge_label .= FS::UI::bytecount::display_bytecount( $part_pkg->option('recharge_upbytes', 1) ) . ' up ' if $part_pkg->option('recharge_upbytes', 1); $recharge_label .= FS::UI::bytecount::display_bytecount( $part_pkg->option('recharge_downbytes', 1) ) . ' down ' if $part_pkg->option('recharge_downbytes', 1); $recharge_label .= FS::UI::bytecount::display_bytecount( $part_pkg->option('recharge_totalbytes', 1) ) . ' total ' if $part_pkg->option('recharge_totalbytes', 1); $recharge_label = '' unless ($recharge_label ne "Charge $money_char$amount for ");