summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2008-09-25 23:44:28 +0000
committerjeff <jeff>2008-09-25 23:44:28 +0000
commite2d78a94d7806862da7fcea0025cd380d49d5a75 (patch)
tree536f480eff3119e8611f36a959050fabe2ceb249 /FS
parentd6d4c7f87fa73da09775cc7c257d89b9a2085ea7 (diff)
lost bits of reason
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm16
1 files changed, 14 insertions, 2 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 76ed76c86..ec2ac3c61 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1962,7 +1962,12 @@ sub bill_and_collect {
$self->ncancelled_pkgs;
foreach my $cust_pkg ( @cancel_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 ". $self->custnum. ": $error"
if $error;
@@ -1988,7 +1993,14 @@ sub bill_and_collect {
$self->ncancelled_pkgs;
foreach my $cust_pkg ( @susp_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 ". $self->custnum. ": $error"
if $error;