X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=a76cd36d167eea2d4a6a9c93bfb76e55787ce91c;hp=33e72d864b879babb8bcf25ffc5bcec9b362f7c6;hb=b97ccb2b958567490841cfc93d2c4a401d98cdb0;hpb=f38abb144955686f880a528ed6fe4c9c5453517b diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 33e72d864..a76cd36d1 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -73,7 +73,7 @@ my $r = qq!* !; my @agents = qsearch( 'agent', {} ); #die "No agents created!" unless @agents; -die "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents; +eidiot "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents; my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first if ( scalar(@agents) == 1 ) { print qq!!; @@ -98,11 +98,13 @@ if ( $custnum && ! $conf->exists('editreferrals') ) { print qq!!; } else { my(@referrals) = qsearch('part_referral',{}); - if ( scalar(@referrals) == 1 ) { + if ( scalar(@referrals) == 0 ) { + eidiot "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!!; } else { - print qq!

${r}Referral !; print "