[freeside-commits] branch FREESIDE_3_BRANCH updated. 34add44f0e88aac782264a2febc59b8f48d7ca52

Ivan ivan at 420.am
Sun Nov 2 12:33:26 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  34add44f0e88aac782264a2febc59b8f48d7ca52 (commit)
      from  8dfa2f14821acce6f5c89d447ba49b47339a3d36 (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 34add44f0e88aac782264a2febc59b8f48d7ca52
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Nov 2 12:33:25 2014 -0800

    search for tax-exempt customers, RT#31481

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 02f3b64..e0dfc3c 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -831,6 +831,18 @@ sub search {
     if $params->{'no_POST'};
 
   ##
+  # "tax exempt" checkbox
+  ##
+  push @where, "cust_main.tax = 'Y'"
+    if $params->{'tax'};
+
+  ##
+  # "not tax exempt" checkbox
+  ##
+  push @where, "(cust_main.tax = '' OR cust_main.tax IS NULL )"
+    if $params->{'no_tax'};
+
+  ##
   # dates
   ##
 
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
index a307463..19456e6 100755
--- a/httemplate/search/cust_main.html
+++ b/httemplate/search/cust_main.html
@@ -43,7 +43,7 @@ my %search_hash = ();
 my @scalars = qw (
   agentnum salesnum status address county state zip country
   paydate_year paydate_month invoice_terms
-  no_censustract with_geocode with_email POST no_POST
+  no_censustract with_geocode with_email tax no_tax POST no_POST
   custbatch usernum
   cancelled_pkgs
   cust_fields flattened_pkgs
diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html
index 16a8122..994f950 100755
--- a/httemplate/search/report_cust_main.html
+++ b/httemplate/search/report_cust_main.html
@@ -204,7 +204,35 @@
         }
       }
     </SCRIPT>
- 
+
+% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
+% unless ( @exempt_groups ) { 
+
+%   #falze laziness with With/Without postal mail invoices
+     <TR>
+      <TD ALIGN="right" VALIGN="center"><% mt('Tax exempt') |h %></TD>
+        <TD><INPUT TYPE="checkbox" NAME="tax" ID="tax" onClick="tax_changed();"></TD>
+    </TR>
+
+    <TR>
+      <TD ALIGN="right" VALIGN="center"><% mt('Not tax exempt') |h %></TD>
+        <TD><INPUT TYPE="checkbox" NAME="no_tax" ID="no_tax" onClick="no_tax_changed();"></TD>
+    </TR>
+
+    <SCRIPT TYPE="text/javascript">
+      function  tax_changed() {
+        if ( document.getElementById('tax').checked == true ) {
+          document.getElementById('no_tax').checked = false;
+        }
+      }
+      function no_tax_changed() {
+        if ( document.getElementById('no_tax').checked == true ) {
+          document.getElementById('tax').checked = false;
+        }
+      }
+    </SCRIPT>
+% }
+
     <TR>
       <TD ALIGN="right"><% mt('Invoice terms') |h %></TD>
       <TD>

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

Summary of changes:
 FS/FS/cust_main/Search.pm               |   12 ++++++++++++
 httemplate/search/cust_main.html        |    2 +-
 httemplate/search/report_cust_main.html |   30 +++++++++++++++++++++++++++++-
 3 files changed, 42 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list