tax engine refactoring for Avalara and Billsoft tax vendors, #25718
[freeside.git] / httemplate / elements / select-taxproduct.html
index 37a4289..07e5549 100644 (file)
@@ -8,7 +8,7 @@
                            TYPE    = "text"
                            VALUE   = "<% $description %>"
                            SIZE    = "12"
-                           onclick = "overlib( OLiframeContent('<% $p %>/browse/part_pkg_taxproduct.cgi?_type=select&id=<% $name %>&taxproductnum='+document.getElementById('<% $name %>').value, 1000, 400, 'tax_product_popup'), CAPTION, 'Select product', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK); return false;"><% $opt{'postfix'} %>
+                           onClick = "<% $onclick %>"><% $opt{'postfix'} %>
 <%init>
 
 my %opt = @_;
@@ -23,4 +23,9 @@ unless ( $description || ! $value ) {
       if $part_pkg_taxproduct;
 }
 
+my $conf = FS::Conf->new;
+my $vendor = lc($conf->config('enable_taxproducts'));
+my $onclick = $opt{onclick} ||
+              "overlib( OLiframeContent('${p}/browse/part_pkg_taxproduct/$vendor.html?_type=select&id=${name}&taxproductnum='+document.getElementById('${name}').value, 1000, 400, 'tax_product_popup'), CAPTION, 'Select product', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK); return false;";
+
 </%init>