X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=492183d11d6ea0ab76c20df749237ac641a65838;hp=8b6fb0c09df4b07fd9115a1503a6b176be41d394;hb=6412f71a3557249225abf5eb2096ebad1729c585;hpb=3dddb60bd783aaf5fa1fda90a351f1e877b7e19b diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 8b6fb0c09..492183d11 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral @@ -43,8 +43,18 @@ print qq! Delete this customer! if $conf->exists('deletecustomers'); -print '

'; +unless ( $conf->exists('disable_customer_referrals') ) { + print qq! | !, + qq!Refer a new customer!; + + print qq! | !, + qq!View this customer's referrals!; +} + +print '

'; print '
'; print &itable(), ''; @@ -158,6 +168,22 @@ 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->last. ', '. $referring_cust_main->first ). + ''; + } + print ''; + print ''; print '
'; @@ -210,7 +236,9 @@ print '
'; print ''; -if ( defined $cust_main->dbdef_table->column('comments') ) { +if ( defined $cust_main->dbdef_table->column('comments') + && $cust_main->comments ) +{ print "
Comments", &ntable("#cccccc"), "", &ntable("#cccccc",2), '
', $cust_main->comments,
@@ -329,9 +357,15 @@ foreach $bill (@bills) {
 @credits = qsearch('cust_credit',{'custnum'=>$custnum});
 foreach $credit (@credits) {
   my($cref)=$credit->hashref;
+  my($credited)=$credit->credited;
   push @history,
-    $cref->{_date} . "\tCredit #" . $cref->{crednum} . ", (Balance \$" .
-    $cref->{credited} . ") by " . $cref->{otaker} . " - " .
+    $cref->{_date} . "\t" .
+    ($credited ?
+       (qq!!) :
+       "") .
+    "Credit #" .
+    $cref->{crednum} . ", (Balance \$" .
+    $credited . ")" . ($credited ? "" : "") .
     $cref->{reason} . "\t\t\t" . $cref->{amount} . "\t";
 
   my(@refunds)=qsearch('cust_refund',{'crednum'=> $cref->{crednum} } );