X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg_taxproduct%2Fcompliance_solutions.html;fp=httemplate%2Fbrowse%2Fpart_pkg_taxproduct%2Fcompliance_solutions.html;h=78c1b0a1d8cd40d38113b929026cf239453549ad;hb=07df8db4a07137e678a36b37070721566955295c;hp=cf07b31890465906c7c8cfbc0a38fb80da97fd0f;hpb=67d171a04ecbccbfd7d5fc2f1be2810299008c15;p=freeside.git
diff --git a/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html b/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html
index cf07b3189..78c1b0a1d 100644
--- a/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html
+++ b/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html
@@ -1,115 +1,153 @@
-<& /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,
-&>
+<& /elements/header-popup.html, 'Select tax product' &>
+
+<& '/elements/xmlhttp.html',
+ 'url' => $fsurl.'misc/xmlhttp-part_pkg_taxproduct.html',
+ 'subs' => [ 'get_part_pkg_taxproduct'] &>
+
-
-Please contact Compliance Solutions for a full list of your product and service codes.
+function jopt(what,value,text) {
+ var optionName = new Option(text, value, false, false);
+ what.append(optionName);
+}
+
+function category_changed(what) {
+ var category = what.options[what.selectedIndex].value;
+
+ if ( category.length == 0 ) {
+ $('#product_code').empty();
+ $('#service_code').empty();
+ $('#taxproduct_submit').prop('disabled', true);
+ return;
+ }
+
+ get_part_pkg_taxproduct(
+ 'data_vendor', 'compliance_solutions', 'category', category,
+ function (data) {
+
+ $('#product_code').empty();
+ $('#service_code').empty();
+ $('#taxproduct_submit').prop('disabled', true);
+
+ var reply = JSON.parse(data);
+
+ jopt( $('#product_code'), '', 'Select product code' );
+
+ var part_pkg_taxproduct = reply.part_pkg_taxproduct;
+ for ( var s = 0; s < part_pkg_taxproduct.length; s=s+2 ) {
+ var product_code = part_pkg_taxproduct[s];
+ var description = part_pkg_taxproduct[s+1];
+ jopt( $('#product_code'), product_code, description );
+ }
+
+ },
+ );
+
+}
+
+function product_code_changed(what) {
+ var product_code = what.options[what.selectedIndex].value;
+
+ if ( product_code.length == 0 ) {
+ $('#service_code').empty();
+ $('#taxproduct_submit').prop('disabled', true);
+ return;
+ }
+
+ get_part_pkg_taxproduct(
+ 'data_vendor', 'compliance_solutions', 'product_code', product_code,
+ function (data) {
+
+ $('#service_code').empty();
+ $('#taxproduct_submit').prop('disabled', true);
+
+ jopt( $('#service_code'), '', 'Select service code' );
-