sub _get_employees {
$main::lxdebug->enter_sub();
- my ($self, $dbh, $key) = @_;
-
- $key = "all_employees" unless ($key);
- $self->{$key} =
- selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee|);
-
- $main::lxdebug->leave_sub();
-}
+ my ($self, $dbh, $default_key, $key) = @_;
-sub _get_salesmen {
- $main::lxdebug->enter_sub();
-
- my ($self, $dbh, $key) = @_;
-
- $key = "all_salesmen" unless ($key);
- $self->{$key} =
- selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee|);
+ $key = $default_key unless ($key);
+ $self->{$key} = selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee ORDER BY name|);
$main::lxdebug->leave_sub();
}
$key = "all_customers" unless ($key);
- my $query = qq|SELECT * FROM customer|;
+ my $query = qq|SELECT * FROM customer ORDER BY name|;
$self->{$key} = selectall_hashref_query($self, $dbh, $query);
$key = "all_vendors" unless ($key);
- my $query = qq|SELECT * FROM vendor|;
+ my $query = qq|SELECT * FROM vendor ORDER BY name|;
$self->{$key} = selectall_hashref_query($self, $dbh, $query);
$key = "all_departments" unless ($key);
- my $query = qq|SELECT * FROM department|;
+ my $query = qq|SELECT * FROM department ORDER BY description|;
$self->{$key} = selectall_hashref_query($self, $dbh, $query);
}
if ($params{"employees"}) {
- $self->_get_employees($dbh, $params{"employees"});
+ $self->_get_employees($dbh, "all_employees", $params{"employees"});
}
if ($params{"salesmen"}) {
- $self->_get_salesmen($dbh, $params{"salesmen"});
+ $self->_get_employees($dbh, "all_salesmen", $params{"salesmen"});
}
if ($params{"business_types"}) {