summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-01-29 17:08:51 -0800
committerIvan Kohler <ivan@freeside.biz>2016-01-29 17:08:51 -0800
commitb75eefd0de474bc68eb271e122f0895a78dabc28 (patch)
tree48b829ca23c32ad9440dcb7d938ad2f8258650b7
parent67cad80ab15adbad103df1e0e7b169af1ed65184 (diff)
parent3c635a0ac2bf4c3f78044cd5e510e2d287f50389 (diff)
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
-rw-r--r--FS/FS/cust_location.pm13
1 files changed, 9 insertions, 4 deletions
diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index c14082702..aad25a4a7 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -281,10 +281,15 @@ sub replace {
warn "Warning: passed city to replace when cust_main-no_city_in_address is configured"
if $conf->exists('cust_main-no_city_in_address') && $self->get('city');
- # the following fields are immutable
- foreach (qw(address1 address2 city state zip country)) {
- if ( $self->$_ ne $old->$_ ) {
- return "can't change cust_location field $_";
+ # the following fields are immutable if this is a customer location. if
+ # it's a prospect location, then there are no active packages, no billing
+ # history, no taxes, and in general no reason to keep the old location
+ # around.
+ if ( $self->custnum ) {
+ foreach (qw(address1 address2 city state zip country)) {
+ if ( $self->$_ ne $old->$_ ) {
+ return "can't change cust_location field $_";
+ }
}
}