summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_main.pm9
2 files changed, 16 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 517967cf6..bf7c5533e 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4977,6 +4977,13 @@ and customer address. Include units.',
},
'option_sub' => sub { FS::Locales->description(shift) },
},
+
+ {
+ 'key' => 'cust_main-require_locale',
+ 'section' => 'UI',
+ 'description' => 'Require an explicit locale to be chosen for new customers.',
+ 'type' => 'checkbox',
+ },
{
'key' => 'translate-auto-insert',
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 845d09848..cba28bc9f 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1538,6 +1538,10 @@ sub replace {
$self->censusyear($conf->config('census_year')||'2012');
}
+ return "Invoicing locale is required"
+ if $old->locale
+ && ! $self->locale
+ && $conf->exists('cust_main-require_locale');
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
@@ -2139,6 +2143,11 @@ sub check {
$self->payname($1);
}
+ return "Please select an invoicing locale"
+ if ! $self->locale
+ && ! $self->custnum
+ && $conf->exists('cust_main-require_locale');
+
foreach my $flag (qw( tax spool_cdr squelch_cdr archived email_csv_cdr )) {
$self->$flag() =~ /^(Y?)$/ or return "Illegal $flag: ". $self->$flag();
$self->$flag($1);