[freeside-commits] branch FREESIDE_4_BRANCH updated. e1b3d8c0c08dd559ea7c18c1b53f2a79168c8627

Ivan Kohler ivan at freeside.biz
Fri Nov 17 15:19:17 PST 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  e1b3d8c0c08dd559ea7c18c1b53f2a79168c8627 (commit)
      from  c5bc1149712b49edb440db3f767212df86e92136 (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 e1b3d8c0c08dd559ea7c18c1b53f2a79168c8627
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Nov 17 15:19:16 2017 -0800

    compliance solutions integration: always send a zip, whatever zip we have, RT#78660, RT#75262

diff --git a/FS/FS/TaxEngine/compliance_solutions.pm b/FS/FS/TaxEngine/compliance_solutions.pm
index 33b6a3ef1..2cb9cb551 100644
--- a/FS/FS/TaxEngine/compliance_solutions.pm
+++ b/FS/FS/TaxEngine/compliance_solutions.pm
@@ -140,18 +140,26 @@ sub build_input_item {
         " recurring charge\n"
         if !$taxproduct;
 
-    # when billing on cancellation there are no units
-    my $units = $self->{cancel} ? 0 : $cust_bill_pkg->units;
-    unshift @items, {
+    my %item = (
       $self->generic_item($cust_bill, $cust_main),
       record_type     => 'S',
       unique_id       => 'cust_bill_pkg '. $cust_bill_pkg->billpkgnum. ' recur',
       charge_amount   => $recur_without_usage,
-      location_a      => $cust_bill_pkg->tax_location->zip,
       productcode     => substr($taxproduct,0,4),
       servicecode     => substr($taxproduct,4,3),
-      units           => $units,
-    };
+    );
+
+    # when billing on cancellation there are no units
+    $item{units} = $self->{cancel} ? 0 : $cust_bill_pkg->units;
+
+    my $location =  $cust_bill_pkg->tax_location
+                 || ( $conf->exists('tax-ship_address')
+                        ? $cust_main->ship_location
+                        : $cust_main->bill_location
+                    );
+    $item{location_a} = $location->zip;
+
+    unshift @items, \%item;
   }
 
   ###
@@ -167,16 +175,24 @@ sub build_input_item {
         " setup charge\n"
         if !$taxproduct;
 
-    unshift @items, {
+    my %item = (
       $self->generic_item($cust_bill, $cust_main),
       record_type     => 'S',
       unique_id       => 'cust_bill_pkg '. $cust_bill_pkg->billpkgnum. ' setup',
       charge_amount   => $cust_bill_pkg->setup,
-      location_a      => $cust_bill_pkg->tax_location->zip,
       productcode     => substr($taxproduct,0,4),
       servicecode     => substr($taxproduct,4,3),
       units           => $cust_bill_pkg->units,
-    };
+    );
+
+    my $location =  $cust_bill_pkg->tax_location
+                 || ( $conf->exists('tax-ship_address')
+                        ? $cust_main->ship_location
+                        : $cust_main->bill_location
+                    );
+    $item{location_a} = $location->zip;
+
+    unshift @items, \%item;
   }
 
   return @items;

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

Summary of changes:
 FS/FS/TaxEngine/compliance_solutions.pm | 34 ++++++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list