summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2011-12-26 21:18:24 +0000
committerivan <ivan>2011-12-26 21:18:24 +0000
commit897ec63b7df26ab49439c251584d02e5ea72e031 (patch)
treeea8957fd776f09ee42b4b11d5907adfe801cff49 /FS/FS
parent970ae489eeb367b09e363b89f1a5815d9d1b25d5 (diff)
add -o flag to freeside-daily, to only bill for one month, RT#14904
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Cron/bill.pm1
-rw-r--r--FS/FS/cust_main/Billing.pm10
2 files changed, 9 insertions, 2 deletions
diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm
index b31880927..64979baec 100644
--- a/FS/FS/Cron/bill.pm
+++ b/FS/FS/Cron/bill.pm
@@ -93,6 +93,7 @@ sub bill {
'check_freq' => $check_freq,
'resetup' => ( $opt{'s'} ? $opt{'s'} : 0 ),
'not_pkgpart' => $opt{'g'}, #$not_pkgpart,
+ 'one_recur' => $opt{'o'},
);
if ( $opt{'m'} ) {
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index b2818b85a..37053fe23 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -420,11 +420,17 @@ sub bill {
'real_pkgpart' => $real_pkgpart,
'options' => \%options,
);
- # Stop if anything goes wrong, or if we're not incrementing
- # the bill date.
+
+ # Stop if anything goes wrong
last if $error;
+
+ # or if we're not incrementing the bill date.
last if ($cust_pkg->getfield('bill') || 0) == $next_bill;
+
$next_bill = $cust_pkg->getfield('bill') || 0;
+
+ #stop if -o was passed to freeside-daily
+ last if $options{'one_recur'};
}
if ($error) {
$dbh->rollback if $oldAutoCommit && !$options{no_commit};