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.pm4
2 files changed, 11 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index bf21a1b07..1f13608a7 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4439,6 +4439,13 @@ and customer address. Include units.',
},
{
+ 'key' => 'cust_main-require_classnum',
+ 'section' => 'customer_fields',
+ 'description' => 'Customer class is required: require customer class for all customer records.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'cust_main-check_unique',
'section' => '',
'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 8e2fa19a4..90b93f2bf 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2158,6 +2158,10 @@ sub check {
&& ! $self->custnum
&& $conf->exists('cust_main-require_locale');
+ return "Please select a customer class"
+ if ! $self->classnum
+ && $conf->exists('cust_main-require_classnum');
+
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);