3 my $conf = new FS::Conf;
7 foreach my $part_svc ( qsearch('part_svc',{}) ) {
8 $uiview{$part_svc->svcpart} = $p. "view/". $part_svc->svcdb . ".cgi";
9 $uiadd{$part_svc->svcpart}= $p. "edit/". $part_svc->svcdb . ".cgi";
15 <%= include("/elements/header.html","Customer View",
16 include("/elements/menubar.html",
23 my $curuser = $FS::CurrentUser::CurrentUser;
25 die "No customer specified (bad URL)!" unless $cgi->keywords;
26 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
29 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
30 die "Customer not found!" unless $cust_main;
35 <% if ( $curuser->access_right('Edit customer') ) { %>
36 <A HREF="<%= $p %>edit/cust_main.cgi?<%= $custnum %>">Edit this customer</A> |
40 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
41 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
42 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT>
44 <SCRIPT TYPE="text/javascript">
45 function areyousure(href, message) {
46 if (confirm(message) == true)
47 window.location.href = href;
51 <SCRIPT TYPE="text/javascript">
55 if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
56 $ban = '<BR><P ALIGN="center">'.
57 '<INPUT TYPE="checkbox" NAME="ban" VALUE="1"> Ban this customer\\\'s ';
58 if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
59 $ban .= 'credit card';
60 } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
61 $ban .= 'ACH account';
66 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> ';
70 <% if ( $curuser->access_right('Cancel customer')
71 && $cust_main->ncancelled_pkgs
74 <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> |
78 <% if ( $conf->exists('deletecustomers')
79 && $curuser->access_right('Delete customer')
82 <A HREF="<%= $p %>misc/delete-customer.cgi?<%= $custnum%>">Delete this customer</A> |
86 <% unless ( $conf->exists('disable_customer_referrals') ) { %>
87 <A HREF="<%= popurl(2) %>edit/cust_main.cgi?referral_custnum=<%= $custnum %>">Refer a new customer</A> |
88 <A HREF="<%= popurl(2) %>search/cust_main.cgi?referral_custnum=<%= $custnum %>">View this customer's referrals</A>
95 my $signupurl = $conf->config('signupurl');
98 This customer's signup URL: <A HREF="<%= $signupurl %>?ref=<%= $custnum %>"><%= $signupurl %>?ref=<%= $custnum %></A><BR><BR>
101 <A NAME="cust_main"></A>
105 <%= include('cust_main/contacts.html', $cust_main ) %>
107 <TD VALIGN="top" STYLE="padding-left: 54px">
108 <%= include('cust_main/misc.html', $cust_main ) %>
109 <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
111 <%= include('cust_main/billing.html', $cust_main ) %>
118 if ( defined $cust_main->dbdef_table->column('comments')
119 && $cust_main->comments =~ /[^\s\n\r]/ ) {
123 <%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
125 <TD BGCOLOR="#ffffff">
126 <PRE><%= encode_entities($cust_main->comments) %></PRE>
132 <% if ( $conf->config('ticket_system') ) { %>
134 <%= include('cust_main/tickets.html', $cust_main ) %>
138 <%= include('cust_main/packages.html', $cust_main ) %>
140 <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
141 <%= include('cust_main/payment_history.html', $cust_main ) %>
144 <%= include('/elements/footer.html') %>