3 my $conf = new FS::Conf;
5 my $curuser = $FS::CurrentUser::CurrentUser;
7 die "No customer specified (bad URL)!" unless $cgi->keywords;
8 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
11 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
12 die "Customer not found!" unless $cust_main;
16 <%= include("/elements/header.html","Customer View: ". $cust_main->name ) %>
18 <% if ( $curuser->access_right('Edit customer') ) { %>
19 <A HREF="<%= $p %>edit/cust_main.cgi?<%= $custnum %>">Edit this customer</A> |
23 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
24 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
25 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT>
26 <SCRIPT TYPE="text/javascript" SRC="../elements/iframecontentmws.js"></SCRIPT>
28 <SCRIPT TYPE="text/javascript">
29 function areyousure(href, message) {
30 if (confirm(message) == true)
31 window.location.href = href;
35 <SCRIPT TYPE="text/javascript">
39 if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
40 $ban = '<BR><P ALIGN="center">'.
41 '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\\\'s ';
42 if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
43 $ban .= 'credit card';
44 } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
45 $ban .= 'ACH account';
50 var confirm_cancel = '<FORM METHOD="POST" ACTION="<%= $p %>misc/cust_main-cancel.cgi"> <INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $custnum %>"> <BR><P ALIGN="center"><B>Permanently delete all services and cancel this customer?</B> <%= $ban%><BR><P ALIGN="CENTER"> <INPUT TYPE="submit" VALUE="Cancel customer"> <INPUT TYPE="BUTTON" VALUE="Don\'t cancel" onClick="cClick()"> </FORM> ';
54 <% if ( $curuser->access_right('Cancel customer')
55 && $cust_main->ncancelled_pkgs
58 <A HREF="javascript:void(0);" onClick="overlib(confirm_cancel, CAPTION, 'Confirm cancellation', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 128, TEXTSIZE, 3, BGCOLOR, '#ff0000', CGCOLOR, '#ff0000' ); return false; ">Cancel this customer</A> |
62 <% if ( $conf->exists('deletecustomers')
63 && $curuser->access_right('Delete customer')
66 <A HREF="<%= $p %>misc/delete-customer.cgi?<%= $custnum%>">Delete this customer</A> |
70 <% unless ( $conf->exists('disable_customer_referrals') ) { %>
71 <A HREF="<%= popurl(2) %>edit/cust_main.cgi?referral_custnum=<%= $custnum %>">Refer a new customer</A> |
72 <A HREF="<%= popurl(2) %>search/cust_main.cgi?referral_custnum=<%= $custnum %>">View this customer's referrals</A>
79 my $signupurl = $conf->config('signupurl');
82 This customer's signup URL: <A HREF="<%= $signupurl %>?ref=<%= $custnum %>"><%= $signupurl %>?ref=<%= $custnum %></A><BR><BR>
85 <A NAME="cust_main"></A>
89 <%= include('cust_main/contacts.html', $cust_main ) %>
91 <TD VALIGN="top" STYLE="padding-left: 54px">
92 <%= include('cust_main/misc.html', $cust_main ) %>
93 <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
95 <%= include('cust_main/billing.html', $cust_main ) %>
102 if ( defined $cust_main->dbdef_table->column('comments')
103 && $cust_main->comments =~ /[^\s\n\r]/ ) {
107 <%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
109 <TD BGCOLOR="#ffffff">
110 <PRE><%= encode_entities($cust_main->comments) %></PRE>
116 <% if ( $conf->config('ticket_system') ) { %>
118 <%= include('cust_main/tickets.html', $cust_main ) %>
122 <%= include('cust_main/packages.html', $cust_main ) %>
124 <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
125 <%= include('cust_main/payment_history.html', $cust_main ) %>
128 <%= include('/elements/footer.html') %>