summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-01-29 14:43:45 -0800
committerMark Wells <mark@freeside.biz>2016-01-29 14:43:51 -0800
commit49432ea28e2f6b274d614b8317fc18c423211e4f (patch)
tree16a4e37d79645ea0ea3000ab55ba1faaebdfebe1
parentb31719ae093ed10ceaaf0def79f8c3d3f0fb7c7e (diff)
allow editing prospect location fields in place, #39982
-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 b0a4feae2..9415cc77c 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -286,10 +286,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 $_";
+ }
}
}