From 2134f9e82324c8920609aa0854abc84b9e5348ae Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 9 Jan 2017 18:17:27 -0800 Subject: [PATCH] fix "unable to transfer all services" error when changing a package before it is billed, RT#73377 --- FS/FS/cust_pkg.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index f45abc6f8..f54b42d7e 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -4395,8 +4395,10 @@ sub transfer { $target{$pkg_svc->svcpart} = $pkg_svc->quantity * ( $dest->quantity || 1 ); } - foreach my $cust_svc ($dest->cust_svc) { - $target{$cust_svc->svcpart}--; + unless ( $self->pkgnum == $dest->pkgnum ) { + foreach my $cust_svc ($dest->cust_svc) { + $target{$cust_svc->svcpart}--; + } } my %svcpart2svcparts = (); -- 2.11.0