From 8b33800764316232933f5996ac3fe9ea1793d944 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 4 Oct 2007 23:40:51 +0000 Subject: [PATCH] hopefully fix once.pm properly... --- FS/FS/part_event/Condition/once.pm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/FS/FS/part_event/Condition/once.pm b/FS/FS/part_event/Condition/once.pm index bb0fa22a5..adab2432a 100644 --- a/FS/FS/part_event/Condition/once.pm +++ b/FS/FS/part_event/Condition/once.pm @@ -21,15 +21,18 @@ sub condition { 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=>'!=', value=>'failed' }, - 'addl_sql' => ( $opt{'cust_event'}->eventnum =~ /^(\d+)$/ - ? " AND eventnum != $1 " - : '' - ), + my @existing = qsearch( { + 'table' => 'cust_event', + 'hashref' => { + 'eventpart' => $self->eventpart, + 'tablenum' => $tablenum, + #'status' => { op=>'NOT IN', value=>"('failed','new')" }, + 'status' => { op=>'!=', value=>'failed' }, + }, + 'addl_sql' => ( $opt{'cust_event'}->eventnum =~ /^(\d+)$/ + ? " AND eventnum != $1 " + : '' + ), } ); ! scalar(@existing); -- 2.11.0