& /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,
&>
Please contact Compliance Solutions for a full list of your product and service codes.
<& /elements/footer-popup.html &>
<%shared>
# populate dropdown
#taxproduct is 7 digits: 4-digit (well, alpha) productcode + 3-digit servicecode
# Description is also two parts, corresponding to those codes, separated with
# a :.
my (@productcodes, @servicecodes);
foreach my $row ( qsearch({
table => 'part_pkg_taxproduct',
select => 'DISTINCT substr(taxproduct, 1, 4) AS productcode ',
hashref => { data_vendor => 'compliance_solutions' },
}))
{
push @productcodes, $row->{productcode};
}
foreach my $row ( qsearch({
table => 'part_pkg_taxproduct',
select => 'DISTINCT substr(taxproduct, 4, 3) AS servicecode ',
hashref => { data_vendor => 'compliance_solutions' },
}))
{
push @servicecodes, $row->{servicecode};
}
%shared>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
$cgi->param('id') =~ /^\w+$/ or die "missing id parameter";
my $id = $cgi->param('id');
my $select_onclick = sub {
my $row = shift;
my $taxnum = $row->taxproductnum;
my $desc = $row->taxproduct . ' ' . $row->description;
"select_taxproduct('$taxnum', '$desc')";
};
my @menubar;
my $title = 'Tax Products';
my $hashref = { data_vendor => 'compliance_solutions' };
#my ($category_code, $taxproduct);
#if ( $cgi->param('category_code') =~ /^(\d+)$/ ) {
# $category_code = $1;
# $taxproduct = $category_code . '%';
#} else {
# $taxproduct = '%';
#}
my $taxproduct = '%';
$hashref->{taxproduct} = { op => 'LIKE', value => $taxproduct };
my $count_query = "SELECT COUNT(*) FROM part_pkg_taxproduct ".
"WHERE data_vendor = 'compliance_solutions' AND ".
"taxproduct LIKE '$taxproduct'";
my @fields = (
'taxproduct',
'description',
# 'note'
);
my @header = (
'Code',
'Description',
# '',
);
my $align = 'lll';
my @link_onclicks = ( $select_onclick, $select_onclick );
%init>