fix interaction between customer location change and supplemental packages, #23124
authorMark Wells <mark@freeside.biz>
Wed, 22 May 2013 21:41:10 +0000 (14:41 -0700)
committerMark Wells <mark@freeside.biz>
Wed, 22 May 2013 21:41:10 +0000 (14:41 -0700)
FS/FS/cust_location.pm

index 4560716..1cb5e52 100644 (file)
@@ -424,9 +424,13 @@ sub move_to {
     }
   }
 
     }
   }
 
+  # find all packages that have the old location as their service address,
+  # and aren't canceled,
+  # and aren't supplemental to another package.
   my @pkgs = qsearch('cust_pkg', { 
       'locationnum' => $old->locationnum,
   my @pkgs = qsearch('cust_pkg', { 
       'locationnum' => $old->locationnum,
-      'cancel' => '' 
+      'cancel'      => '',
+      'main_pkgnum' => '',
     });
   foreach my $cust_pkg (@pkgs) {
     $error = $cust_pkg->change(
     });
   foreach my $cust_pkg (@pkgs) {
     $error = $cust_pkg->change(