[freeside-commits] freeside/httemplate/elements select-terms.html, 1.1, 1.1.2.1
Ivan,,,
ivan at wavetail.420.am
Fri Nov 13 16:08:23 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv23167/httemplate/elements
Modified Files:
Tag: FREESIDE_1_9_BRANCH
select-terms.html
Log Message:
add invoice terms to advanced customer report. dogfood.
Index: select-terms.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-terms.html,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -d -r1.1 -r1.1.2.1
--- select-terms.html 9 Oct 2009 23:59:24 -0000 1.1
+++ select-terms.html 14 Nov 2009 00:08:21 -0000 1.1.2.1
@@ -2,7 +2,18 @@
ID = "invoice_terms"
<% $opt{'disabled'} ? 'DISABLED' : ''%>
>
- <OPTION VALUE=""><% $empty_label %>
+# #false laziness w/select-table.html
+% while ( @pre_options ) {
+% my $pre_opt = shift(@pre_options);
+% my $pre_label = shift(@pre_options);
+% my $selected = # ( ref($value) && $value->{$pre_opt} ) ||
+% ( $curr_value eq $pre_opt );
+ <OPTION VALUE="<% $pre_opt %>"
+ <% $selected ? 'SELECTED' : '' %>
+ ><% $pre_label %>
+% }
+
+ <OPTION VALUE="<% $empty_value %>"><% $empty_label %>
% foreach my $term ( @terms ) {
<OPTION VALUE="<% $term %>" <% $curr_value eq $term ? ' SELECTED' : '' %>><% $term %>
% }
@@ -19,8 +30,12 @@
($conf->config('invoice_default_terms') || 'Payable upon receipt').
')';
+my $empty_value = $opt{'empty_value'} || '';
+
my @terms = ( 'Payable upon receipt',
( map "Net $_", 0, 10, 15, 20, 30, 45, 60 ),
);
+my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : ();
+
</%init>
More information about the freeside-commits
mailing list