% if (!$init) { % $init = 1; % } <% $opt{'prefix'} %> <% $opt{'postfix'} %> <%shared> my $init = 0; <%init> my %opt = @_; my $name = $opt{element_name} || $opt{field} || 'taxproductnum'; my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value}; my $description = $opt{'taxproduct_description'}; unless ( $description || ! $value ) { my $part_pkg_taxproduct = qsearchs( 'part_pkg_taxproduct', { 'taxproductnum'=> $value } ); $description = $part_pkg_taxproduct->taxproduct . ' ' . $part_pkg_taxproduct->description if $part_pkg_taxproduct; } my $conf = FS::Conf->new; my $vendor = lc($conf->config('tax_data_vendor')); 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;";