tax engine refactoring for Avalara and Billsoft tax vendors, #25718
[freeside.git] / httemplate / elements / select-table.html
index 9f26a35..0b04fee 100644 (file)
@@ -70,6 +70,7 @@ Example:
         NAME = "<% $opt{'element_name'} || $opt{'field'} || $key %>"
         ID   = "<% $opt{'id'} || $key %>"
         <% $onchange %>
+        <% $size %>
         <% $opt{'element_etc'} %>
 >
 
@@ -88,10 +89,12 @@ Example:
     <OPTION VALUE=""><% $opt{'empty_label'} || 'all' %>
 % }
 
-% foreach my $record ( sort {    $a->$name_col() cmp $b->$name_col()
-%                             || $a->$key()      <=> $b->$key()
-%                           }
-%                           @records
+% foreach my $record ( 
+% # we have the order_by parameter for this
+% #sort {    $a->$name_col() cmp $b->$name_col()
+% #                           || $a->$key()      <=> $b->$key()
+% #                         }
+%                          @records
 %                    )
 % {
 %   my $recvalue = $record->$key();
@@ -173,7 +176,8 @@ if ( $opt{'agent_virt'} ) {
 
 my @records = ();
 if ( $opt{'records'} ) {
-  @records = @{ $opt{'records'} };
+  @records = sort { $a->get($name_col) cmp $b->get($name_col) }
+             @{ $opt{'records'} };
 } else {
   @records = qsearch( {
     'table'     => $opt{'table'},
@@ -212,4 +216,6 @@ unless (    !ref($value) && $value < 1 # !$value #ignore negatives too
 my @pre_options  = $opt{pre_options}  ? @{ $opt{pre_options} } : ();
 my @post_options = $opt{post_options} ? @{ $opt{post_options} } : ();
 
+my $size = $opt{'size'} ? 'SIZE=' . $opt{'size'} : '';
+
 </%init>