blob: f7c8d24a6ee1bbf63eff68ad82e2508dfbd9ca69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<% encode_json({ part_pkg_taxproduct => \@part_pkg_taxproduct }) %>\
<%init>
#compliance solutions specific for now, since they asked for a multi-level
# select
#my $sub = $cgi->param('sub');
my( %args ) = $cgi->multi_param('arg');
my @qsearch = (
table => 'part_pkg_taxproduct',
hashref => { 'data_vendor' => $args{'data_vendor'} },
);
my @part_pkg_taxproduct;
if ( $args{category} =~ /^(\w)$/ ) {
my $category = $1;
@part_pkg_taxproduct =
map { $_->taxproduct => $_->description }
qsearch({ @qsearch,
extra_sql => " AND taxproduct LIKE '$category%' ".
" AND length(taxproduct) = 4 ",
});
} elsif ( $args{product_code} =~ /^([A-Z]\d+)$/ ) {
my $product_code = $1;
@part_pkg_taxproduct =
map { $_->taxproductnum. ' '. $_->taxproduct => $_->description }
qsearch({ @qsearch,
extra_sql => " AND taxproduct LIKE '$product_code%'".
" AND length(taxproduct) > 4 ",
});
} else {
die 'neither category nor product_code specified';
}
</%init>
|