+sub process_delete {
+ my( $job, $param ) = @_;
+
+ my $search_sql = FS::cust_event_fee->search_sql_where($param);
+ my $where = $search_sql ? " WHERE $search_sql" : '';
+
+ my @cust_event_fee = qsearch({
+ 'table' => 'cust_event_fee',
+ 'addl_from' => FS::cust_event_fee->join_sql(),
+ 'hashref' => {},
+ 'extra_sql' => $where,
+ });
+
+ my( $num, $last, $min_sec ) = (0, time, 5); #progresbar foo
+ foreach my $cust_event_fee ( @cust_event_fee ) {
+
+ my $error = $cust_event_fee->delete;
+ die $error if $error;
+
+ if ( $job ) { #progressbar foo
+ $num++;
+ if ( time - $min_sec > $last ) {
+ my $error = $job->update_statustext(
+ int( 100 * $num / scalar(@cust_event_fee) )
+ );
+ die $error if $error;
+ $last = time;
+ }
+ }
+
+ }
+
+}
+