tax engine refactoring for Avalara and Billsoft tax vendors, #25718
[freeside.git] / FS / FS / cust_bill_event.pm
index 7c2ad37..adaa13e 100644 (file)
@@ -83,7 +83,7 @@ points to.  You can ask the object for a copy with the I<hash> method.
 
 sub table { 'cust_bill_event'; }
 
-sub cust_linked { $_[0]->cust_main_custnum; } 
+sub cust_linked { $_[0]->cust_main_custnum || $_[0]->custnum } 
 sub cust_unlinked_msg {
   my $self = shift;
   "WARNING: can't find cust_main.custnum ". $self->custnum.
@@ -201,7 +201,7 @@ sub retriable {
   $self->replace($old);
 }
 
-=item search_sql HASHREF
+=item search_sql_where HASHREF
 
 Class method which returns an SQL WHERE fragment to search for parameters
 specified in HASHREF.  Valid parameters are
@@ -236,7 +236,7 @@ Specifies the user for agent virtualization
 
 =cut
 
-sub search_sql {
+sub search_sql_where {
   my ($class, $params) = @_;
   my @search = ();
 
@@ -304,13 +304,11 @@ sub process_refax {
   process_re_X('fax', @_);
 }
 
-use Storable qw(thaw);
 use Data::Dumper;
-use MIME::Base64;
 sub process_re_X {
   my( $method, $job ) = ( shift, shift );
 
-  my $param = thaw(decode_base64(shift));
+  my $param = shift;
   warn Dumper($param) if $DEBUG;
 
   re_X(
@@ -324,7 +322,7 @@ sub process_re_X {
 sub re_X {
   my($method, $param, $job) = @_;
 
-  my $where = FS::cust_bill_event->search_sql($param);
+  my $where = FS::cust_bill_event->search_sql_where($param);
   $where = " WHERE plan LIKE 'send%'". ( $where ? " AND $where" : "" );
 
   my $from = 'LEFT JOIN part_bill_event USING ( eventpart )'.