my $search = {
table => 'part_pkg_taxproduct',
hashref => { 'data_vendor' => $vendor }
};
my $search = {
table => 'part_pkg_taxproduct',
hashref => { 'data_vendor' => $vendor }
};
$search->{order_by} = " ORDER BY taxproduct ASC";
} elsif ( length($term) ) {
$term = dbh->quote( lc($term) ); # protect against bad strings
$search->{order_by} = " ORDER BY taxproduct ASC";
} elsif ( length($term) ) {
$term = dbh->quote( lc($term) ); # protect against bad strings
# and sort by how close to the beginning of the string it is
$search->{order_by} = " ORDER BY POSITION($term IN LOWER(description)) ASC, LOWER(description) ASC, taxproduct ASC";
}
# and sort by how close to the beginning of the string it is
$search->{order_by} = " ORDER BY POSITION($term IN LOWER(description)) ASC, LOWER(description) ASC, taxproduct ASC";
}
my @taxproducts = qsearch($search);
my @results = map {
{ label => $_->taxproduct . ' ' . $_->description,
value => $_->taxproductnum }
} @taxproducts;
my @taxproducts = qsearch($search);
my @results = map {
{ label => $_->taxproduct . ' ' . $_->description,
value => $_->taxproductnum }
} @taxproducts;