4 my $conf = new FS::Conf;
8 foreach my $part_svc ( qsearch('part_svc',{}) ) {
9 $uiview{$part_svc->svcpart} = $p. "view/". $part_svc->svcdb . ".cgi";
10 $uiadd{$part_svc->svcpart}= $p. "edit/". $part_svc->svcdb . ".cgi";
15 <%= header("Customer View", menubar(
19 <STYLE TYPE="text/css">
20 .package TH { font-size: medium }
21 .package TR { font-size: smaller }
22 .package .provision { font-weight: bold }
27 die "No customer specified (bad URL)!" unless $cgi->keywords;
28 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
31 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
32 die "Customer not found!" unless $cust_main;
34 print qq!<A HREF="${p}edit/cust_main.cgi?$custnum">Edit this customer</A>!;
39 function areyousure(href, message) {
40 if (confirm(message) == true)
41 window.location.href = href;
47 print qq! | <A HREF="javascript:areyousure('${p}misc/cust_main-cancel.cgi?$custnum', 'Perminantly delete all services and cancel this customer?')">!.
48 'Cancel this customer</A>'
49 if $cust_main->ncancelled_pkgs;
51 print qq! | <A HREF="${p}misc/delete-customer.cgi?$custnum">!.
52 'Delete this customer</A>'
53 if $conf->exists('deletecustomers');
55 unless ( $conf->exists('disable_customer_referrals') ) {
56 print qq! | <A HREF="!, popurl(2),
57 qq!edit/cust_main.cgi?referral_custnum=$custnum">!,
58 qq!Refer a new customer</A>!;
60 print qq! | <A HREF="!, popurl(2),
61 qq!search/cust_main.cgi?referral_custnum=$custnum">!,
62 qq!View this customer's referrals</A>!;
67 my $signupurl = $conf->config('signupurl');
69 print "This customer's signup URL: ".
70 "<a href=\"$signupurl?ref=$custnum\">$signupurl?ref=$custnum</a><BR><BR>";
75 <A NAME="cust_main"></A>
79 <%= include('cust_main/contacts.html', $cust_main ) %>
82 <%= include('cust_main/misc.html', $cust_main ) %>
83 <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
85 <%= include('cust_main/billing.html', $cust_main ) %>
92 if ( defined $cust_main->dbdef_table->column('comments')
93 && $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 <% if ( $conf->config('ticket_system') ) { %>
108 <%= include('cust_main/tickets.html', $cust_main ) %>
112 <%= include('cust_main/packages.html', $cust_main ) %>
114 <% if ( $conf->config('payby-default') ne 'HIDE' ) { %>
115 <%= include('cust_main/payment_history.html', $cust_main ) %>