summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-discount.html
blob: 4ff8d135731b886767884474280c8d96afa2d5e0 (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
% if ( scalar(@{ $opt{'discount'} }) == 0 ) { 

  <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'discountnum' %>" VALUE="">

% } else { 

  <TR>
    <TD ALIGN="right"><% $opt{'label'} || '<B>Discount</B>' %></TD>
    <TD>
      <% include( '/elements/select-discount.html',
                    'curr_value' => $discountnum,
                    %opt,
                )
      %>
    </TD>
  </TR>

% } 
<%init>

my %opt = @_;
my $discountnum = $opt{'curr_value'} || $opt{'value'};

$opt{'discount'} ||= [ qsearch( 'discount', { disabled=>'' } ) ];

</%init>