X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fcancel_cust.html;fp=httemplate%2Fmisc%2Fcancel_cust.html;h=a757aa6e38b8f4990c254dbc570ac9c80b0d3be0;hb=eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd;hp=0000000000000000000000000000000000000000;hpb=32b5d3a31f112a381f0a15ac5e3a2204242f3405;p=freeside.git diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html new file mode 100644 index 000000000..a757aa6e3 --- /dev/null +++ b/httemplate/misc/cancel_cust.html @@ -0,0 +1,75 @@ +<% include('/elements/header-popup.html', 'Cancel customer' ) %> + +% if ( $cgi->param('error') ) { + Error: <% $cgi->param('error') %> +

+% } + +
+ + + +

Permanently delete all services and cancel this customer? + + <% $ban %> + +

+ +<% ntable("#cccccc", 2) %> + +<% include('/elements/tr-select-reason.html', + 'field' => 'reasonnum', + 'reason_class' => 'C', + #XXX these need to be sticky on errors too... + #'curr_value' => '', + 'control_button' => 'document.cust_cancel_popup.submit', + ) +%> + + + +
+

+          + +

+ + + +<%init> + +my($custnum, $reasonnum, $submit, $cust_main, $curuser, $class); +if ( $cgi->param('error') ) { + $custnum = $cgi->param('custnum'); + $reasonnum = $cgi->param('reasonnum'); +} else { + my( $query ) = $cgi->keywords; + if ( $query =~ /^(\d+)$/ ) { + $custnum = $1; + } else { + die "illegal query ". $cgi->keywords; + } +} + +$curuser = $FS::CurrentUser::CurrentUser; + +$cust_main = qsearchs( { + 'table' => 'cust_main', + 'hashref' => { 'custnum' => $custnum }, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +} ); +die "No customer # $custnum" unless $cust_main; + +my $ban = ''; +if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { + $ban = '

'. + ' Ban this customer\'s '; + if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { + $ban .= 'credit card'; + } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { + $ban .= 'ACH account'; + } +} + + +