summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-11-16 02:27:12 +0000
committerivan <ivan>2009-11-16 02:27:12 +0000
commitbd1336161b9c25b93001cb785193efde6f3ef0d2 (patch)
treee1fe323c57d6ea0386724dcd690b9db2499f363f /FS
parent0ea039f9084014e27a1b99ff033bf04bdab94966 (diff)
add disable_cron_billing config, RT#6407
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm6
-rw-r--r--FS/FS/Cron/bill.pm6
-rwxr-xr-xFS/bin/freeside-daily1
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);