1 <& /elements/header-popup.html, { title => 'Select tax product' } &>
3 <table class="inv" width="100%">
4 <& /elements/tr-select-table.html,
5 'label' => 'Tax product',
6 'field' => 'taxproductnum',
7 'table' => 'part_pkg_taxproduct',
8 'hashref' => { data_vendor => 'avalara' },
9 'name_col' => 'taxproduct', # for sorting
10 'label_callback' => $label_callback,
11 'curr_value' => $taxproductnum,
12 'empty_label' => 'none',
13 'onchange' => 'select_onchange',
16 <table class="inv" width="100%">
18 <td style="border-top: 1px solid #7e0079; text-align: center" colspan=2>
19 Add a new tax product</td>
22 <td style="text-align: right">Avalara tax code</td>
23 <td><input name="taxproduct" size=8></td>
26 <td style="text-align: right">Description</td>
27 <td><input name="description" size=20></td>
30 <td colspan="2" style="text-align: center">
31 <input type="button" onclick="add_new()" value="Add" />
36 <SCRIPT TYPE="text/javascript">
37 function select_onchange() {
38 var select = document.forms['myform']['taxproductnum'];
39 parent.document.getElementById('<% $id %>').value = select.value;
40 parent.document.getElementById('<% $id %>_description').value =
41 select.options[select.selectedIndex].text;
45 parent.document.getElementById('<% $id %>').value = -1;
46 parent.document.getElementById('<% $id %>_description').value =
47 document.forms['myform']['taxproduct'].value + ' ' +
48 document.forms['myform']['description'].value;
56 my $conf = new FS::Conf;
62 unless $FS::CurrentUser::CurrentUser->access_right('Edit package definitions');
64 # id: where to put the taxproductnum (in the parent document) after the user
66 $cgi->param('id') =~ /^([ \w]+)$/
67 or die "id parameter required";
70 # current value of taxproductnum
71 my $taxproductnum = '';
72 if ($cgi->param('taxproductnum') =~ /^(\d+)$/) {
76 my $label_callback = sub {
77 my $part_pkg_taxproduct = shift;
78 join(' ', $part_pkg_taxproduct->taxproduct,
79 $part_pkg_taxproduct->description);