summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-10-15 21:06:04 -0700
committerMark Wells <mark@freeside.biz>2016-10-15 21:06:04 -0700
commit6a509099343ed155525c4304f1ad742cc6e4ce59 (patch)
treee8b05c436b3bb0dbe0e331e728dc5b36e90b8c0a /FS
parentfbfd9445bb00c2a1c7f4386878edead9b50c482f (diff)
parentd4114381c5d95e8acd0d0fc2bbc2b3528bde2ecf (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm6
-rw-r--r--FS/FS/Upgrade.pm8
-rw-r--r--FS/FS/cust_main_note.pm8
3 files changed, 17 insertions, 5 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index f4f7d2602..a48125d09 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5419,11 +5419,7 @@ and customer address. Include units.',
'section' => 'customer_fields',
'description' => 'Use customer note classes',
'type' => 'select',
- 'select_hash' => [
- 0 => 'Disabled',
- 1 => 'Enabled',
- 2 => 'Enabled, with tabs',
- ],
+ 'select_enum' => [ '', 'Enabled', 'Required' ],
},
{
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm
index c959ba947..1c1095e37 100644
--- a/FS/FS/Upgrade.pm
+++ b/FS/FS/Upgrade.pm
@@ -178,6 +178,14 @@ If you need to continue using the old Form 477 report, turn on the
$conf->set('cust-fields',$cust_fields);
}
+ #repurposed
+ $conf->set('note-classes','Enabled')
+ if $conf->exists('note-classes')
+ and grep {$_ eq $conf->config('note-classes')} ('1','2');
+ $conf->set('note-classes','')
+ if $conf->exists('note-classes')
+ and '0' eq $conf->config('note-classes');
+
enable_banned_pay_pad() unless length($conf->config('banned_pay-pad'));
# if translate-auto-insert is enabled for a locale, ensure that invoice
diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm
index ee63883d2..4c48eb609 100644
--- a/FS/FS/cust_main_note.pm
+++ b/FS/FS/cust_main_note.pm
@@ -4,6 +4,7 @@ use base qw( FS::otaker_Mixin FS::Record );
use strict;
use Carp;
use FS::Record qw( qsearchs ); #qw( qsearch qsearchs );
+use FS::Conf;
=head1 NAME
@@ -116,6 +117,13 @@ sub check {
;
return $error if $error;
+ if (!$self->classnum) {
+ my $conf = new FS::Conf;
+ return 'Note class is required'
+ if $conf->exists('note-classes')
+ and $conf->config('note-classes') eq 'Required';
+ }
+
$self->SUPER::check;
}