X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_location.pm;h=aad25a4a7e261ee665b3fa703ee2316bf5f16c12;hb=3c635a0ac2bf4c3f78044cd5e510e2d287f50389;hp=09baff3ceadc1664bf114a4033a06d5dffccea21;hpb=83303105b038082cdb800a4f7322b4dd08b6fe89;p=freeside.git diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm index 09baff3ce..aad25a4a7 100644 --- a/FS/FS/cust_location.pm +++ b/FS/FS/cust_location.pm @@ -5,7 +5,6 @@ use strict; use vars qw( $import $DEBUG $conf $label_prefix ); use Data::Dumper; use Date::Format qw( time2str ); -use Locale::Country; use FS::UID qw( dbh driver_name ); use FS::Record qw( qsearch qsearchs ); use FS::Conf; @@ -282,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 $_"; + } } } @@ -406,14 +410,11 @@ sub check { =item country_full -Returns this locations's full country name +Returns this location's full country name =cut -sub country_full { - my $self = shift; - code2country($self->country); -} +#moved to geocode_Mixin.pm =item line @@ -641,6 +642,11 @@ Prospect object (see L) String used to join location elements +=item no_prefix + +Don't label the default service location as "Default service location". +May become the default at some point. + =back =cut @@ -650,6 +656,7 @@ sub location_label { my $prefix = $self->label_prefix; $prefix .= ($opt{join_string} || ': ') if $prefix; + $prefix = '' if $opt{'no_prefix'}; $prefix . $self->SUPER::location_label(%opt); }