[freeside-commits] branch master updated. 11b4982061aac4c57c1a694cc87f8c1f264ac22a

Ivan ivan at 420.am
Fri Sep 22 13:51:20 PDT 2017


The branch, master has been updated
       via  11b4982061aac4c57c1a694cc87f8c1f264ac22a (commit)
      from  5f7c4a6025b9e3a49bee72dbc06cac37a45e6f10 (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 11b4982061aac4c57c1a694cc87f8c1f264ac22a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Sep 22 13:51:19 2017 -0700

    compliance solutions, RT#77676

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 72079f8..d347c06 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -2335,6 +2335,7 @@ sub tables_hashref {
         'taxratelocationnum', 'serial',  '',     '', '', '', 
         'data_vendor',        'varchar', 'NULL', $char_d, '', '',
         'geocode',            'varchar', '',     20,      '', '', 
+        'district',           'varchar', 'NULL', $char_d, '', '',
         'city',               'varchar', 'NULL', $char_d, '', '',
         'county',             'varchar', 'NULL', $char_d, '', '',
         'state',              'char',    'NULL',       2, '', '', 
@@ -5796,6 +5797,25 @@ sub tables_hashref {
                         ],
     },
 
+    'access_user_session_log' => {
+      'columns' => [
+        'sessionlognum', 'serial', '',      '', '', '',
+        'usernum',          'int', '',      '', '', '',
+        'start_date',  @date_type,              '', '',
+        'last_date',   @date_type,              '', '',
+        'logout_date', @date_type,              '', '',
+        'logout_type',  'varchar', '', $char_d, '', '',
+      ],
+      'primary_key' => 'sessionlognum',
+      'unique'       => [],
+      'index'        => [],
+      'foreign_keys' => [
+                          { columns    => [ 'usernum' ],
+                            table      => 'access_user',
+                          },
+                        ],
+    },
+
     'access_user' => {
       'columns' => [
         'usernum',             'serial',     '',      '', '', '',
@@ -5843,8 +5863,9 @@ sub tables_hashref {
 
     'access_group' => {
       'columns' => [
-        'groupnum',   'serial', '',      '', '', '',
-        'groupname', 'varchar', '', $char_d, '', '',
+        'groupnum',        'serial',     '',      '', '', '',
+        'groupname',      'varchar',     '', $char_d, '', '',
+        'session_timeout',    'int', 'NULL',      '', '', '',
       ],
       'primary_key' => 'groupnum',
       'unique' => [ [ 'groupname' ] ],
diff --git a/FS/FS/TaxEngine/compliance_solutions.pm b/FS/FS/TaxEngine/compliance_solutions.pm
index c21234e..1f0c166 100644
--- a/FS/FS/TaxEngine/compliance_solutions.pm
+++ b/FS/FS/TaxEngine/compliance_solutions.pm
@@ -279,8 +279,10 @@ sub make_taxlines {
     my $tax_rate_location = FS::tax_rate_location->new({
         data_vendor => 'compliance_solutions',
         geocode     => $tax_data->{'geocode'},
-        state       => $tax_data->{'state'},
-        country     => $tax_data->{'country'},
+        district    => $tax_data->{'geo_district'},
+        state       => $tax_data->{'geo_state'},
+        county      => $tax_data->{'geo_county'},
+        country     => 'US',
     });
     $error = $tax_rate_location->find_or_insert;
     die 'error inserting tax_rate_location record for '.  $tax_data->{state}.
diff --git a/FS/FS/tax_rate_location.pm b/FS/FS/tax_rate_location.pm
index ad3618a..e338591 100644
--- a/FS/FS/tax_rate_location.pm
+++ b/FS/FS/tax_rate_location.pm
@@ -111,6 +111,7 @@ sub check {
     $self->ut_numbern('taxratelocationnum')
     || $self->ut_textn('data_vendor')
     || $self->ut_alpha('geocode')
+    || $self->ut_textn('district')
     || $self->ut_textn('city')
     || $self->ut_textn('county')
     || $self->ut_textn('state')
@@ -171,13 +172,9 @@ sub find_or_insert {
 sub existing_search {
   my $self = shift;
 
-  my @unique = qw( data_vendor geocode );
-  push @unique, qw( state country )
-    if $self->data_vendor eq 'compliance_solutions';
-
   qsearchs( 'tax_rate_location',
             { disabled => '',
-              map { $_ => $self->$_ } @unique
+              map { $_ => $self->$_ } qw( data_vendor geocode )
             }
           );
 }
@@ -399,13 +396,14 @@ sub batch_import {
 }
 
 sub _upgrade_data {
-  my $class = shift;
-
-  my $sql = "UPDATE tax_rate_location SET data_vendor = 'compliance_solutions' WHERE data_vendor = 'compliance solutions'";
-
-  my $sth = dbh->prepare($sql) or die $DBI::errstr;
-  $sth->execute() or die $sth->errstr;
-  
+#actually no, we want to leave those records behind now that they're giving us
+# geo_state etc.
+#  my $class = shift;
+#
+#  my $sql = "UPDATE tax_rate_location SET data_vendor = 'compliance_solutions' WHERE data_vendor = 'compliance solutions'";
+#
+#  my $sth = dbh->prepare($sql) or die $DBI::errstr;
+#  $sth->execute() or die $sth->errstr;
 }
 
 =head1 BUGS

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

Summary of changes:
 FS/FS/Schema.pm                         |   25 +++++++++++++++++++++++--
 FS/FS/TaxEngine/compliance_solutions.pm |    6 ++++--
 FS/FS/tax_rate_location.pm              |   22 ++++++++++------------
 3 files changed, 37 insertions(+), 16 deletions(-)




More information about the freeside-commits mailing list