From 6b8acf1157b5ec40877fbced43e80ad90d91fe2e Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 13 Jan 2012 10:15:33 +0000 Subject: [PATCH] package location change bugfix --- FS/FS/cust_pkg.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index d67c02c0d..54119b50e 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -1350,12 +1350,16 @@ sub change { $hash{$_} = '' foreach qw(setup bill last_bill); } + # allow $opt->{'locationnum'} = '' to specifically set it to null + # (i.e. customer default location) + $opt->{'locationnum'} = $self->locationnum if !exists($opt->{'locationnum'}); + # Create the new package. my $cust_pkg = new FS::cust_pkg { custnum => $self->custnum, pkgpart => ( $opt->{'pkgpart'} || $self->pkgpart ), refnum => ( $opt->{'refnum'} || $self->refnum ), - locationnum => ( $opt->{'locationnum'} || $self->locationnum ), + locationnum => ( $opt->{'locationnum'} ), %hash, }; -- 2.11.0