[freeside-commits] branch FREESIDE_3_BRANCH updated. 601c221a20048eb96fa584bda348fda5f7d9f86f

Mark Wells mark at 420.am
Tue Apr 28 13:42:46 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  601c221a20048eb96fa584bda348fda5f7d9f86f (commit)
       via  cad3732387f89248885f4844eec88575e0ce7013 (commit)
      from  3c10215fb8f856e966f22ffaba297ae1c335f5d0 (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 601c221a20048eb96fa584bda348fda5f7d9f86f
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Apr 28 13:40:38 2015 -0700

    improve editing of district taxes, #15089

diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi
index dfbe119..e8c09e4 100755
--- a/httemplate/browse/cust_main_county.cgi
+++ b/httemplate/browse/cust_main_county.cgi
@@ -10,7 +10,9 @@
                            'table'    => 'cust_main_county',
                            'hashref'  => $hashref,
                            'order_by' =>
-                  'ORDER BY country, state, county, city, district, taxclass',
+                              'ORDER BY country, state, county, city, '.
+                              'district, taxclass, '.
+                              "COALESCE(taxname, '')",
                          },
      'count_query'    => $count_query,
      'header'         => \@header,
diff --git a/httemplate/edit/bulk-cust_main_county.html b/httemplate/edit/bulk-cust_main_county.html
index 8e447e5..6b5a7c2 100644
--- a/httemplate/edit/bulk-cust_main_county.html
+++ b/httemplate/edit/bulk-cust_main_county.html
@@ -24,6 +24,20 @@
   </TR>
 % }
 
+% if ( $cities ) {
+  <& /elements/tr-td-label.html, 'label' => 'City' &>
+    <TD BGCOLOR="#dddddd"><% $cities %>
+    </TD>
+  </TR>
+% }
+
+% if ( $districts ) {
+  <& /elements/tr-td-label.html, 'label' => 'District' &>
+    <TD BGCOLOR="#dddddd"><% $districts %>
+    </TD>
+  </TR>
+% }
+
 % if ( $conf->exists('enable_taxclasses') && $taxclasses ) {
   <% include('/elements/tr-td-label.html', 'label' => 'Tax Class' ) %>
     <TD BGCOLOR="#dddddd"><% $taxclasses %>
@@ -112,6 +126,13 @@ my %seen_county = {};
 my @counties = grep !$seen_county{$_}++, map $_->county, @cust_main_county;
 my $counties = join(', ', @counties);
 
+my %seen_city = ( map { $_->city => 1 } @cust_main_county );
+my @cities = grep $_, keys %seen_city;
+my $cities = join(', ', @cities);
+
+my @districts = grep $_, map { $_->district } @cust_main_county;
+my $districts = join(', ', @districts);
+
 my %seen_taxclass = {};
 my @taxclasses = grep !$seen_taxclass{$_}++, map $_->taxclass, @cust_main_county;
 my $taxclasses = join(', ', @taxclasses);
diff --git a/httemplate/edit/process/bulk-cust_main_county.html b/httemplate/edit/process/bulk-cust_main_county.html
index af9e495..b7ff40f 100644
--- a/httemplate/edit/process/bulk-cust_main_county.html
+++ b/httemplate/edit/process/bulk-cust_main_county.html
@@ -49,7 +49,7 @@ foreach my $taxnum ( @taxnum ) {
               qw( taxname tax exempt_amount setuptax recurtax )
         ),
         ( map { $_ => $cust_main_county->get($_) }
-              qw( country state county taxclass ) 
+              qw( country state county city district taxclass ) 
         )
       };
 

commit cad3732387f89248885f4844eec88575e0ce7013
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Apr 28 13:40:04 2015 -0700

    avoid overwriting secondary taxes during district tax updates, #34668

diff --git a/FS/FS/geocode_Mixin.pm b/FS/FS/geocode_Mixin.pm
index 57d8ca0..611b9e5 100644
--- a/FS/FS/geocode_Mixin.pm
+++ b/FS/FS/geocode_Mixin.pm
@@ -236,6 +236,8 @@ sub process_district_update {
   my $class = shift;
   my $id = shift;
 
+  local $DEBUG = 1;
+
   eval "use FS::Misc::Geo qw(get_district); use FS::Conf; use $class;";
   die $@ if $@;
   die "$class has no location data" if !$class->can('location_hash');
@@ -255,6 +257,8 @@ sub process_district_update {
 
     my %hash = map { $_ => $tax_info->{$_} } 
       qw( district city county state country );
+    $hash{'taxname'} = '';
+
     my $old = qsearchs('cust_main_county', \%hash);
     if ( $old ) {
       my $new = new FS::cust_main_county { $old->hash, %$tax_info };

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

Summary of changes:
 FS/FS/geocode_Mixin.pm                             |    4 ++++
 httemplate/browse/cust_main_county.cgi             |    4 +++-
 httemplate/edit/bulk-cust_main_county.html         |   21 ++++++++++++++++++++
 httemplate/edit/process/bulk-cust_main_county.html |    2 +-
 4 files changed, 29 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list