summaryrefslogtreecommitdiff
path: root/FS/FS/Cron/bill.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/Cron/bill.pm')
-rw-r--r--FS/FS/Cron/bill.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm
index 23fa064c6..df446d882 100644
--- a/FS/FS/Cron/bill.pm
+++ b/FS/FS/Cron/bill.pm
@@ -87,7 +87,12 @@ END
foreach my $cust_pkg (
grep { $_->expire && $_->expire <= $^T } $cust_main->ncancelled_pkgs
) {
- my $error = $cust_pkg->cancel;
+ my $cpr = $cust_pkg->last_cust_pkg_reason('expire');
+ my $error = $cust_pkg->cancel($cpr ? ( 'reason' => $cpr->reasonnum,
+ 'reason_otaker' => $cpr->otaker
+ )
+ : ()
+ );
warn "Error cancelling expired pkg ". $cust_pkg->pkgnum.
" for custnum $custnum: $error"
if $error;
@@ -101,7 +106,13 @@ END
}
$cust_main->ncancelled_pkgs
) {
- my $error = $cust_pkg->suspend;
+ my $cpr = $cust_pkg->last_cust_pkg_reason('adjourn')
+ if ($cust_pkg->adjourn && $cust_pkg->adjourn < $^T);
+ my $error = $cust_pkg->suspend($cpr ? ( 'reason' => $cpr->reasonnum,
+ 'reason_otaker' => $cpr->otaker
+ )
+ : ()
+ );
warn "Error suspending package ". $cust_pkg->pkgnum.
" for custnum $custnum: $error"
if $error;