my $check_freq = $opt{'check_freq'} || '1d';
- $FS::cust_main::DEBUG = 1 if $opt{'v'};
- $FS::cust_main::DEBUG = $opt{'l'} if $opt{'l'};
+ my $debug = 0;
+ $debug = 1 if $opt{'v'};
+ $debug = $opt{'l'} if $opt{'l'};
+
+ $FS::cust_main::DEBUG = $debug;
#$FS::cust_event::DEBUG = $opt{'l'} if $opt{'l'};
-
+
my %search = ();
$search{'payby'} = $opt{'p'} if $opt{'p'};
$search{'agentnum'} = $opt{'a'} if $opt{'a'};
)
)
END
-
+
my $where_event = join(' OR ', map {
my $eventtable = $_;
my $extra_sql = ( scalar(%search) ? ' AND ' : ' WHERE ' ).
"( $where_pkg OR $where_event )";
-
+
my @cust_main;
if ( @ARGV ) {
@cust_main = map { qsearchs('cust_main', { custnum => $_, %search } ) } @ARGV
}
- my($cust_main,%saw);
- foreach $cust_main ( @cust_main ) {
+ foreach my $cust_main ( @cust_main ) {
if ( $opt{'m'} ) {
'secure' => 'Y',
};
my $error = $queue->insert(
- 'custnum' => $cust_main->custnum,
+ 'custnum' => $cust_main->custnum,
'time' => $time,
'invoice_time' => $invoice_time,
'check_freq' => $check_freq,
'invoice_time' => $invoice_time,
'check_freq' => $check_freq,
'resetup' => $opt{'s'},
+ 'debug' => $debug,
);
}
-
+
}
}