[freeside-commits] branch FREESIDE_4_BRANCH updated. 44b8701e1747da62acbb104d0da7b1134d223981

Mark Wells mark at 420.am
Fri Jan 29 14:56:59 PST 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  44b8701e1747da62acbb104d0da7b1134d223981 (commit)
      from  5991345844299eaec5c70610150f32de9de01152 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 44b8701e1747da62acbb104d0da7b1134d223981
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jan 29 14:43:45 2016 -0800

    allow editing prospect location fields in place, #39982

diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index b0a4fea..9415cc7 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 $_";
+      }
     }
   }
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_location.pm |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list