diff options
| -rw-r--r-- | FS/FS/Conf.pm | 6 | ||||
| -rw-r--r-- | FS/FS/Cron/bill.pm | 6 | ||||
| -rwxr-xr-x | FS/bin/freeside-daily | 1 | 
3 files changed, 13 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 84f06590d..5afa142e2 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -3248,6 +3248,12 @@ worry that config_items is freeside-specific and icky.      'type'        => 'select-pkg_class',    }, +  { +    'key'         => 'disable_cron_billing', +    'section'     => 'billing', +    'description' => 'Disable billing and collection from being run by freeside-daily and freeside-monthly, while still allowing other actions to run, such as notifications and backup.', +    'type'        => 'checkbox', +  },    { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },    { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" }, diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm index dbb6c66c2..27011c69f 100644 --- a/FS/FS/Cron/bill.pm +++ b/FS/FS/Cron/bill.pm @@ -34,6 +34,12 @@ sub bill {    $FS::cust_main::DEBUG = $debug;    #$FS::cust_event::DEBUG = $opt{'l'} if $opt{'l'}; +  my $conf = new FS::Conf; +  if ( $conf->exists('disable_cron_billing') ) { +    warn "disable_cron_billing set, skipping billing\n" if $debug; +    return; +  } +    #we're at now now (and later).    $opt{'time'} = $opt{'d'} ? str2time($opt{'d'}) : $^T;    $opt{'time'} += $opt{'y'} * 86400 if $opt{'y'}; diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index 04073d47e..1be98ac9e 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -12,6 +12,7 @@ getopts("p:a:d:vl:sy:nmrkg:", \%opt);  my $user = shift or die &usage;  adminsuidsetup $user; +#you can skip this by setting the disable_cron_billing config  use FS::Cron::bill qw(bill);  bill(%opt);  | 
