projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d6d4c7f
)
lost bits of reason
author
jeff
<jeff>
Thu, 25 Sep 2008 23:44:28 +0000
(23:44 +0000)
committer
jeff
<jeff>
Thu, 25 Sep 2008 23:44:28 +0000
(23:44 +0000)
FS/FS/cust_main.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
76ed76c
..
ec2ac3c
100644
(file)
--- 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 ) {
$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;
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 ) {
$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;
warn "Error suspending package ". $cust_pkg->pkgnum.
" for custnum ". $self->custnum. ": $error"
if $error;