X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fcancel_cust.html;h=3259a03f6faafb6c3bbc6b02240abe2565a53751;hp=bb4e1904a0e95776084237578374eb41b262f5ef;hb=75e11f1d1a5ced24496b5732e290f7762403feb8;hpb=5e05724a635a22776f1b973f5d7e77989da4e048 diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html index bb4e1904a..3259a03f6 100644 --- a/httemplate/misc/cancel_cust.html +++ b/httemplate/misc/cancel_cust.html @@ -1,33 +1,65 @@ -<% include('/elements/header-popup.html', 'Cancel customer' ) %> +<& /elements/header-popup.html, mt('Cancel customer') &> -<% include('/elements/error.html') %> +<& /elements/error.html &>
- -

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

- -<% ntable("#cccccc", 2) %> - -<% include('/elements/tr-select-reason.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', - #XXX these need to be sticky on errors too... - #'curr_value' => '', - 'control_button' => 'document.cust_cancel_popup.submit', - ) -%> + 'cgi' => $cgi, + 'control_button' => "document.getElementById('confirm_cancel_cust_button')", +&>

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

@@ -35,40 +67,19 @@ <%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; - } -} +$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum'; +my $custnum = $1; -$curuser = $FS::CurrentUser::CurrentUser; +my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('Cancel customer'); -$cust_main = qsearchs( { +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 = '

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