[freeside-commits] branch master updated. bc2454b300843ce6194d894ef2889e1053bb3580

Ivan ivan at 420.am
Tue Jul 25 00:19:24 PDT 2017


The branch, master has been updated
       via  bc2454b300843ce6194d894ef2889e1053bb3580 (commit)
      from  e3c22ef5216a090529e99209409a9cc6ff11a1d3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bc2454b300843ce6194d894ef2889e1053bb3580
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jul 25 00:19:23 2017 -0700

    compliance solutions integration: import and use produce/service code catalog, RT#75262

diff --git a/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html b/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html
index 78c1b0a..bbcb687 100644
--- a/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html
+++ b/httemplate/browse/part_pkg_taxproduct/compliance_solutions.html
@@ -8,10 +8,12 @@
 
 $().ready(function() {
 
+
   $('#taxproduct_submit').on('click', function() {
+    var service_code = $('#service_code').val().split(' ');
     select_taxproduct(
-      $('#service_code').val(),
-      $('#service_code').val() + ' ' + $('#service_code :selected').text()
+      service_code[0],
+      service_code[1] + ' ' + $('#service_code :selected').text()
     );
   });
 });
diff --git a/httemplate/misc/xmlhttp-part_pkg_taxproduct.html b/httemplate/misc/xmlhttp-part_pkg_taxproduct.html
index 4cc3a3e..f7c8d24 100644
--- a/httemplate/misc/xmlhttp-part_pkg_taxproduct.html
+++ b/httemplate/misc/xmlhttp-part_pkg_taxproduct.html
@@ -1,4 +1,4 @@
-<% encode_json({ part_pkg_taxproduct => [ map { $_->taxproduct => $_->description } @part_pkg_taxproduct ] }) %>\
+<% encode_json({ part_pkg_taxproduct => \@part_pkg_taxproduct }) %>\
 <%init>
 
 #compliance solutions specific for now, since they asked for a multi-level
@@ -8,24 +8,33 @@
 
 my( %args ) = $cgi->multi_param('arg');
 
-my $hashref = { 'data_vendor' => $args{'data_vendor'} };
+my @qsearch = (
+  table   => 'part_pkg_taxproduct',
+  hashref => { 'data_vendor' => $args{'data_vendor'} },
+);
 
 my @part_pkg_taxproduct;
 if ( $args{category} =~ /^(\w)$/ ) {
+
   my $category = $1;
-  @part_pkg_taxproduct = qsearch({
-    table     => 'part_pkg_taxproduct',
-    hashref   => $hashref,
-    extra_sql => " AND taxproduct LIKE '$category%' AND length(taxproduct) = 4 ",
-  });
+
+  @part_pkg_taxproduct =
+    map { $_->taxproduct => $_->description }
+      qsearch({ @qsearch,
+        extra_sql => " AND taxproduct LIKE '$category%' ".
+                     " AND length(taxproduct) = 4 ",
+      });
 
 } elsif ( $args{product_code} =~ /^([A-Z]\d+)$/ ) {
+
   my $product_code = $1;
-  @part_pkg_taxproduct = qsearch({
-    table     => 'part_pkg_taxproduct',
-    hashref   => $hashref,
-    extra_sql => " AND taxproduct LIKE '$product_code%' AND length(taxproduct) > 4 ",
-  });
+
+  @part_pkg_taxproduct =
+    map { $_->taxproductnum. ' '. $_->taxproduct => $_->description }
+      qsearch({ @qsearch,
+        extra_sql => " AND taxproduct LIKE '$product_code%'".
+                     " AND length(taxproduct) > 4 ",
+      });
 
 } else {
   die 'neither category nor product_code specified';

-----------------------------------------------------------------------

Summary of changes:
 .../part_pkg_taxproduct/compliance_solutions.html  |    6 ++--
 httemplate/misc/xmlhttp-part_pkg_taxproduct.html   |   33 +++++++++++++-------
 2 files changed, 25 insertions(+), 14 deletions(-)




More information about the freeside-commits mailing list