summaryrefslogtreecommitdiff
path: root/FS/FS/part_event.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-03-12 20:24:22 -0700
committerMark Wells <mark@freeside.biz>2012-03-12 20:24:22 -0700
commitfdd00d4549faaa9de8952402f77fa86d0b8b22ee (patch)
treeb45dc5430ace293ad93d8b97b9527420b3558748 /FS/FS/part_event.pm
parent5665d202b0b91bb9ad685c209265b7a3405de768 (diff)
"day-of-month of customer signup" condition, #16827
Diffstat (limited to 'FS/FS/part_event.pm')
-rw-r--r--FS/FS/part_event.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/FS/FS/part_event.pm b/FS/FS/part_event.pm
index 31d2afd..62f16fa 100644
--- a/FS/FS/part_event.pm
+++ b/FS/FS/part_event.pm
@@ -253,7 +253,7 @@ sub templatename {
}
}
-=item targets
+=item targets OPTIONS
Returns all objects (of type C<FS::eventtable>, for this object's
C<eventtable>) eligible for processing under this event, as of right now.
@@ -268,7 +268,8 @@ but can be useful when configuring events.
sub targets {
my $self = shift;
- my $time = time; # $opt{'time'}?
+ my %opt = @_;
+ my $time = $opt{'time'} || time;
my $eventpart = $self->eventpart;
$eventpart =~ /^\d+$/ or die "bad eventpart $eventpart";
@@ -305,8 +306,8 @@ sub targets {
});
my @tested_objects;
foreach my $object ( @objects ) {
- my $cust_event = $self->new_cust_event($object, 'time' => $time);
- next unless $cust_event->test_conditions;
+ my $cust_event = $self->new_cust_event($object);
+ next unless $cust_event->test_conditions('time' => $time);
$object->set('cust_event', $cust_event);
push @tested_objects, $object;