X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=e84fa07568d5600531622840c85df054703ac2c6;hb=e0d75192ce1eefb05689b08961f5009b71063466;hp=6c260bb7d37fa47114536e64796e4915d809bb0c;hpb=51984ac3d3da3006809c6866fdecd4ad83610731;p=freeside.git
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 6c260bb7d..e84fa0756 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -1,9 +1,11 @@
-
<%
+#
+use strict;
use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral
@packages $package @history @bills $bill @credits $credit
- $balance $item @agents @referrals @invoicing_list $n1 $conf );
+ $balance $item @agents @referrals @invoicing_list $n1 $conf
+ $signupurl );
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Date::Format;
@@ -19,13 +21,15 @@ use FS::part_referral;
use FS::agent;
use FS::cust_main;
use FS::cust_refund;
+use FS::cust_bill_pay;
+use FS::cust_credit_bill;
$cgi = new CGI;
&cgisuidsetup($cgi);
$conf = new FS::Conf;
-print $cgi->header( '-expires' => 'now' ), header("Customer View", menubar(
+print header("Customer View", menubar(
'Main Menu' => popurl(2)
));
@@ -42,8 +46,25 @@ print qq! Delete this customer!
if $conf->exists('deletecustomers');
+
+unless ( $conf->exists('disable_customer_referrals') ) {
+ print qq! | !,
+ qq!Refer a new customer!;
+
+ print qq! | !,
+ qq!View this customer's referrals!;
+}
+
print '
';
+my $signupurl = $conf->config('signupurl');
+if ( $signupurl ) {
+print "This customer's signup URL: ".
+ "$signupurl?ref=$custnum
";
+}
+
print '';
print &itable(), '
';
@@ -94,36 +115,36 @@ print '';
&ntable("#cccccc",2),
' |
Contact name | ',
'',
- $cust_main->get("${$pre}last"), ', ', $cust_main->get("${$pre}first"),
+ $cust_main->get("${pre}last"), ', ', $cust_main->get("${pre}first"),
' |
',
'Company | ',
- $cust_main->get("${$pre}company"),
+ $cust_main->get("${pre}company"),
' |
',
'Address | ',
- $cust_main->get("${$pre}address1"),
+ $cust_main->get("${pre}address1"),
' |
',
;
print ' | ',
- $cust_main->get("${$pre}address2"), ' |
'
- if $cust_main->get("${$pre}address2");
+ $cust_main->get("${pre}address2"), ''
+ if $cust_main->get("${pre}address2");
print 'City | ',
- $cust_main->get("${$pre}city"),
+ $cust_main->get("${pre}city"),
' | State | ',
- $cust_main->get("${$pre}state"),
+ $cust_main->get("${pre}state"),
' | Zip | ',
- $cust_main->get("${$pre}zip"), ' |
',
+ $cust_main->get("${pre}zip"), '',
'Country | ',
- $cust_main->get("${$pre}country"),
+ $cust_main->get("${pre}country"),
' |
',
;
print 'Day Phone | ',
'',
- $cust_main->get("${$pre}daytime") || ' ', ' |
',
+ $cust_main->get("${pre}daytime") || ' ', '',
'Night Phone | '.
'',
- $cust_main->get("${$pre}night") || ' ', ' |
',
+ $cust_main->get("${pre}night") || ' ', '',
'Fax | ',
- $cust_main->get("${$pre}fax") || ' ', ' |
',
+ $cust_main->get("${pre}fax") || ' ', '',
'', ""
;
@@ -140,11 +161,11 @@ print '';
@agents = qsearch( 'agent', {} );
unless ( scalar(@agents) == 1 ) {
- $agent = qsearchs('agent',{
- 'agentnum' => $cust_main->agentnum
- } );
+ $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
print ' | Agent | ',
$agent->agentnum, ": ", $agent->agent, ' |
';
+ } else {
+ $agent = $agents[0];
}
@referrals = qsearch( 'part_referral', {} );
unless ( scalar(@referrals) == 1 ) {
@@ -157,13 +178,33 @@ print '';
print ' | Order taker | ',
$cust_main->otaker, ' |
';
+ print 'Referring Customer | ';
+ my $referring_cust_main = '';
+ if ( $cust_main->referral_custnum
+ && ( $referring_cust_main =
+ qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
+ )
+ ) {
+ print ''.
+ $cust_main->referral_custnum. ': '.
+ ( $referring_cust_main->company
+ ? $referring_cust_main->company. ' ('.
+ $referring_cust_main->last. ', '. $referring_cust_main->first.
+ ')'
+ : $referring_cust_main->last. ', '. $referring_cust_main->first
+ ).
+ '';
+ }
+ print ' |
';
+
print '';
print '
';
@invoicing_list = $cust_main->invoicing_list;
print "Billing information (",
- qq!!, "Bill now)",
+ qq!!, "Bill now)",
&ntable("#cccccc"), "", &ntable("#cccccc",2),
' |
Tax exempt | ',
$cust_main->tax ? 'yes' : 'no',
@@ -209,7 +250,33 @@ print ' ';
print ' |
';
-print qq!
Packages !,
+if ( defined $cust_main->dbdef_table->column('comments')
+ && $cust_main->comments )
+{
+ print "
Comments", &ntable("#cccccc"), "",
+ &ntable("#cccccc",2),
+ ' |
', $cust_main->comments,
+ ' |
';
+}
+
+print '';
+
+print '
'.
+ '