X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main_Mixin.pm;h=c36b79a8a72b56b940e46d8e31419fa458d093a5;hb=121510b6337b7f75f25d583730a65f3fc63bbfbe;hp=cceaa4bc70a0576fa616aecbdd372869f15fe919;hpb=d45dd4a826f314fb5459747590d3e11cd80c211f;p=freeside.git diff --git a/FS/FS/cust_main_Mixin.pm b/FS/FS/cust_main_Mixin.pm index cceaa4bc7..c36b79a8a 100644 --- a/FS/FS/cust_main_Mixin.pm +++ b/FS/FS/cust_main_Mixin.pm @@ -660,13 +660,13 @@ sub time2str_local { $self->{_date_format} ||= {}; if (!exists($self->{_dh})) { - my $cust_main = $self->cust_main; - my $locale = $cust_main->locale if $cust_main; - $locale ||= 'en_US'; + my $locale = $self->cust_main->locale if $self->cust_main; + $locale ||= FS::Conf->new->config('locale') || 'en_US'; + my %info = FS::Locales->locale_info($locale); - my $dh = eval { Date::Language->new($info{'name'}) } || - Date::Language->new(); # fall back to English - $self->{_dh} = $dh; + + $self->{_dh} = eval { Date::Language->new($info{'name'}) } + || Date::Language->new(); # fall back to English } if ($format eq 'short') { @@ -737,7 +737,9 @@ sub unsuspend_balance { } my $balance = $cust_main->balance || 0; if ($balance <= $maxbalance) { - my @errors = $cust_main->unsuspend; + my @errors = $cust_main->unsuspend( + 'reason_type' => $conf->config('unsuspend_reason_type') + ); # side-fx with nested transactions? upstack rolls back? warn "WARNING:Errors unsuspending customer ". $cust_main->custnum. ": ". join(' / ', @errors)