diff options
Diffstat (limited to 'httemplate/misc/cancel_cust.html')
-rw-r--r-- | httemplate/misc/cancel_cust.html | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html new file mode 100644 index 0000000..12c37eb --- /dev/null +++ b/httemplate/misc/cancel_cust.html @@ -0,0 +1,63 @@ +<% include('/elements/header-popup.html', 'Cancel customer' ) %> + +<% include('/elements/error.html') %> + +<FORM NAME="cust_cancel_popup" ACTION="<% popurl(1) %>cust_main-cancel.cgi" METHOD=POST> +<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>"> + + + <P ALIGN="center"><B>Permanently delete all services and cancel this customer?</B> + + <% $ban %> + +<BR><BR> + +<% ntable("#cccccc", 2) %> + +<% include('/elements/tr-select-reason.html', + 'field' => 'reasonnum', + 'reason_class' => 'C', + 'cgi' => $cgi, + 'control_button' => "document.getElementById('confirm_cancel_cust_button')", + ) +%> + +</TABLE> + +<BR> +<P ALIGN="CENTER"> +<INPUT TYPE="submit" NAME="submit" ID="confirm_cancel_cust_button" VALUE="Cancel customer" DISABLED> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();"> + +</FORM> +</BODY> +</HTML> + +<%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; + +my $ban = ''; +if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { + $ban = '<BR><P ALIGN="center">'. + '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\'s '; + if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { + $ban .= 'credit card'; + } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { + $ban .= 'ACH account'; + } +} + +</%init> + |