X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpart_event.pm;h=d2ec8abb403006d924011814e72c561cc494c770;hb=21b66c72a2442c50461fe9b23e09677d42988596;hp=31d2afd239aeafb969dcbde46efaa366a995939e;hpb=c6e4f9460f44a7440ef2fa7e67ed51dfe40a7668;p=freeside.git diff --git a/FS/FS/part_event.pm b/FS/FS/part_event.pm index 31d2afd23..d2ec8abb4 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, for this object's C) 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"; @@ -284,7 +285,9 @@ sub targets { } # this is the 'event' side - my $join = FS::part_event_condition->join_conditions_sql( $eventtable ); + my $join = FS::part_event_condition->join_conditions_sql( $eventtable, + 'time' => $time + ); my $where = FS::part_event_condition->where_conditions_sql( $eventtable, 'time' => $time ); @@ -381,9 +384,10 @@ sub eventtable_labels { 'cust_pkg' => 'Package', 'cust_bill' => 'Invoice', 'cust_main' => 'Customer', + 'cust_pay' => 'Payment', 'cust_pay_batch' => 'Batch payment', 'cust_statement' => 'Statement', #too general a name here? "Invoice group"? - 'svc_acct' => 'Login service', + 'svc_acct' => 'Account service (svc_acct)', ; \%hash @@ -420,6 +424,7 @@ sub eventtable_pkey { 'cust_main' => 'custnum', 'cust_bill' => 'invnum', 'cust_pkg' => 'pkgnum', + 'cust_pay' => 'paynum', 'cust_pay_batch' => 'paybatchnum', 'cust_statement' => 'statementnum', 'svc_acct' => 'svcnum', @@ -582,6 +587,7 @@ sub actions { ( map { $_ => $actions{$_} } sort { $actions{$a}->{'default_weight'}<=>$actions{$b}->{'default_weight'} } + # || $actions{$a}->{'description'} cmp $actions{$b}->{'description'} } $class->all_actions( $eventtable ) );