),
} );
- scalar(@existing) <= $self->option('run_times');
+ scalar(@existing) < $self->option('run_times');
}
sub condition_sql {
- my( $class, $table ) = @_;
+ my( $class, $table, %opt ) = @_;
my %tablenum = %{ FS::part_event->eventtable_pkey_sql };
+ my $run_times =
+ $class->condition_sql_option_integer('run_times', $opt{'driver_name'});
+
my $existing = "( SELECT COUNT(*) FROM cust_event
WHERE cust_event.eventpart = part_event.eventpart
AND cust_event.tablenum = $tablenum{$table}
AND status != 'failed'
)";
- "$existing <= ". $class->condition_sql_option('run_times');
+ "$existing < $run_times";
}