<& /elements/header-popup.html, mt('Cancel customer') &> <& /elements/error.html &>

<% mt('Permanently delete all services and cancel this customer?') |h %>
<% mt('Cancel now') |h %>
<% mt('Cancel on date: ') |h %> <& /elements/input-date-field.html, { 'name' => 'expire', 'value' => time, } &>
% if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { % my $ban = "Ban this customer's "; % $ban .= 'credit card' if $cust_main->payby =~ /^(CARD|DCRD)$/; % $ban .= 'ACH account' if $cust_main->payby =~ /^(CHEK|DCHK)$/;

<% mt($ban) |h %> % } <& /elements/tr-select-reason.html, 'field' => 'reasonnum', 'reason_class' => 'C', 'cgi' => $cgi, 'control_button' => 'confirm_cancel_cust_button', &>

         " onClick="parent.cClick();">

<%init> $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum'; my $custnum = $1; my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('Cancel customer'); my $cust_main = qsearchs( { 'table' => 'cust_main', 'hashref' => { 'custnum' => $custnum }, 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, } ); die "No customer # $custnum" unless $cust_main;