discounts, RT#6679
[freeside.git] / httemplate / elements / tr-select-discount.html
1 % if ( scalar(@{ $opt{'discount'} }) == 0 ) { 
2
3   <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'discountnum' %>" VALUE="">
4
5 % } else { 
6
7   <TR>
8     <TD ALIGN="right"><% $opt{'label'} || '<B>Discount</B>' %></TD>
9     <TD>
10       <% include( '/elements/select-discount.html',
11                     'curr_value' => $discountnum,
12                     %opt,
13                 )
14       %>
15     </TD>
16   </TR>
17
18 % } 
19 <%init>
20
21 my %opt = @_;
22 my $discountnum = $opt{'curr_value'} || $opt{'value'};
23
24 $opt{'discount'} ||= [ qsearch( 'discount', { disabled=>'' } ) ];
25
26 </%init>
27