1 package FS::part_event::Condition::has_referral_pkgpart;
2 use base qw( FS::part_event::Condition );
4 #maybe i should be incorporated in has_referral_custnum
8 sub description { 'Customer has a referring customer with uncancelled specific package(s)'; }
12 'if_pkgpart' => { 'label' => 'Only packages: ',
13 'type' => 'select-part_pkg',
20 my($self, $object, %opt) = @_;
22 my $cust_main = $self->cust_main($object);
24 return 0 unless $cust_main->referral_custnum;
26 my $if_pkgpart = $self->option('if_pkgpart') || {};
27 grep $if_pkgpart->{ $_->pkgpart },
28 $cust_main->referral_custnum_cust_main->ncancelled_pkgs;