[freeside-commits] freeside/httemplate/elements tr-select-discount.html, NONE, 1.1 select-discount.html, NONE, 1.1

Ivan,,, ivan at wavetail.420.am
Sat Jan 30 00:55:13 PST 2010


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv11863/httemplate/elements

Added Files:
	tr-select-discount.html select-discount.html 
Log Message:
discounts, RT#6679

--- NEW FILE: select-discount.html ---
<% include( '/elements/select-table.html',
                 'table'       => 'discount',
                 'name_col'    => 'description',
                 'order_by'    => 'ORDER BY discountnum', #XXX weight
                 'value'       => $discountnum,
                 'empty_label' => '(none)',
                 'hashref'     => { 'disabled' => '' },
                 %opt,
             )
%>
<%init>

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

$opt{'records'} = delete $opt{'discount'}
  if $opt{'discount'};

</%init>


--- NEW FILE: tr-select-discount.html ---
% 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>




More information about the freeside-commits mailing list