use base qw( FS::part_event::Condition );
-sub description { "Don't run this event again after it has completed sucessfully"; }
+sub description { "Don't run this event again after it has completed successfully"; }
sub implicit_flag { 10; }
my $obj_pkey = $object->primary_key;
my $tablenum = $object->$obj_pkey();
-
+
my @existing = qsearch( {
'table' => 'cust_event',
'hashref' => {
my %tablenum = %{ FS::part_event->eventtable_pkey_sql };
- "0 = ( SELECT COUNT(*) FROM cust_event
- WHERE cust_event.eventpart = part_event.eventpart
- AND cust_event.tablenum = $tablenum{$table}
- AND status != 'failed'
- )
+ "NOT EXISTS ( SELECT 1 FROM cust_event
+ WHERE cust_event.eventpart = part_event.eventpart
+ AND cust_event.tablenum = $tablenum{$table}
+ AND status != 'failed'
+ LIMIT 1
+ )
";
}