X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpart_event%2FCondition%2Fonce.pm;fp=FS%2FFS%2Fpart_event%2FCondition%2Fonce.pm;h=bb0fa22a54f51a9fb139c8a3bfb60b6fbfc8c55c;hb=5495c7c68eb78c00a3c38da89fab7c7f98911927;hp=ba3ccbb61151e1ffb566959881090a4288b2894a;hpb=4688c4a55a51c4ce2100c1c98e7e650eb77ac95d;p=freeside.git diff --git a/FS/FS/part_event/Condition/once.pm b/FS/FS/part_event/Condition/once.pm index ba3ccbb61..bb0fa22a5 100644 --- a/FS/FS/part_event/Condition/once.pm +++ b/FS/FS/part_event/Condition/once.pm @@ -16,7 +16,7 @@ sub remove_warning { } sub condition { - my($self, $object) = @_; + my($self, $object, %opt) = @_; my $obj_pkey = $object->primary_key; my $tablenum = $object->$obj_pkey(); @@ -24,7 +24,12 @@ sub condition { 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);