1 <% include("/elements/header.html","Customer View: ". $cust_main->name ) %>
3 % if ( $curuser->access_right('Edit customer') ) {
4 <A HREF="<% $p %>edit/cust_main.cgi?<% $custnum %>">Edit this customer</A> |
7 <% include('/elements/init_overlib.html') %>
9 <SCRIPT TYPE="text/javascript">
10 function areyousure(href, message) {
11 if (confirm(message) == true)
12 window.location.href = href;
16 <SCRIPT TYPE="text/javascript">
19 %if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
20 % $ban = '<BR><P ALIGN="center">'.
21 % '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\\\'s ';
22 % if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
23 % $ban .= 'credit card';
24 % } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
25 % $ban .= 'ACH account';
31 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> ';
34 % if ( $curuser->access_right('Cancel customer')
35 % && $cust_main->ncancelled_pkgs
38 <% include( '/elements/popup_link-cust_main.html',
39 { 'action' => $p. 'misc/cancel_cust.html',
40 'label' => 'Cancel this customer',
41 'actionlabel' => 'Confirm Cancellation',
43 'cust_main' => $cust_main,
49 % if ( $conf->exists('deletecustomers')
50 % && $curuser->access_right('Delete customer')
54 <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>">Delete this customer</A> |
56 % unless ( $conf->exists('disable_customer_referrals') ) {
58 <A HREF="<% popurl(2) %>edit/cust_main.cgi?referral_custnum=<% $custnum %>">Refer a new customer</A> |
59 <A HREF="<% popurl(2) %>search/cust_main.cgi?referral_custnum=<% $custnum %>">View this customer's referrals</A>
66 %my $signupurl = $conf->config('signupurl');
70 This customer's signup URL: <A HREF="<% $signupurl %>?ref=<% $custnum %>"><% $signupurl %>?ref=<% $custnum %></A><BR><BR>
74 <A NAME="cust_main"></A>
78 <% include('cust_main/contacts.html', $cust_main ) %>
80 <TD VALIGN="top" STYLE="padding-left: 54px">
81 <% include('cust_main/misc.html', $cust_main ) %>
82 % if ( $conf->config('payby-default') ne 'HIDE' ) {
85 <% include('cust_main/billing.html', $cust_main ) %>
92 %if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
97 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
99 <TD BGCOLOR="#ffffff">
100 <PRE><% encode_entities($cust_main->comments) %></PRE>
106 % my $notecount = scalar($cust_main->notes());
107 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
109 <A NAME="cust_main_note"><FONT SIZE="+2">Notes</FONT></A><BR>
110 % if ( $curuser->access_right('Add customer note') &&
111 % ! $conf->exists('cust_main-disable_notes')
114 <% include( '/elements/popup_link-cust_main.html',
115 'label' => 'Add customer note',
116 'action' => $p. 'edit/cust_main_note.cgi',
117 'actionlabel' => 'Enter customer note',
118 'cust_main' => $cust_main,
130 <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">
131 <div><br>[iframe not supported]<br><br></div>
134 % }else{ # make firefox happy wrt POSTDATA
136 <iframe src="<% $p %>view/cust_main/notes.html?custnum=<% $cust_main->custnum %>" height="24" width="616" name="cust_main_notes" frameborder="0" marginborder="0" marginheight="0" scrolling="auto">
137 <div><br>[iframe not supported]<br><br></div>
145 % if ( $conf->config('ticket_system') ) {
148 <% include('cust_main/tickets.html', $cust_main ) %>
154 % #XXX enable me# if ( $curuser->access_right('View customer packages') {
155 <% include('cust_main/packages.html', $cust_main ) %>
158 % if ( $conf->config('payby-default') ne 'HIDE' ) {
159 <% include('cust_main/payment_history.html', $cust_main ) %>
163 <% include('/elements/footer.html') %>
166 my $curuser = $FS::CurrentUser::CurrentUser;
169 unless $curuser->access_right('View customer');
171 my $conf = new FS::Conf;
173 die "No customer specified (bad URL)!" unless $cgi->keywords;
174 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
177 my $cust_main = qsearchs({
178 'table' => 'cust_main',
179 'hashref' => {'custnum'=>$custnum},
180 'extra_sql' => ' AND '. $curuser->agentnums_sql,
182 die "Customer not found!" unless $cust_main;