such a dumb little thing, but i think that should really do it. whew
authorivan <ivan>
Thu, 4 Oct 2007 23:52:53 +0000 (23:52 +0000)
committerivan <ivan>
Thu, 4 Oct 2007 23:52:53 +0000 (23:52 +0000)
FS/FS/part_event/Condition/once.pm

index adab243..e814ec2 100644 (file)
@@ -22,17 +22,16 @@ sub condition {
   my $tablenum = $object->$obj_pkey();
   
   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 "
-                      : ''
-                  ),
+    'table'     => 'cust_event',
+    'hashref'   => {
+                     'eventpart' => $self->eventpart,
+                     'tablenum'  => $tablenum,
+                     'status'    => { op=>'!=', value=>'failed' },
+                   },
+    'extra_sql' => ( $opt{'cust_event'}->eventnum =~ /^(\d+)$/
+                       ? " AND eventnum != $1 "
+                       : ''
+                   ),
   } );
 
   ! scalar(@existing);