texas tax!
[freeside.git] / httemplate / edit / cust_main.cgi
index 39b6ca5..e92abef 100755 (executable)
@@ -85,7 +85,8 @@ if ( scalar(@agents) == 1 ) {
   } @agents) {
       print '<OPTION VALUE="', $agent->agentnum, '"',
       " SELECTED"x($agent->agentnum==$agentnum),
-      ">", $agent->agentnum,": ", $agent->agent;
+      ">". $agent->agent;
+      #">", $agent->agentnum,": ", $agent->agent;
   }
   print "</SELECT>";
 }
@@ -97,7 +98,9 @@ if ( $custnum && ! $conf->exists('editreferrals') ) {
   print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$refnum">!;
 } else {
   my(@referrals) = qsearch('part_referral',{});
-  if ( scalar(@referrals) == 1 ) {
+  if ( scalar(@referrals) == 0 ) {
+    die "You have not created any advertising sources.  You must create at least one advertising source before adding a customer.  Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources.";
+  } elsif ( scalar(@referrals) == 1 ) {
     $refnum ||= $referrals[0]->refnum;
     print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$refnum">!;
   } else {