& /elements/header-popup.html, $title &>
<& /browse/elements/browse.html,
'name_singular' => 'tax product',
'html_form' => include('.form', $category_code),
'query' => {
'table' => 'part_pkg_taxproduct',
'hashref' => $hashref,
'order_by' => 'ORDER BY taxproduct',
},
'count_query' => $count_query,
'header' => \@header,
'fields' => \@fields,
'align' => $align,
'links' => [],
'link_onclicks' => \@link_onclicks,
'nohtmlheader' => 1,
'disable_total' => 1,
&>
<%shared>
# populate dropdown
# taxproduct is 6 digits: 2-digit category code + 4-digit detail code.
# Description is also two parts, corresponding to those codes, separated with
# a :.
my (@category_codes, @taxproduct_codes, %category_labels, %taxproduct_labels);
foreach my $row ( qsearch({
table => 'part_pkg_taxproduct',
select => 'DISTINCT substr(taxproduct, 1, 2) AS code, '.
"substring(description from '(.*):') AS label",
hashref => { data_vendor => 'suretax' },
}))
{
$category_labels{$row->get('code')} = $row->get('label');
}
@category_codes = sort {$a <=> $b} keys %category_labels;
%shared>
<%def .form>
% my ($category_code) = @_;