-<%
- my( $agentnum, %opt ) = @_;
-
- my %select_opt = ();
- $select_opt{'records'} = $opt{'agents'}
- if $opt{'agents'};
-
-%><%= include( '/elements/select-table.html',
+%
+% my( $agentnum, %opt ) = @_;
+%
+% $opt{'records'} = delete $opt{'agents'}
+% if $opt{'agents'};
+%
+%
+<% include( '/elements/select-table.html',
'table' => 'agent',
'name_col' => 'agent',
'value' => $agentnum,
'empty_label' => 'all',
'hashref' => { 'disabled' => '' },
'extra_sql' => ' AND '.
- $FS::CurrentUser::CurrentUser->agentnums_sql,
- %select_opt,
+ $FS::CurrentUser::CurrentUser->agentnums_sql.
+ ' ORDER BY agent',
+ %opt,
)
%>