#$FS::cust_event::DEBUG = $opt{'l'} if $opt{'l'};
my $conf = new FS::Conf;
+ my $disable_bill = 0;
if ( $conf->exists('disable_cron_billing') ) {
warn "disable_cron_billing set, skipping billing\n" if $debug;
- return;
+ $disable_bill = 1;
}
#we're at now now (and later).
'resetup' => ( $opt{'s'} ? $opt{'s'} : 0 ),
'not_pkgpart' => $opt{'g'}, #$not_pkgpart,
'one_recur' => $opt{'o'},
+ 'no_prepaid' => 1,
);
if ( $opt{'m'} ) {
} else {
my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } );
- $cust_main->bill_and_collect( %args, 'debug' => $debug );
+ if ( $disable_bill ) {
+ $cust_main->collect( %args, 'debug' => $debug );
+ } else {
+ $cust_main->bill_and_collect( %args, 'debug' => $debug );
+ }
}
# generate where_pkg/where_event search clause
###
- my $billtime = day_end($time);
+ my $conf = new FS::Conf;
+ my $billtime = $conf->exists('next-bill-ignore-time') ? day_end($time) : $time;
# select * from cust_main where
my $where_pkg = <<"END";