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;
17 <% include("/elements/header.html","Customer View: ". $cust_main->name ) %>
18 % if ( $curuser->access_right('Edit customer') ) {
20 <A HREF="<% $p %>edit/cust_main.cgi?<% $custnum %>">Edit this customer</A> |
25 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
26 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
27 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT>
28 <SCRIPT TYPE="text/javascript" SRC="../elements/iframecontentmws.js"></SCRIPT>
30 <SCRIPT TYPE="text/javascript">
31 function areyousure(href, message) {
32 if (confirm(message) == true)
33 window.location.href = href;
37 <SCRIPT TYPE="text/javascript">
40 %if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
41 % $ban = '<BR><P ALIGN="center">'.
42 % '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\\\'s ';
43 % if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
44 % $ban .= 'credit card';
45 % } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
46 % $ban .= 'ACH account';
52 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> ';
55 % if ( $curuser->access_right('Cancel customer')
56 % && $cust_main->ncancelled_pkgs
60 <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')
67 <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>">Delete this customer</A> |
69 % 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');
83 This customer's signup URL: <A HREF="<% $signupurl %>?ref=<% $custnum %>"><% $signupurl %>?ref=<% $custnum %></A><BR><BR>
87 <A NAME="cust_main"></A>
91 <% include('cust_main/contacts.html', $cust_main ) %>
93 <TD VALIGN="top" STYLE="padding-left: 54px">
94 <% include('cust_main/misc.html', $cust_main ) %>
95 % if ( $conf->config('payby-default') ne 'HIDE' ) {
98 <% include('cust_main/billing.html', $cust_main ) %>
105 %if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
110 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
112 <TD BGCOLOR="#ffffff">
113 <PRE><% encode_entities($cust_main->comments) %></PRE>
119 % my $notecount = scalar($cust_main->notes());
120 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
122 <A NAME="cust_main_note"><FONT SIZE="+2">Notes</FONT></A><BR>
123 % if ( $curuser->access_right('Add customer note') &&
124 % ! $conf->exists('cust_main-disable_notes')
127 <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<% $p %>edit/cust_main_note.cgi?custnum=<% $cust_main->custnum %>', 616, 386, 'cust_main_note_popup' ), CAPTION, 'Enter customer note', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK); return false;">Add customer note</A>
135 <iframe src="<% $p %>view/cust_main/notes.html?custnum=<% $cust_main->custnum %>" height="186" width="616" name="cust_main_notes" frameborder="0" marginborder="0" marginheight="0" scrolling="auto">
136 <div><br>[iframe not supported]<br><br></div>
139 % }else{ # make firefox happy wrt POSTDATA
141 <iframe src="<% $p %>view/cust_main/notes.html?custnum=<% $cust_main->custnum %>" height="18" width="6" name="cust_main_notes" frameborder="0" marginborder="0" marginheight="0" scrolling="auto">
142 <div><br>[iframe not supported]<br><br></div>
150 % if ( $conf->config('ticket_system') ) {
153 <% include('cust_main/tickets.html', $cust_main ) %>
158 <% include('cust_main/packages.html', $cust_main ) %>
159 % if ( $conf->config('payby-default') ne 'HIDE' ) {
161 <% include('cust_main/payment_history.html', $cust_main ) %>
165 <% include('/elements/footer.html') %>