[freeside-commits] freeside/FS/FS cust_main.pm,1.371,1.372

Jeff Finucane,420,, jeff at wavetail.420.am
Thu Sep 25 16:44:31 PDT 2008


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv8364

Modified Files:
	cust_main.pm 
Log Message:
lost bits of reason

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.371
retrieving revision 1.372
diff -u -d -r1.371 -r1.372
--- cust_main.pm	12 Sep 2008 07:09:53 -0000	1.371
+++ cust_main.pm	25 Sep 2008 23:44:28 -0000	1.372
@@ -1962,7 +1962,12 @@
                          $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 @@
          $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;



More information about the freeside-commits mailing list