sub option_fields {
(
- 'run_times' => { label=>'Interval', type=>'text', value=>'1', },
+ 'run_times' => { label=>'Number of times', type=>'text', value=>'1', },
);
}
),
} );
- 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";
}