ignore pkg_svc quantities when changing a customer location, #20588
authorMark Wells <mark@freeside.biz>
Wed, 19 Dec 2012 21:53:52 +0000 (13:53 -0800)
committerMark Wells <mark@freeside.biz>
Wed, 19 Dec 2012 21:53:52 +0000 (13:53 -0800)
FS/FS/cust_location.pm
FS/FS/cust_pkg.pm

index 1521960..b86529b 100644 (file)
@@ -324,6 +324,9 @@ sub move_to {
   my $dbh = dbh;
   my $error = '';
 
+  # prevent this from failing because of pkg_svc quantity limits
+  local( $FS::cust_svc::ignore_quantity ) = 1;
+
   if ( !$new->locationnum ) {
     $error = $new->insert;
     if ( $error ) {
index 75a0d77..22a7b2c 100644 (file)
@@ -2889,7 +2889,8 @@ sub transfer {
   }
 
   foreach my $cust_svc ($self->cust_svc) {
-    if($target{$cust_svc->svcpart} > 0) {
+    if($target{$cust_svc->svcpart} > 0
+       or $FS::cust_svc::ignore_quantity) { # maybe should be a 'force' option
       $target{$cust_svc->svcpart}--;
       my $new = new FS::cust_svc { $cust_svc->hash };
       $new->pkgnum($dest_pkgnum);