my $part_event = $self->part_event;
my $object = $self->cust_X;
my @conditions = $part_event->part_event_condition;
+ %opt{'cust_event'} = $self;
#no unsatisfied conditions
#! grep ! $_->condition( $object, %opt ), @conditions;
$time = $opt{'time'}; #use this instead of time or $^T
+ $cust_event = $opt{'cust_event'}; #to retreive the cust_event object being tested
+
Return a true value if the condition has been met, and a false value if it has
not.
}
sub condition {
- my($self, $object) = @_;
+ my($self, $object, %opt) = @_;
my $obj_pkey = $object->primary_key;
my $tablenum = $object->$obj_pkey();
my @existing = qsearch( 'cust_event', {
'eventpart' => $self->eventpart,
'tablenum' => $tablenum,
- 'status' => { op=>'NOT IN', value=>"('failed','new')" },
+ #'status' => { op=>'NOT IN', value=>"('failed','new')" },
+ 'status' => { op=>'!=', value=>'failed' },
+ 'addl_sql' => ( $opt{'cust_event'}->eventnum =~ /^(\d+)$/
+ ? " AND eventnum != $1 "
+ : ''
+ ),
} );
! scalar(@existing);