summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-11-30 22:40:30 -0800
committerMark Wells <mark@freeside.biz>2016-11-30 22:40:30 -0800
commit85d0dbbdb844857f17192c5f0740f63c9681b9e6 (patch)
tree0ed8b1e09c63c28690cd9949b6df01f2881b34ba /httemplate/misc
parentfb4d406cbc74ea6abac58770f81570b4f20d6cb9 (diff)
rework Billsoft interface for new Avalara data format, fix many things, #73063
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/taxproduct.cgi9
1 files changed, 6 insertions, 3 deletions
diff --git a/httemplate/misc/taxproduct.cgi b/httemplate/misc/taxproduct.cgi
index b22849343..1533e8810 100644
--- a/httemplate/misc/taxproduct.cgi
+++ b/httemplate/misc/taxproduct.cgi
@@ -5,13 +5,16 @@ my $vendor = $conf->config('tax_data_vendor');
<%init>
my $term = $cgi->param('term');
warn "taxproduct.cgi?$term"; # XXX debug
-my $search = { table => 'part_pkg_taxproduct' };
+my $search = {
+ table => 'part_pkg_taxproduct',
+ hashref => { 'data_vendor' => $vendor }
+};
if ( $term =~ /^\d+$/ ) {
- $search->{extra_sql} = " WHERE taxproduct LIKE '$term%'";
+ $search->{extra_sql} = " AND taxproduct LIKE '$term%'";
$search->{order_by} = " ORDER BY taxproduct ASC";
} elsif ( length($term) ) {
$term = dbh->quote( lc($term) ); # protect against bad strings
- $search->{extra_sql} = " WHERE POSITION($term IN LOWER(description)) > 0";
+ $search->{extra_sql} = " AND POSITION($term IN LOWER(description)) > 0";
# 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";
}