[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 59009ed79364284a270477255e7417667a801866

Mark Wells mark at 420.am
Thu Apr 18 16:47:31 PDT 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  59009ed79364284a270477255e7417667a801866 (commit)
       via  12a3d3ad7798abc90c2076dc314e5ab538a9d064 (commit)
      from  351fb8da86c1c20e0f672b3262850d14f756bedf (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 59009ed79364284a270477255e7417667a801866
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Apr 18 16:45:53 2013 -0700

    option to show district on 2.3 tax report, #22137

diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi
index 248f6c5..120768d 100755
--- a/httemplate/search/report_tax.cgi
+++ b/httemplate/search/report_tax.cgi
@@ -752,7 +752,12 @@ sub getlabel {
     $label = $r->country;
     $label = $r->state.", $label" if $r->state;
     $label = $r->county." county, $label" if $r->county;
-    $label = $r->city. ", $label" if $r->city && $cgi->param('show_cities');
+    if ( $cgi->param('show_cities') and $r->city ) {
+      $label = $r->city . ", $label";
+      if ( $cgi->param('show_districts') and $r->district ) {
+        $label = '#' . $r->district . ", $label";
+      }
+    }
     $label = "$label (". $r->taxclass. ")"
       if $r->taxclass
       && $cgi->param('show_taxclasses')
diff --git a/httemplate/search/report_tax.html b/httemplate/search/report_tax.html
index 2ab0e0b..8a207aa 100755
--- a/httemplate/search/report_tax.html
+++ b/httemplate/search/report_tax.html
@@ -34,9 +34,21 @@
 
 %    if ( $city ) {
    <TR>
-     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_cities" VALUE="1"></TD>
+     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_cities" VALUE="1" onclick="toggle_show_cities(this)"></TD>
      <TD>Show cities</TD>
    </TR>
+   <TR>
+     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_districts" VALUE="1" DISABLED></TD>
+     <TD>Show districts</TD>
+   </TR>
+  <SCRIPT TYPE="text/javascript">
+  function toggle_show_cities() {
+    what = document.getElementsByName('show_cities')[0];
+    what.form.show_districts.disabled = !what.checked;
+    what.form.show_districts.checked  = what.checked;
+  }
+  toggle_show_cities();
+  </SCRIPT>
 % } 
 
 %    if ( $conf->exists('enable_taxclasses') ) {

commit 12a3d3ad7798abc90c2076dc314e5ab538a9d064
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Apr 18 16:08:51 2013 -0700

    use cust_main.district for tax calculation based on service address, #21404

diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index 8f7038f..e351285 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -1225,6 +1225,8 @@ sub _handle_taxes {
           ? 'ship_'
           : '';
         %taxhash = map { $_ => $self->get("$prefix$_") } @loc_keys;
+        # special case--there's no 'ship_district' field
+        $taxhash{'district'} = $self->get('district');
       }
 
       $taxhash{'taxclass'} = $part_pkg->taxclass;

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

Summary of changes:
 FS/FS/cust_main/Billing.pm        |    2 ++
 httemplate/search/report_tax.cgi  |    7 ++++++-
 httemplate/search/report_tax.html |   14 +++++++++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list