summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-part_referral.html
blob: 22933738535eb9090d647d1fb30bd6c5d2ad72c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
%
%  my( $refnum, %opt ) = @_;
%
%  $opt{'part_referrals'} ||=
%    [ FS::part_referral->all_part_referral( 1 ) ]; #1: include global
%
%  my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
%
%
% if ( scalar( @{$opt{'part_referrals'}} ) == 0 ) {
   <P><FONT SIZE="+1" COLOR="#ff0000">You have not created any advertising sources.  You must create at least one advertising source before adding a customer.  Go to <A HREF="<% popurl(2) %>browse/part_referral.html">advertising source listing</A> and create one or more advertising sources.</FONT>
%   } elsif ( scalar( @{$opt{'part_referrals'}} ) == 1 ) {
%


     <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $opt{'part_referrals'}->[0]->refnum %>">
% } else { 


     <TR>
       <TH ALIGN="right"><%$r%>Advertising source</TH>
       <TD>
         <% include( '/elements/select-part_referral.html', $refnum,
                        'part_referrals' => $opt{'part_referrals'},
                    )
         %>
       </TD>
     </TR>
% }