X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event.pm;h=d15f35b7dd2ccd7a326299119aa8e0d299e35c74;hb=292ef074d01bb925e9a466ed771bf2ac418bb44f;hp=a740bb836e38250c48f3a37f2a495010e8e86736;hpb=d29b455cf176358089f98e2970beaab88195bc62;p=freeside.git diff --git a/FS/FS/part_event.pm b/FS/FS/part_event.pm index a740bb836..d15f35b7d 100644 --- a/FS/FS/part_event.pm +++ b/FS/FS/part_event.pm @@ -9,7 +9,6 @@ use FS::Conf; use FS::part_event_option; use FS::part_event_condition; use FS::cust_event; -use FS::agent; $DEBUG = 0; @@ -169,13 +168,6 @@ sub _rebless { Returns the conditions associated with this event, as FS::part_event_condition objects (see L) -=cut - -sub part_event_condition { - my $self = shift; - qsearch( 'part_event_condition', { 'eventpart' => $self->eventpart } ); -} - =item new_cust_event OBJECT, [ OPTION => VALUE ] Creates a new customer event (see L) for the provided object. @@ -223,13 +215,6 @@ sub reasontext { confess "part_event->reasontext deprecated"; } Returns the associated agent for this event, if any, as an FS::agent object. -=cut - -sub agent { - my $self = shift; - qsearchs('agent', { 'agentnum' => $self->agentnum } ); -} - =item templatename Returns the alternate invoice template name, if any, or false if there is @@ -285,7 +270,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 ); @@ -617,6 +604,22 @@ sub process_initialize { $part_event->initialize; } +sub _upgrade_data { #class method + my ($class, %opts) = @_; + + foreach my $part_event ( + qsearch('part_event', { 'action' => 'cust_bill_realtime_card' }), + qsearch('part_event', { 'action' => 'cust_bill_realtime_check' }), + ) { + + $part_event->action('realtime_auto'); + my $error = $part_event->replace; + die $error if $error; + + } + +} + =back =head1 SEE ALSO