1 package FS::part_event::Condition::has_referral_custnum;
6 use base qw( FS::part_event::Condition );
8 sub description { 'Customer has a referring customer'; }
12 'active' => { 'label' => 'Referring customer is active',
20 my($self, $object) = @_;
22 my $cust_main = $self->cust_main($object);
24 if ( $self->option('active') ) {
26 return 0 unless $cust_main->referral_custnum;
28 #check for no cust_main for referral_custnum? (deleted?)
30 $cust_main->referral_custnum_cust_main->status eq 'active';
34 $cust_main->referral_custnum; # ? 1 : 0;
41 #my( $class, $table ) = @_;
43 "cust_main.referral_custnum IS NOT NULL";
45 #XXX a bit harder to check active status here