add -o flag to freeside-daily, to only bill for one month, RT#14904
[freeside.git] / FS / FS / cust_main / Billing.pm
index 464ee8a..2051804 100644 (file)
@@ -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};