1 <& /elements/header-popup.html, mt('Unsuspend customer') &>
3 <& /elements/error.html &>
5 <FORM NAME="cust_unsuspend_popup" ACTION="<% popurl(1) %>cust_main-unsuspend.cgi" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
8 <P ALIGN="center"><B><% mt('Unsuspend this customer?') |h %></B>
10 <TABLE BORDER="0" CELLSPACING="2" STYLE="margin-left:auto; margin-right:auto">
13 <INPUT TYPE="radio" NAME="now_or_later" VALUE="0" onclick="toggle(false)" CHECKED />
15 <TD ALIGN="left"><% mt('Unsuspend now') |h %></TD>
19 <INPUT TYPE="radio" NAME="now_or_later" VALUE="1" onclick="toggle(true)" />
21 <TD ALIGN="left"><% mt('Unsuspend on date: ') |h %>
22 <& /elements/input-date-field.html, {
28 % if ( $on_hold_pkgs > 0 ) {
31 <INPUT TYPE="checkbox" NAME="release_hold" VALUE="1" CHECKED \
32 <% $susp_pkgs == 0 ? 'DISABLED' : '' %> />
36 <% emt('Activate [quant,_1,on-hold package,on-hold packages]', $on_hold_pkgs) %>
40 % if ( $susp_pkgs == 0 ) { # then always release holds, or this will do nothing
41 <INPUT TYPE="hidden" NAME="release_hold" VALUE="1">
44 <SCRIPT type="text/javascript">
45 function toggle(val) {
46 document.getElementById("resume_text").disabled = !val;
47 document.getElementById("resume_button").style.visibility =
48 val ? 'visible' : 'hidden';
55 <INPUT TYPE="submit" NAME="submit" ID="confirm_unsuspend_cust_button" VALUE="<% mt('Unsuspend customer') |h %>">
56
57 <INPUT TYPE="BUTTON" VALUE="<% mt("Don't unsuspend") |h %>" onClick="parent.cClick();">
65 #false laziness w/cancel_cust.html
67 $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
70 my $curuser = $FS::CurrentUser::CurrentUser;
72 die "access denied" unless $curuser->access_right('Unsuspend customer');
74 my $cust_main = qsearchs( {
75 'table' => 'cust_main',
76 'hashref' => { 'custnum' => $custnum },
77 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
79 die "No customer # $custnum" unless $cust_main;
81 my $susp_pkgs = FS::cust_pkg->count(
82 FS::cust_pkg->susp_sql . " AND custnum = ?", $custnum
85 my $on_hold_pkgs = FS::cust_pkg->count(
86 FS::cust_pkg->on_hold_sql . " AND custnum = ?", $custnum