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 % if ( $curuser->access_right('Cancel customer')
17 % && $cust_main->ncancelled_pkgs
20 <% include( '/elements/popup_link-cust_main.html',
21 { 'action' => $p. 'misc/cancel_cust.html',
22 'label' => 'Cancel this customer',
23 'actionlabel' => 'Confirm Cancellation',
25 'cust_main' => $cust_main,
26 'width' => 616, #make room for reasons
33 % if ( $conf->exists('deletecustomers')
34 % && $curuser->access_right('Delete customer')
36 <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>">Delete this customer</A> |
39 % unless ( $conf->exists('disable_customer_referrals') ) {
40 <A HREF="<% $p %>edit/cust_main.cgi?referral_custnum=<% $custnum %>">Refer a new customer</A> |
41 <A HREF="<% $p %>search/cust_main.cgi?referral_custnum=<% $custnum %>">View this customer's referrals</A>
46 %my $signupurl = $conf->config('signupurl');
48 This customer's signup URL: <A HREF="<% $signupurl %>?ref=<% $custnum %>"><% $signupurl %>?ref=<% $custnum %></A><BR><BR>
52 <A NAME="cust_main"></A>
56 <% include('cust_main/contacts.html', $cust_main ) %>
58 <TD VALIGN="top" STYLE="padding-left: 54px">
59 <% include('cust_main/misc.html', $cust_main ) %>
60 % if ( $conf->config('payby-default') ne 'HIDE' ) {
63 <% include('cust_main/billing.html', $cust_main ) %>
70 %if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
75 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
77 <TD BGCOLOR="#ffffff">
78 <PRE><% encode_entities($cust_main->comments) %></PRE>
84 % my $notecount = scalar($cust_main->notes());
85 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
87 <A NAME="cust_main_note"><FONT SIZE="+2">Notes</FONT></A><BR>
88 % if ( $curuser->access_right('Add customer note') &&
89 % ! $conf->exists('cust_main-disable_notes')
92 <% include( '/elements/popup_link-cust_main.html',
93 'label' => 'Add customer note',
94 'action' => $p. 'edit/cust_main_note.cgi',
95 'actionlabel' => 'Enter customer note',
96 'cust_main' => $cust_main,
106 <% include('cust_main/notes.html', 'custnum' => $cust_main->custnum ) %>
111 % if ( $conf->config('ticket_system') ) {
114 <% include('cust_main/tickets.html', $cust_main ) %>
120 % #XXX enable me# if ( $curuser->access_right('View customer packages') {
121 <% include('cust_main/packages.html', $cust_main ) %>
124 % if ( $conf->config('payby-default') ne 'HIDE' ) {
125 <% include('cust_main/payment_history.html', $cust_main ) %>
129 <% include('/elements/footer.html') %>
132 my $curuser = $FS::CurrentUser::CurrentUser;
135 unless $curuser->access_right('View customer');
137 my $conf = new FS::Conf;
139 die "No customer specified (bad URL)!" unless $cgi->keywords;
140 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
143 my $cust_main = qsearchs( {
144 'table' => 'cust_main',
145 'hashref' => { 'custnum' => $custnum },
146 'extra_sql' => ' AND '. $curuser->agentnums_sql,
148 die "Customer not found!" unless $cust_main;