finish package location tax reporing, RT#4499
[freeside.git] / FS / FS / cust_bill_pkg.pm
index 4e7141b..d0c51cf 100644 (file)
@@ -152,6 +152,20 @@ sub insert {
     }
   }
 
+  my $tax_location = $self->get('cust_bill_pkg_tax_location');
+  if ( $tax_location ) {
+    foreach my $cust_bill_pkg_tax_location ( @$tax_location ) {
+      $cust_bill_pkg_tax_location->billpkgnum($self->billpkgnum);
+      warn $cust_bill_pkg_tax_location;
+      $error = $cust_bill_pkg_tax_location->insert;
+      warn $error;
+      if ( $error ) {
+        $dbh->rollback if $oldAutoCommit;
+        return $error;
+      }
+    }
+  }
+
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
   '';