$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') {
}
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)