Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use strict;
4 use vars qw( $base_dir @config_items @base_items @card_types $DEBUG
5              $conf_cache $conf_cache_enabled
6            );
7 use Carp;
8 use IO::File;
9 use File::Basename;
10 use MIME::Base64;
11 use Locale::Currency;
12 use FS::ConfItem;
13 use FS::ConfDefaults;
14 use FS::Conf_compat17;
15 use FS::Locales;
16 use FS::payby;
17 use FS::conf;
18 use FS::Record qw(qsearch qsearchs);
19 use FS::UID qw(dbh datasrc use_confcompat);
20 use FS::Misc::Invoicing qw( spool_formats );
21
22 $base_dir = '%%%FREESIDE_CONF%%%';
23
24 $DEBUG = 0;
25
26 $conf_cache_enabled = 0;
27
28 =head1 NAME
29
30 FS::Conf - Freeside configuration values
31
32 =head1 SYNOPSIS
33
34   use FS::Conf;
35
36   $conf = new FS::Conf;
37
38   $value = $conf->config('key');
39   @list  = $conf->config('key');
40   $bool  = $conf->exists('key');
41
42   $conf->touch('key');
43   $conf->set('key' => 'value');
44   $conf->delete('key');
45
46   @config_items = $conf->config_items;
47
48 =head1 DESCRIPTION
49
50 Read and write Freeside configuration values.  Keys currently map to filenames,
51 but this may change in the future.
52
53 =head1 METHODS
54
55 =over 4
56
57 =item new [ HASHREF ]
58
59 Create a new configuration object.
60
61 HASHREF may contain options to set the configuration context.  Currently 
62 accepts C<locale>, and C<localeonly> to disable fallback to the null locale.
63
64 =cut
65
66 sub new {
67   my($proto) = shift;
68   my $opts = shift || {};
69   my($class) = ref($proto) || $proto;
70   my $self = {
71     'base_dir'    => $base_dir,
72     'locale'      => $opts->{locale},
73     'localeonly'  => $opts->{localeonly}, # for config-view.cgi ONLY
74   };
75   warn "FS::Conf created with no locale fallback.\n" if $self->{localeonly};
76   bless ($self, $class);
77 }
78
79 =item base_dir
80
81 Returns the base directory.  By default this is /usr/local/etc/freeside.
82
83 =cut
84
85 sub base_dir {
86   my($self) = @_;
87   my $base_dir = $self->{base_dir};
88   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
89   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
90   -r $base_dir or die "FATAL: Can't read $base_dir!";
91   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
92   $base_dir =~ /^(.*)$/;
93   $1;
94 }
95
96 =item conf KEY [ AGENTNUM [ NODEFAULT ] ]
97
98 Returns the L<FS::conf> record for the key and agent.
99
100 =cut
101
102 sub conf {
103   my $self = shift;
104   $self->_config(@_);
105 }
106
107 =item config KEY [ AGENTNUM [ NODEFAULT ] ]
108
109 Returns the configuration value or values (depending on context) for key.
110 The optional agent number selects an agent specific value instead of the
111 global default if one is present.  If NODEFAULT is true only the agent
112 specific value(s) is returned.
113
114 =cut
115
116 sub _usecompat {
117   my ($self, $method) = (shift, shift);
118   carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
119     if use_confcompat;
120   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
121   $compat->$method(@_);
122 }
123
124 sub _config {
125   my($self,$name,$agentnum,$agentonly)=@_;
126   my $hashref = { 'name' => $name };
127   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
128   $conf_cache = undef unless $conf_cache_enabled; # use cache only when it is
129                                                   # safe to do so
130   my $cv;
131   my @a = (
132     ($agentnum || ()),
133     ($agentonly && $agentnum ? () : '')
134   );
135   my @l = (
136     ($self->{locale} || ()),
137     ($self->{localeonly} && $self->{locale} ? () : '')
138   );
139   # try with the agentnum first, then fall back to no agentnum if allowed
140   foreach my $a (@a) {
141     $hashref->{agentnum} = $a;
142     foreach my $l (@l) {
143       my $key = join(':',$name, $a, $l);
144       if (! exists $conf_cache->{$key}){
145         $hashref->{locale} = $l;
146         # $conf_cache is reset in FS::UID during myconnect, so the cache is
147         # reset per connection
148         $conf_cache->{$key} = FS::Record::qsearchs('conf', $hashref);
149       }
150       return $conf_cache->{$key} if $conf_cache->{$key};
151     }
152   }
153   return undef;
154 }
155
156 sub config {
157   my $self = shift;
158   return $self->_usecompat('config', @_) if use_confcompat;
159
160   carp "FS::Conf->config(". join(', ', @_). ") called"
161     if $DEBUG > 1;
162
163   my $cv = $self->_config(@_) or return;
164
165   if ( wantarray ) {
166     my $v = $cv->value;
167     chomp $v;
168     (split "\n", $v, -1);
169   } else {
170     (split("\n", $cv->value))[0];
171   }
172 }
173
174 =item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
175
176 Returns the exact scalar value for key.
177
178 =cut
179
180 sub config_binary {
181   my $self = shift;
182   return $self->_usecompat('config_binary', @_) if use_confcompat;
183
184   my $cv = $self->_config(@_) or return;
185   length($cv->value) ? decode_base64($cv->value) : '';
186 }
187
188 =item exists KEY [ AGENTNUM [ NODEFAULT ] ]
189
190 Returns true if the specified key exists, even if the corresponding value
191 is undefined.
192
193 =cut
194
195 sub exists {
196   my $self = shift;
197   return $self->_usecompat('exists', @_) if use_confcompat;
198
199   #my($name, $agentnum)=@_;
200
201   carp "FS::Conf->exists(". join(', ', @_). ") called"
202     if $DEBUG > 1;
203
204   defined($self->_config(@_));
205 }
206
207 #maybe this should just be the new exists instead of getting a method of its
208 #own, but i wanted to avoid possible fallout
209
210 sub config_bool {
211   my $self = shift;
212   return $self->_usecompat('exists', @_) if use_confcompat;
213
214   my($name,$agentnum,$agentonly) = @_;
215
216   carp "FS::Conf->config_bool(". join(', ', @_). ") called"
217     if $DEBUG > 1;
218
219   #defined($self->_config(@_));
220
221   #false laziness w/_config
222   my $hashref = { 'name' => $name };
223   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
224   my $cv;
225   my @a = (
226     ($agentnum || ()),
227     ($agentonly && $agentnum ? () : '')
228   );
229   my @l = (
230     ($self->{locale} || ()),
231     ($self->{localeonly} && $self->{locale} ? () : '')
232   );
233   # try with the agentnum first, then fall back to no agentnum if allowed
234   foreach my $a (@a) {
235     $hashref->{agentnum} = $a;
236     foreach my $l (@l) {
237       $hashref->{locale} = $l;
238       $cv = FS::Record::qsearchs('conf', $hashref);
239       if ( $cv ) {
240         if ( $cv->value eq '0'
241                && ($hashref->{agentnum} || $hashref->{locale} )
242            ) 
243         {
244           return 0; #an explicit false override, don't continue looking
245         } else {
246           return 1;
247         }
248       }
249     }
250   }
251   return 0;
252
253 }
254
255 =item config_orbase KEY SUFFIX
256
257 Returns the configuration value or values (depending on context) for 
258 KEY_SUFFIX, if it exists, otherwise for KEY
259
260 =cut
261
262 # outmoded as soon as we shift to agentnum based config values
263 # well, mostly.  still useful for e.g. late notices, etc. in that we want
264 # these to fall back to standard values
265 sub config_orbase {
266   my $self = shift;
267   return $self->_usecompat('config_orbase', @_) if use_confcompat;
268
269   my( $name, $suffix ) = @_;
270   if ( $self->exists("${name}_$suffix") ) {
271     $self->config("${name}_$suffix");
272   } else {
273     $self->config($name);
274   }
275 }
276
277 =item key_orbase KEY SUFFIX
278
279 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
280 KEY.  Useful for determining which exact configuration option is returned by
281 config_orbase.
282
283 =cut
284
285 sub key_orbase {
286   my $self = shift;
287   #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
288
289   my( $name, $suffix ) = @_;
290   if ( $self->exists("${name}_$suffix") ) {
291     "${name}_$suffix";
292   } else {
293     $name;
294   }
295 }
296
297 =item invoice_templatenames
298
299 Returns all possible invoice template names.
300
301 =cut
302
303 sub invoice_templatenames {
304   my( $self ) = @_;
305
306   my %templatenames = ();
307   foreach my $item ( $self->config_items ) {
308     foreach my $base ( @base_items ) {
309       my( $main, $ext) = split(/\./, $base);
310       $ext = ".$ext" if $ext;
311       if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
312       $templatenames{$1}++;
313       }
314     }
315   }
316   
317   map { $_ } #handle scalar context
318   sort keys %templatenames;
319
320 }
321
322 =item touch KEY [ AGENT ];
323
324 Creates the specified configuration key if it does not exist.
325
326 =cut
327
328 sub touch {
329   my $self = shift;
330   return $self->_usecompat('touch', @_) if use_confcompat;
331
332   my($name, $agentnum) = @_;
333   #unless ( $self->exists($name, $agentnum) ) {
334   unless ( $self->config_bool($name, $agentnum) ) {
335     if ( $agentnum && $self->exists($name) && $self->config($name,$agentnum) eq '0' ) {
336       $self->delete($name, $agentnum);
337     } else {
338       $self->set($name, '', $agentnum);
339     }
340   }
341 }
342
343 =item set KEY VALUE [ AGENTNUM ];
344
345 Sets the specified configuration key to the given value.
346
347 =cut
348
349 sub set {
350   my $self = shift;
351   return $self->_usecompat('set', @_) if use_confcompat;
352
353   my($name, $value, $agentnum) = @_;
354   $value =~ /^(.*)$/s;
355   $value = $1;
356
357   warn "[FS::Conf] SET $name\n" if $DEBUG;
358
359   my $hashref = {
360     name => $name,
361     agentnum => $agentnum,
362     locale => $self->{locale}
363   };
364
365   my $old = FS::Record::qsearchs('conf', $hashref);
366   my $new = new FS::conf { $old ? $old->hash : %$hashref };
367   $new->value($value);
368
369   my $error;
370   if ($old) {
371     $error = $new->replace($old);
372   } else {
373     $error = $new->insert;
374   }
375
376   if (! $error) {
377     # clean the object cache
378     my $key = join(':',$name, $agentnum, $self->{locale});
379     $conf_cache->{ $key } = $new;
380   }
381
382   die "error setting configuration value: $error \n"
383     if $error;
384
385 }
386
387 =item set_binary KEY VALUE [ AGENTNUM ]
388
389 Sets the specified configuration key to an exact scalar value which
390 can be retrieved with config_binary.
391
392 =cut
393
394 sub set_binary {
395   my $self  = shift;
396   return if use_confcompat;
397
398   my($name, $value, $agentnum)=@_;
399   $self->set($name, encode_base64($value), $agentnum);
400 }
401
402 =item delete KEY [ AGENTNUM ];
403
404 Deletes the specified configuration key.
405
406 =cut
407
408 sub delete {
409   my $self = shift;
410   return $self->_usecompat('delete', @_) if use_confcompat;
411
412   my($name, $agentnum) = @_;
413   if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum, locale => $self->{locale}}) ) {
414     warn "[FS::Conf] DELETE $name\n" if $DEBUG;
415
416     my $oldAutoCommit = $FS::UID::AutoCommit;
417     local $FS::UID::AutoCommit = 0;
418     my $dbh = dbh;
419
420     my $error = $cv->delete;
421
422     if ( $error ) {
423       $dbh->rollback if $oldAutoCommit;
424       die "error setting configuration value: $error \n"
425     }
426
427     $dbh->commit or die $dbh->errstr if $oldAutoCommit;
428
429   }
430 }
431
432 #maybe this should just be the new delete instead of getting a method of its
433 #own, but i wanted to avoid possible fallout
434
435 sub delete_bool {
436   my $self = shift;
437   return $self->_usecompat('delete', @_) if use_confcompat;
438
439   my($name, $agentnum) = @_;
440
441   warn "[FS::Conf] DELETE $name\n" if $DEBUG;
442
443   my $cv = FS::Record::qsearchs('conf', { name     => $name,
444                                           agentnum => $agentnum,
445                                           locale   => $self->{locale},
446                                         });
447
448   if ( $cv ) {
449     my $error = $cv->delete;
450     die $error if $error;
451   } elsif ( $agentnum ) {
452     $self->set($name, '0', $agentnum);
453   }
454
455 }
456
457 =item import_config_item CONFITEM DIR 
458
459   Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
460 the database as a conf record (see L<FS::conf>).  Imports from the file
461 in the directory DIR.
462
463 =cut
464
465 sub import_config_item { 
466   my ($self,$item,$dir) = @_;
467   my $key = $item->key;
468   if ( -e "$dir/$key" && ! use_confcompat ) {
469     warn "Inserting $key\n" if $DEBUG;
470     local $/;
471     my $value = readline(new IO::File "$dir/$key");
472     if ($item->type =~ /^(binary|image)$/ ) {
473       $self->set_binary($key, $value);
474     }else{
475       $self->set($key, $value);
476     }
477   }else {
478     warn "Not inserting $key\n" if $DEBUG;
479   }
480 }
481
482 =item verify_config_item CONFITEM DIR 
483
484   Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
485 the database to the legacy file value in DIR.
486
487 =cut
488
489 sub verify_config_item { 
490   return '' if use_confcompat;
491   my ($self,$item,$dir) = @_;
492   my $key = $item->key;
493   my $type = $item->type;
494
495   my $compat = new FS::Conf_compat17 $dir;
496   my $error = '';
497   
498   $error .= "$key fails existential comparison; "
499     if $self->exists($key) xor $compat->exists($key);
500
501   if ( $type !~ /^(binary|image)$/ ) {
502
503     {
504       no warnings;
505       $error .= "$key fails scalar comparison; "
506         unless scalar($self->config($key)) eq scalar($compat->config($key));
507     }
508
509     my (@new) = $self->config($key);
510     my (@old) = $compat->config($key);
511     unless ( scalar(@new) == scalar(@old)) { 
512       $error .= "$key fails list comparison; ";
513     }else{
514       my $r=1;
515       foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
516       $error .= "$key fails list comparison; "
517         unless $r;
518     }
519
520   } else {
521
522     no warnings 'uninitialized';
523     $error .= "$key fails binary comparison; "
524       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
525
526   }
527
528 #remove deprecated config on our own terms, not freeside-upgrade's
529 #  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
530 #    my $proto;
531 #    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
532 #    unless ($proto->key eq $key) { 
533 #      warn "removed config item $error\n" if $DEBUG;
534 #      $error = '';
535 #    }
536 #  }
537
538   $error;
539 }
540
541 #item _orbase_items OPTIONS
542 #
543 #Returns all of the possible extensible config items as FS::ConfItem objects.
544 #See #L<FS::ConfItem>.  OPTIONS consists of name value pairs.  Possible
545 #options include
546 #
547 # dir - the directory to search for configuration option files instead
548 #       of using the conf records in the database
549 #
550 #cut
551
552 #quelle kludge
553 sub _orbase_items {
554   my ($self, %opt) = @_; 
555
556   my $listmaker = sub { my $v = shift;
557                         $v =~ s/_/!_/g;
558                         if ( $v =~ /\.(png|eps)$/ ) {
559                           $v =~ s/\./!_%./;
560                         }else{
561                           $v .= '!_%';
562                         }
563                         map { $_->name }
564                           FS::Record::qsearch( 'conf',
565                                                {},
566                                                '',
567                                                "WHERE name LIKE '$v' ESCAPE '!'"
568                                              );
569                       };
570
571   if (exists($opt{dir}) && $opt{dir}) {
572     $listmaker = sub { my $v = shift;
573                        if ( $v =~ /\.(png|eps)$/ ) {
574                          $v =~ s/\./_*./;
575                        }else{
576                          $v .= '_*';
577                        }
578                        map { basename $_ } glob($opt{dir}. "/$v" );
579                      };
580   }
581
582   ( map { 
583           my $proto;
584           my $base = $_;
585           for ( @config_items ) { $proto = $_; last if $proto->key eq $base;  }
586           die "don't know about $base items" unless $proto->key eq $base;
587
588           map { new FS::ConfItem { 
589                   'key'         => $_,
590                   'base_key'    => $proto->key,
591                   'section'     => $proto->section,
592                   'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
593                   'type'        => $proto->type,
594                 };
595               } &$listmaker($base);
596         } @base_items,
597   );
598 }
599
600 =item config_items
601
602 Returns all of the possible global/default configuration items as
603 FS::ConfItem objects.  See L<FS::ConfItem>.
604
605 =cut
606
607 sub config_items {
608   my $self = shift; 
609   return $self->_usecompat('config_items', @_) if use_confcompat;
610
611   ( @config_items, $self->_orbase_items(@_) );
612 }
613
614 =item invoice_from_full [ AGENTNUM ]
615
616 Returns values of invoice_from and invoice_from_name, appropriately combined
617 based on their current values.
618
619 =cut
620
621 sub invoice_from_full {
622   my ($self, $agentnum) = @_;
623   return $self->config('invoice_from_name', $agentnum ) ?
624          $self->config('invoice_from_name', $agentnum ) . ' <' .
625          $self->config('invoice_from', $agentnum ) . '>' :
626          $self->config('invoice_from', $agentnum );
627 }
628
629 =back
630
631 =head1 SUBROUTINES
632
633 =over 4
634
635 =item init-config DIR
636
637 Imports the configuration items from DIR (1.7 compatible)
638 to conf records in the database.
639
640 =cut
641
642 sub init_config {
643   my $dir = shift;
644
645   {
646     local $FS::UID::use_confcompat = 0;
647     my $conf = new FS::Conf;
648     foreach my $item ( $conf->config_items(dir => $dir) ) {
649       $conf->import_config_item($item, $dir);
650       my $error = $conf->verify_config_item($item, $dir);
651       return $error if $error;
652     }
653   
654     my $compat = new FS::Conf_compat17 $dir;
655     foreach my $item ( $compat->config_items ) {
656       my $error = $conf->verify_config_item($item, $dir);
657       return $error if $error;
658     }
659   }
660
661   $FS::UID::use_confcompat = 0;
662   '';  #success
663 }
664
665 =back
666
667 =head1 BUGS
668
669 If this was more than just crud that will never be useful outside Freeside I'd
670 worry that config_items is freeside-specific and icky.
671
672 =head1 SEE ALSO
673
674 "Configuration" in the web interface (config/config.cgi).
675
676 =cut
677
678 #Business::CreditCard
679 @card_types = (
680   "VISA card",
681   "MasterCard",
682   "Discover card",
683   "American Express card",
684   "Diner's Club/Carte Blanche",
685   "enRoute",
686   "JCB",
687   "BankCard",
688   "Switch",
689   "Solo",
690 );
691
692 @base_items = qw(
693 invoice_template
694 invoice_latex
695 invoice_latexreturnaddress
696 invoice_latexfooter
697 invoice_latexsmallfooter
698 invoice_latexnotes
699 invoice_latexcoupon
700 invoice_html
701 invoice_htmlreturnaddress
702 invoice_htmlfooter
703 invoice_htmlnotes
704 logo.png
705 logo.eps
706 );
707
708 my %msg_template_options = (
709   'type'        => 'select-sub',
710   'options_sub' => sub { 
711     my @templates = qsearch({
712         'table' => 'msg_template', 
713         'hashref' => { 'disabled' => '' },
714         'extra_sql' => ' AND '. 
715           $FS::CurrentUser::CurrentUser->agentnums_sql(null => 1),
716         });
717     map { $_->msgnum, $_->msgname } @templates;
718   },
719   'option_sub'  => sub { 
720                          my $msg_template = FS::msg_template->by_key(shift);
721                          $msg_template ? $msg_template->msgname : ''
722                        },
723   'per_agent' => 1,
724 );
725
726 my %payment_gateway_options = (
727   'type'        => 'select-sub',
728   'options_sub' => sub {
729     my @gateways = qsearch({
730         'table' => 'payment_gateway',
731         'hashref' => { 'disabled' => '' },
732       });
733     map { $_->gatewaynum, $_->label } @gateways;
734   },
735   'option_sub'  => sub {
736     my $gateway = FS::payment_gateway->by_key(shift);
737     $gateway ? $gateway->label : ''
738   },
739 );
740
741 my %batch_gateway_options = (
742   %payment_gateway_options,
743   'options_sub' => sub {
744     my @gateways = qsearch('payment_gateway',
745       {
746         'disabled'          => '',
747         'gateway_namespace' => 'Business::BatchPayment',
748       }
749     );
750     map { $_->gatewaynum, $_->label } @gateways;
751   },
752 );
753
754 my %invoice_mode_options = (
755   'type'        => 'select-sub',
756   'options_sub' => sub { 
757     my @modes = qsearch({
758         'table' => 'invoice_mode', 
759         'extra_sql' => ' WHERE '.
760           $FS::CurrentUser::CurrentUser->agentnums_sql(null => 1),
761         });
762     map { $_->modenum, $_->modename } @modes;
763   },
764   'option_sub'  => sub { 
765                          my $mode = FS::invoice_mode->by_key(shift);
766                          $mode ? $mode->modename : '',
767                        },
768   'per_agent' => 1,
769 );
770
771 my @cdr_formats = (
772   '' => '',
773   'default' => 'Default',
774   'source_default' => 'Default with source',
775   'accountcode_default' => 'Default plus accountcode',
776   'description_default' => 'Default with description field as destination',
777   'basic' => 'Basic',
778   'simple' => 'Simple',
779   'simple2' => 'Simple with source',
780   'accountcode_simple' => 'Simple with accountcode',
781 );
782
783 # takes the reason class (C, R, S) as an argument
784 sub reason_type_options {
785   my $reason_class = shift;
786
787   'type'        => 'select-sub',
788   'options_sub' => sub {
789     map { $_->typenum => $_->type } 
790       qsearch('reason_type', { class => $reason_class });
791   },
792   'option_sub'  => sub {
793     my $type = FS::reason_type->by_key(shift);
794     $type ? $type->type : '';
795   }
796 }
797
798 #Billing (81 items)
799 #Invoicing (50 items)
800 #UI (69 items)
801 #Self-service (29 items)
802 #...
803 #Unclassified (77 items)
804
805 @config_items = map { new FS::ConfItem $_ } (
806
807   {
808     'key'         => 'address',
809     'section'     => 'deprecated',
810     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
811     'type'        => 'text',
812   },
813
814   {
815     'key'         => 'event_log_level',
816     'section'     => 'notification',
817     'description' => 'Store events in the internal log if they are at least this severe.  "info" is the default, "debug" is very detailed and noisy.',
818     'type'        => 'select',
819     'select_enum' => [ '', 'debug', 'info', 'notice', 'warning', 'error', ],
820     # don't bother with higher levels
821   },
822
823   {
824     'key'         => 'log_sent_mail',
825     'section'     => 'notification',
826     'description' => 'Enable logging of all sent email.',
827     'type'        => 'checkbox',
828   },
829
830   {
831     'key'         => 'alert_expiration',
832     'section'     => 'deprecated',
833     'description' => 'Enable alerts about credit card expiration.  This is obsolete and no longer works.',
834     'type'        => 'checkbox',
835     'per_agent'   => 1,
836   },
837
838   {
839     'key'         => 'alerter_template',
840     'section'     => 'deprecated',
841     'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).',
842     'type'        => 'textarea',
843     'per_agent'   => 1,
844   },
845   
846   {
847     'key'         => 'alerter_msgnum',
848     'section'     => 'deprecated',
849     'description' => 'Template to use for credit card expiration alerts.',
850     %msg_template_options,
851   },
852
853   {
854     'key'         => 'part_pkg-lineage',
855     'section'     => '',
856     'description' => 'When editing a package definition, if setup or recur fees are changed, create a new package rather than changing the existing package.',
857     'type'        => 'checkbox',
858   },
859
860   {
861     'key'         => 'apacheip',
862     #not actually deprecated yet
863     #'section'     => 'deprecated',
864     #'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead.  Used to be the current IP address to assign to new virtual hosts',
865     'section'     => '',
866     'description' => 'IP address to assign to new virtual hosts',
867     'type'        => 'text',
868   },
869   
870   {
871     'key'         => 'credits-auto-apply-disable',
872     'section'     => 'billing',
873     'description' => 'Disable the "Auto-Apply to invoices" UI option for new credits',
874     'type'        => 'checkbox',
875   },
876   
877   {
878     'key'         => 'credit-card-surcharge-percentage',
879     'section'     => 'billing',
880     'description' => 'Add a credit card surcharge to invoices, as a % of the invoice total.  WARNING: Although recently permitted to US merchants in general, specific consumer protection laws may prohibit or restrict this practice in California, Colorado, Connecticut, Florda, Kansas, Maine, Massachusetts, New York, Oklahome, and Texas.  Surcharging is also generally prohibited in most countries outside the US, AU and UK.  When allowed, typically not permitted to be above 4%.',
881     'type'        => 'text',
882   },
883
884   {
885     'key'         => 'discount-show-always',
886     'section'     => 'billing',
887     'description' => 'Generate a line item on an invoice even when a package is discounted 100%',
888     'type'        => 'checkbox',
889   },
890
891   {
892     'key'         => 'discount-show_available',
893     'section'     => 'billing',
894     'description' => 'Show available prepayment discounts on invoices.',
895     'type'        => 'checkbox',
896   },
897
898   {
899     'key'         => 'invoice-barcode',
900     'section'     => 'billing',
901     'description' => 'Display a barcode on HTML and PDF invoices',
902     'type'        => 'checkbox',
903   },
904   
905   {
906     'key'         => 'cust_main-select-billday',
907     'section'     => 'billing',
908     'description' => 'When used with a specific billing event, allows the selection of the day of month on which to charge credit card / bank account automatically, on a per-customer basis',
909     'type'        => 'checkbox',
910   },
911
912   {
913     'key'         => 'cust_main-select-prorate_day',
914     'section'     => 'billing',
915     'description' => 'When used with prorate or anniversary packages, allows the selection of the prorate day of month, on a per-customer basis',
916     'type'        => 'checkbox',
917   },
918
919   {
920     'key'         => 'anniversary-rollback',
921     'section'     => 'billing',
922     'description' => 'When billing an anniversary package ordered after the 28th, roll the anniversary date back to the 28th instead of forward into the following month.',
923     'type'        => 'checkbox',
924   },
925
926   {
927     'key'         => 'encryption',
928     'section'     => 'billing',
929     'description' => 'Enable encryption of credit cards and echeck numbers',
930     'type'        => 'checkbox',
931   },
932
933   {
934     'key'         => 'encryptionmodule',
935     'section'     => 'billing',
936     'description' => 'Use which module for encryption?',
937     'type'        => 'select',
938     'select_enum' => [ '', 'Crypt::OpenSSL::RSA', ],
939   },
940
941   {
942     'key'         => 'encryptionpublickey',
943     'section'     => 'billing',
944     'description' => 'Encryption public key',
945     'type'        => 'textarea',
946   },
947
948   {
949     'key'         => 'encryptionprivatekey',
950     'section'     => 'billing',
951     'description' => 'Encryption private key',
952     'type'        => 'textarea',
953   },
954
955   {
956     'key'         => 'billco-url',
957     'section'     => 'billing',
958     'description' => 'The url to use for performing uploads to the invoice mailing service.',
959     'type'        => 'text',
960     'per_agent'   => 1,
961   },
962
963   {
964     'key'         => 'billco-username',
965     'section'     => 'billing',
966     'description' => 'The login name to use for uploads to the invoice mailing service.',
967     'type'        => 'text',
968     'per_agent'   => 1,
969     'agentonly'   => 1,
970   },
971
972   {
973     'key'         => 'billco-password',
974     'section'     => 'billing',
975     'description' => 'The password to use for uploads to the invoice mailing service.',
976     'type'        => 'text',
977     'per_agent'   => 1,
978     'agentonly'   => 1,
979   },
980
981   {
982     'key'         => 'billco-clicode',
983     'section'     => 'billing',
984     'description' => 'The clicode to use for uploads to the invoice mailing service.',
985     'type'        => 'text',
986     'per_agent'   => 1,
987   },
988
989   {
990     'key'         => 'billco-account_num',
991     'section'     => 'billing',
992     'description' => 'The data to place in the "Transaction Account No" / "TRACCTNUM" field.',
993     'type'        => 'select',
994     'select_hash' => [
995                        'invnum-date' => 'Invoice number - Date (default)',
996                        'display_custnum'  => 'Customer number',
997                      ],
998     'per_agent'   => 1,
999   },
1000
1001   {
1002     'key'         => 'next-bill-ignore-time',
1003     'section'     => 'billing',
1004     'description' => 'Ignore the time portion of next bill dates when billing, matching anything from 00:00:00 to 23:59:59 on the billing day.',
1005     'type'        => 'checkbox',
1006   },
1007   
1008   {
1009     'key'         => 'business-onlinepayment',
1010     'section'     => 'billing',
1011     'description' => '<a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support, at least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.  For more detailed information and examples see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:3:Documentation:Administration:Real-time_Processing">real-time credit card processing documentation</a>.',
1012     'type'        => 'textarea',
1013   },
1014
1015   {
1016     'key'         => 'business-onlinepayment-ach',
1017     'section'     => 'billing',
1018     'description' => 'Alternate <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support for ACH transactions (defaults to regular <b>business-onlinepayment</b>).  At least three lines: processor, login, and password.  An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\').    Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
1019     'type'        => 'textarea',
1020   },
1021
1022   {
1023     'key'         => 'business-onlinepayment-namespace',
1024     'section'     => 'billing',
1025     'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
1026     'type'        => 'select',
1027     'select_hash' => [
1028                        'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
1029                        'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
1030                      ],
1031   },
1032
1033   {
1034     'key'         => 'business-onlinepayment-description',
1035     'section'     => 'billing',
1036     'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>.  Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply - not available in all situations)',
1037     'type'        => 'text',
1038   },
1039
1040   {
1041     'key'         => 'business-onlinepayment-email-override',
1042     'section'     => 'billing',
1043     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
1044     'type'        => 'text',
1045   },
1046
1047   {
1048     'key'         => 'business-onlinepayment-email_customer',
1049     'section'     => 'billing',
1050     'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
1051     'type'        => 'checkbox',
1052   },
1053
1054   {
1055     'key'         => 'business-onlinepayment-test_transaction',
1056     'section'     => 'billing',
1057     'description' => 'Turns on the Business::OnlinePayment test_transaction flag.  Note that not all gateway modules support this flag; if yours does not, transactions will still be sent live.',
1058     'type'        => 'checkbox',
1059   },
1060
1061   {
1062     'key'         => 'business-onlinepayment-currency',
1063     'section'     => 'billing',
1064     'description' => 'Currency parameter for Business::OnlinePayment transactions.',
1065     'type'        => 'select',
1066     'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD ) ],
1067   },
1068
1069   {
1070     'key'         => 'currency',
1071     'section'     => 'billing',
1072     'description' => 'Main accounting currency',
1073     'type'        => 'select',
1074     'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD XAF ) ],
1075   },
1076
1077   {
1078     'key'         => 'currencies',
1079     'section'     => 'billing',
1080     'description' => 'Additional accepted currencies',
1081     'type'        => 'select-sub',
1082     'multiple'    => 1,
1083     'options_sub' => sub { 
1084                            map { $_ => code2currency($_) } all_currency_codes();
1085                          },
1086     'sort_sub'    => sub ($$) { $_[0] cmp $_[1]; },
1087     'option_sub'  => sub { code2currency(shift); },
1088   },
1089
1090   {
1091     'key'         => 'business-batchpayment-test_transaction',
1092     'section'     => 'billing',
1093     'description' => 'Turns on the Business::BatchPayment test_mode flag.  Note that not all gateway modules support this flag; if yours does not, using the batch gateway will fail.',
1094     'type'        => 'checkbox',
1095   },
1096
1097   {
1098     'key'         => 'countrydefault',
1099     'section'     => 'UI',
1100     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
1101     'type'        => 'text',
1102   },
1103
1104   {
1105     'key'         => 'date_format',
1106     'section'     => 'UI',
1107     'description' => 'Format for displaying dates',
1108     'type'        => 'select',
1109     'select_hash' => [
1110                        '%m/%d/%Y' => 'MM/DD/YYYY',
1111                        '%d/%m/%Y' => 'DD/MM/YYYY',
1112                        '%Y/%m/%d' => 'YYYY/MM/DD',
1113                        '%e %b %Y' => 'DD Mon YYYY',
1114                      ],
1115     'per_locale'  => 1,
1116   },
1117
1118   {
1119     'key'         => 'date_format_long',
1120     'section'     => 'UI',
1121     'description' => 'Verbose format for displaying dates',
1122     'type'        => 'select',
1123     'select_hash' => [
1124                        '%b %o, %Y' => 'Mon DDth, YYYY',
1125                        '%e %b %Y'  => 'DD Mon YYYY',
1126                        '%m/%d/%Y'  => 'MM/DD/YYYY',
1127                        '%d/%m/%Y'  => 'DD/MM/YYYY',
1128                        '%Y/%m/%d'  => 'YYYY/MM/DD',
1129                      ],
1130     'per_locale'  => 1,
1131   },
1132
1133   {
1134     'key'         => 'deleteinvoices',
1135     'section'     => 'UI',
1136     'description' => 'Enable invoices deletions.  Be very careful!  Deleting an invoice will remove all traces that the invoice ever existed!  Normally, you would void or apply a credit against the invoice instead.',
1137     'type'        => 'checkbox',
1138   },
1139
1140   {
1141     'key'         => 'deletecredits',
1142     #not actually deprecated yet
1143     #'section'     => 'deprecated',
1144     #'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable deletion of unclosed credits.  Be very careful!  Only delete credits that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.',
1145     'section'     => '',
1146     'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
1147     'type'        => [qw( checkbox text )],
1148   },
1149
1150   {
1151     'key'         => 'deleterefunds',
1152     'section'     => 'billing',
1153     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
1154     'type'        => 'checkbox',
1155   },
1156
1157   {
1158     'key'         => 'unapplypayments',
1159     'section'     => 'deprecated',
1160     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
1161     'type'        => 'checkbox',
1162   },
1163
1164   {
1165     'key'         => 'unapplycredits',
1166     'section'     => 'deprecated',
1167     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed credits.',
1168     'type'        => 'checkbox',
1169   },
1170
1171   {
1172     'key'         => 'dirhash',
1173     'section'     => 'shell',
1174     'description' => 'Optional numeric value to control directory hashing.  If positive, hashes directories for the specified number of levels from the front of the username.  If negative, hashes directories for the specified number of levels from the end of the username.  Some examples: <ul><li>1: user -> <a href="#home">/home</a>/u/user<li>2: user -> <a href="#home">/home</a>/u/s/user<li>-1: user -> <a href="#home">/home</a>/r/user<li>-2: user -> <a href="#home">home</a>/r/e/user</ul>',
1175     'type'        => 'text',
1176   },
1177
1178   {
1179     'key'         => 'disable_cust_attachment',
1180     'section'     => '',
1181     'description' => 'Disable customer file attachments',
1182     'type'        => 'checkbox',
1183   },
1184
1185   {
1186     'key'         => 'max_attachment_size',
1187     'section'     => '',
1188     'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
1189     'type'        => 'text',
1190   },
1191
1192   {
1193     'key'         => 'disable_customer_referrals',
1194     'section'     => 'UI',
1195     'description' => 'Disable new customer-to-customer referrals in the web interface',
1196     'type'        => 'checkbox',
1197   },
1198
1199   {
1200     'key'         => 'editreferrals',
1201     'section'     => 'UI',
1202     'description' => 'Enable advertising source modification for existing customers',
1203     'type'        => 'checkbox',
1204   },
1205
1206   {
1207     'key'         => 'emailinvoiceonly',
1208     'section'     => 'invoicing',
1209     'description' => 'Disables postal mail invoices',
1210     'type'        => 'checkbox',
1211   },
1212
1213   {
1214     'key'         => 'disablepostalinvoicedefault',
1215     'section'     => 'invoicing',
1216     'description' => 'Disables postal mail invoices as the default option in the UI.  Be careful not to setup customers which are not sent invoices.  See <a href ="#emailinvoiceauto">emailinvoiceauto</a>.',
1217     'type'        => 'checkbox',
1218   },
1219
1220   {
1221     'key'         => 'emailinvoiceauto',
1222     'section'     => 'invoicing',
1223     'description' => 'Automatically adds new accounts to the email invoice list',
1224     'type'        => 'checkbox',
1225   },
1226
1227   {
1228     'key'         => 'emailinvoiceautoalways',
1229     'section'     => 'invoicing',
1230     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
1231     'type'        => 'checkbox',
1232   },
1233
1234   {
1235     'key'         => 'emailinvoice-apostrophe',
1236     'section'     => 'invoicing',
1237     'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
1238     'type'        => 'checkbox',
1239   },
1240
1241   {
1242     'key'         => 'svc_acct-ip_addr',
1243     'section'     => '',
1244     'description' => 'Enable IP address management on login services like for broadband services.',
1245     'type'        => 'checkbox',
1246   },
1247
1248   {
1249     'key'         => 'exclude_ip_addr',
1250     'section'     => '',
1251     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
1252     'type'        => 'textarea',
1253   },
1254   
1255   {
1256     'key'         => 'auto_router',
1257     'section'     => '',
1258     'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
1259     'type'        => 'checkbox',
1260   },
1261   
1262   {
1263     'key'         => 'hidecancelledpackages',
1264     'section'     => 'UI',
1265     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
1266     'type'        => 'checkbox',
1267   },
1268
1269   {
1270     'key'         => 'hidecancelledcustomers',
1271     'section'     => 'UI',
1272     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
1273     'type'        => 'checkbox',
1274   },
1275
1276   {
1277     'key'         => 'home',
1278     'section'     => 'shell',
1279     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
1280     'type'        => 'text',
1281   },
1282
1283   {
1284     'key'         => 'invoice_from',
1285     'section'     => 'required',
1286     'description' => 'Return address on email invoices (address only, see invoice_from_name)',
1287     'type'        => 'text',
1288     'per_agent'   => 1,
1289     'validate'    => sub { $_[0] =~
1290                              /^[^@]+\@[[:alnum:]-]+(\.[[:alnum:]-]+)+$/
1291                              ? '' : 'Invalid email address';
1292                          }
1293   },
1294
1295   {
1296     'key'         => 'invoice_from_name',
1297     'section'     => 'invoicing',
1298     'description' => 'Return name on email invoices (set address in invoice_from)',
1299     'type'        => 'text',
1300     'per_agent'   => 1,
1301     'validate'    => sub { (($_[0] =~ /[^[:alnum:][:space:]]/) && ($_[0] !~ /^\".*\"$/))
1302                            ? 'Invalid name.  Use quotation marks around names that contain punctuation.'
1303                            : '' }
1304   },
1305
1306   {
1307     'key'         => 'quotation_from',
1308     'section'     => '',
1309     'description' => 'Return address on email quotations',
1310     'type'        => 'text',
1311     'per_agent'   => 1,
1312   },
1313
1314
1315   {
1316     'key'         => 'invoice_subject',
1317     'section'     => 'invoicing',
1318     'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
1319     'type'        => 'text',
1320     'per_agent'   => 1,
1321     'per_locale'  => 1,
1322   },
1323
1324   {
1325     'key'         => 'quotation_subject',
1326     'section'     => '',
1327     'description' => 'Subject: header on email quotations.  Defaults to "Quotation".', #  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
1328     'type'        => 'text',
1329     #'per_agent'   => 1,
1330     'per_locale'  => 1,
1331   },
1332
1333   {
1334     'key'         => 'invoice_usesummary',
1335     'section'     => 'invoicing',
1336     'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
1337     'type'        => 'checkbox',
1338   },
1339
1340   {
1341     'key'         => 'invoice_template',
1342     'section'     => 'invoicing',
1343     'description' => 'Text template file for invoices.  Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
1344     'type'        => 'textarea',
1345   },
1346
1347   {
1348     'key'         => 'invoice_html',
1349     'section'     => 'invoicing',
1350     'description' => 'HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
1351
1352     'type'        => 'textarea',
1353   },
1354
1355   {
1356     'key'         => 'quotation_html',
1357     'section'     => '',
1358     'description' => 'HTML template for quotations.',
1359
1360     'type'        => 'textarea',
1361   },
1362
1363   {
1364     'key'         => 'invoice_htmlnotes',
1365     'section'     => 'invoicing',
1366     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
1367     'type'        => 'textarea',
1368     'per_agent'   => 1,
1369     'per_locale'  => 1,
1370   },
1371
1372   {
1373     'key'         => 'invoice_htmlfooter',
1374     'section'     => 'invoicing',
1375     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
1376     'type'        => 'textarea',
1377     'per_agent'   => 1,
1378     'per_locale'  => 1,
1379   },
1380
1381   {
1382     'key'         => 'invoice_htmlsummary',
1383     'section'     => 'invoicing',
1384     'description' => 'Summary initial page for HTML invoices.',
1385     'type'        => 'textarea',
1386     'per_agent'   => 1,
1387     'per_locale'  => 1,
1388   },
1389
1390   {
1391     'key'         => 'invoice_htmlreturnaddress',
1392     'section'     => 'invoicing',
1393     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
1394     'type'        => 'textarea',
1395     'per_locale'  => 1,
1396   },
1397
1398   {
1399     'key'         => 'invoice_latex',
1400     'section'     => 'invoicing',
1401     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
1402     'type'        => 'textarea',
1403   },
1404
1405   {
1406     'key'         => 'quotation_latex',
1407     'section'     => '',
1408     'description' => 'LaTeX template for typeset PostScript quotations.',
1409     'type'        => 'textarea',
1410   },
1411
1412   {
1413     'key'         => 'invoice_latextopmargin',
1414     'section'     => 'invoicing',
1415     'description' => 'Optional LaTeX invoice topmargin setting. Include units.',
1416     'type'        => 'text',
1417     'per_agent'   => 1,
1418     'validate'    => sub { shift =~
1419                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1420                              ? '' : 'Invalid LaTex length';
1421                          },
1422   },
1423
1424   {
1425     'key'         => 'invoice_latexheadsep',
1426     'section'     => 'invoicing',
1427     'description' => 'Optional LaTeX invoice headsep setting. Include units.',
1428     'type'        => 'text',
1429     'per_agent'   => 1,
1430     'validate'    => sub { shift =~
1431                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1432                              ? '' : 'Invalid LaTex length';
1433                          },
1434   },
1435
1436   {
1437     'key'         => 'invoice_latexaddresssep',
1438     'section'     => 'invoicing',
1439     'description' => 'Optional LaTeX invoice separation between invoice header
1440 and customer address. Include units.',
1441     'type'        => 'text',
1442     'per_agent'   => 1,
1443     'validate'    => sub { shift =~
1444                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1445                              ? '' : 'Invalid LaTex length';
1446                          },
1447   },
1448
1449   {
1450     'key'         => 'invoice_latextextheight',
1451     'section'     => 'invoicing',
1452     'description' => 'Optional LaTeX invoice textheight setting. Include units.',
1453     'type'        => 'text',
1454     'per_agent'   => 1,
1455     'validate'    => sub { shift =~
1456                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1457                              ? '' : 'Invalid LaTex length';
1458                          },
1459   },
1460
1461   {
1462     'key'         => 'invoice_latexnotes',
1463     'section'     => 'invoicing',
1464     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
1465     'type'        => 'textarea',
1466     'per_agent'   => 1,
1467     'per_locale'  => 1,
1468   },
1469
1470   {
1471     'key'         => 'quotation_latexnotes',
1472     'section'     => '',
1473     'description' => 'Notes section for LaTeX typeset PostScript quotations.',
1474     'type'        => 'textarea',
1475     'per_agent'   => 1,
1476     'per_locale'  => 1,
1477   },
1478
1479   {
1480     'key'         => 'invoice_latexfooter',
1481     'section'     => 'invoicing',
1482     'description' => 'Footer for LaTeX typeset PostScript invoices.',
1483     'type'        => 'textarea',
1484     'per_agent'   => 1,
1485     'per_locale'  => 1,
1486   },
1487
1488   {
1489     'key'         => 'invoice_latexsummary',
1490     'section'     => 'invoicing',
1491     'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
1492     'type'        => 'textarea',
1493     'per_agent'   => 1,
1494     'per_locale'  => 1,
1495   },
1496
1497   {
1498     'key'         => 'invoice_latexcoupon',
1499     'section'     => 'invoicing',
1500     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
1501     'type'        => 'textarea',
1502     'per_agent'   => 1,
1503     'per_locale'  => 1,
1504   },
1505
1506   {
1507     'key'         => 'invoice_latexextracouponspace',
1508     'section'     => 'invoicing',
1509     'description' => 'Optional LaTeX invoice textheight space to reserve for a tear off coupon.  Include units.  Default is 3.6cm',
1510     'type'        => 'text',
1511     'per_agent'   => 1,
1512     'validate'    => sub { shift =~
1513                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1514                              ? '' : 'Invalid LaTex length';
1515                          },
1516   },
1517
1518   {
1519     'key'         => 'invoice_latexcouponfootsep',
1520     'section'     => 'invoicing',
1521     'description' => 'Optional LaTeX invoice separation between tear off coupon and footer. Include units.',
1522     'type'        => 'text',
1523     'per_agent'   => 1,
1524     'validate'    => sub { shift =~
1525                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1526                              ? '' : 'Invalid LaTex length';
1527                          },
1528   },
1529
1530   {
1531     'key'         => 'invoice_latexcouponamountenclosedsep',
1532     'section'     => 'invoicing',
1533     'description' => 'Optional LaTeX invoice separation between total due and amount enclosed line. Include units.',
1534     'type'        => 'text',
1535     'per_agent'   => 1,
1536     'validate'    => sub { shift =~
1537                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1538                              ? '' : 'Invalid LaTex length';
1539                          },
1540   },
1541   {
1542     'key'         => 'invoice_latexcoupontoaddresssep',
1543     'section'     => 'invoicing',
1544     'description' => 'Optional LaTeX invoice separation between invoice data and the to address (usually invoice_latexreturnaddress).  Include units.',
1545     'type'        => 'text',
1546     'per_agent'   => 1,
1547     'validate'    => sub { shift =~
1548                              /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1549                              ? '' : 'Invalid LaTex length';
1550                          },
1551   },
1552
1553   {
1554     'key'         => 'invoice_latexreturnaddress',
1555     'section'     => 'invoicing',
1556     'description' => 'Return address for LaTeX typeset PostScript invoices.',
1557     'type'        => 'textarea',
1558   },
1559
1560   {
1561     'key'         => 'invoice_latexverticalreturnaddress',
1562     'section'     => 'invoicing',
1563     'description' => 'Place the return address under the company logo rather than beside it.',
1564     'type'        => 'checkbox',
1565     'per_agent'   => 1,
1566   },
1567
1568   {
1569     'key'         => 'invoice_latexcouponaddcompanytoaddress',
1570     'section'     => 'invoicing',
1571     'description' => 'Add the company name to the To address on the remittance coupon because the return address does not contain it.',
1572     'type'        => 'checkbox',
1573     'per_agent'   => 1,
1574   },
1575
1576   {
1577     'key'         => 'invoice_latexsmallfooter',
1578     'section'     => 'invoicing',
1579     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
1580     'type'        => 'textarea',
1581     'per_agent'   => 1,
1582     'per_locale'  => 1,
1583   },
1584
1585   {
1586     'key'         => 'invoice_email_pdf',
1587     'section'     => 'invoicing',
1588     'description' => 'Send PDF invoice as an attachment to emailed invoices.  By default, includes the HTML invoice as the email body, unless invoice_email_pdf_note is set.',
1589     'type'        => 'checkbox'
1590   },
1591
1592   {
1593     'key'         => 'quotation_email_pdf',
1594     'section'     => '',
1595     'description' => 'Send PDF quotations as an attachment to emailed quotations.  By default, includes the HTML quotation as the email body, unless quotation_email_pdf_note is set.',
1596     'type'        => 'checkbox'
1597   },
1598
1599   {
1600     'key'         => 'invoice_email_pdf_msgnum',
1601     'section'     => 'invoicing',
1602     'description' => 'Message template to send as the text and HTML part of PDF invoices. If not selected, a text and HTML version of the invoice will be sent.',
1603     %msg_template_options,
1604   },
1605
1606   {
1607     'key'         => 'invoice_email_pdf_note',
1608     'section'     => 'invoicing',
1609     'description' => 'If defined, this text will replace the default HTML invoice as the body of emailed PDF invoices.',
1610     'type'        => 'textarea'
1611   },
1612
1613   {
1614     'key'         => 'quotation_email_pdf_note',
1615     'section'     => '',
1616     'description' => 'If defined, this text will replace the default HTML quotation as the body of emailed PDF quotations.',
1617     'type'        => 'textarea'
1618   },
1619
1620   {
1621     'key'         => 'invoice_print_pdf',
1622     'section'     => 'invoicing',
1623     'description' => 'For all invoice print operations, store postal invoices for download in PDF format rather than printing them directly.',
1624     'type'        => 'checkbox',
1625   },
1626
1627   {
1628     'key'         => 'invoice_print_pdf-spoolagent',
1629     'section'     => 'invoicing',
1630     'description' => 'Store postal invoices PDF downloads in per-agent spools.',
1631     'type'        => 'checkbox',
1632   },
1633
1634   {
1635     'key'         => 'invoice_print_pdf-duplex',
1636     'section'     => 'invoicing',
1637     'description' => 'Insert blank pages so that spooled invoices are each an even number of pages.  Use this for double-sided printing.',
1638     'type'        => 'checkbox',
1639   },
1640
1641   { 
1642     'key'         => 'invoice_default_terms',
1643     'section'     => 'invoicing',
1644     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1645     'type'        => 'select',
1646     'per_agent'   => 1,
1647     'select_enum' => [ 
1648       '', 'Payable upon receipt', 'Net 0', 'Net 3', 'Net 5', 'Net 9', 'Net 10', 'Net 14', 
1649       'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 25', 'Net 30', 'Net 45', 
1650       'Net 60', 'Net 90'
1651     ], },
1652
1653   { 
1654     'key'         => 'invoice_show_prior_due_date',
1655     'section'     => 'invoicing',
1656     'description' => 'Show previous invoice due dates when showing prior balances.  Default is to show invoice date.',
1657     'type'        => 'checkbox',
1658   },
1659
1660   { 
1661     'key'         => 'invoice_sections',
1662     'section'     => 'invoicing',
1663     'description' => 'Split invoice into sections and label according to package category when enabled.',
1664     'type'        => 'checkbox',
1665     'per_agent'   => 1,
1666   },
1667
1668   { 
1669     'key'         => 'invoice_include_aging',
1670     'section'     => 'invoicing',
1671     'description' => 'Show an aging line after the prior balance section.  Only valid when invoice_sections is enabled.',
1672     'type'        => 'checkbox',
1673   },
1674
1675   {
1676     'key'         => 'invoice_sections_method',
1677     'section'     => 'invoicing',
1678     'description' => 'How to group line items on multi-section invoices.',
1679     'type'        => 'select',
1680     'select_enum' => [ qw(category location) ],
1681   },
1682
1683   {
1684     'key'         => 'summary_subtotals_method',
1685     'section'     => 'invoicing',
1686     'description' => 'How to group line items when calculating summary subtotals.  By default, it will be the same method used for grouping invoice sections.',
1687     'type'        => 'select',
1688     'select_enum' => [ qw(category location) ],
1689   },
1690
1691   #quotations seem broken-ish with sections ATM?
1692   #{ 
1693   #  'key'         => 'quotation_sections',
1694   #  'section'     => 'invoicing',
1695   #  'description' => 'Split quotations into sections and label according to package category when enabled.',
1696   #  'type'        => 'checkbox',
1697   #  'per_agent'   => 1,
1698   #},
1699
1700   {
1701     'key'         => 'usage_class_summary',
1702     'section'     => 'invoicing',
1703     'description' => 'Summarize total usage by usage class in a separate section.',
1704     'type'        => 'checkbox',
1705   },
1706
1707   { 
1708     'key'         => 'usage_class_as_a_section',
1709     'section'     => 'invoicing',
1710     'description' => 'Split usage into sections and label according to usage class name when enabled.  Only valid when invoice_sections is enabled.',
1711     'type'        => 'checkbox',
1712   },
1713
1714   { 
1715     'key'         => 'phone_usage_class_summary',
1716     'section'     => 'invoicing',
1717     'description' => 'Summarize usage per DID by usage class and display all CDRs together regardless of usage class. Only valid when svc_phone_sections is enabled.',
1718     'type'        => 'checkbox',
1719   },
1720
1721   { 
1722     'key'         => 'svc_phone_sections',
1723     'section'     => 'invoicing',
1724     'description' => 'Create a section for each svc_phone when enabled.  Only valid when invoice_sections is enabled.',
1725     'type'        => 'checkbox',
1726   },
1727
1728   {
1729     'key'         => 'finance_pkgclass',
1730     'section'     => 'billing',
1731     'description' => 'The default package class for late fee charges, used if the fee event does not specify a package class itself.',
1732     'type'        => 'select-pkg_class',
1733   },
1734
1735   { 
1736     'key'         => 'separate_usage',
1737     'section'     => 'invoicing',
1738     'description' => 'Split the rated call usage into a separate line from the recurring charges.',
1739     'type'        => 'checkbox',
1740   },
1741
1742   {
1743     'key'         => 'invoice_send_receipts',
1744     'section'     => 'deprecated',
1745     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
1746     'type'        => 'checkbox',
1747   },
1748
1749   {
1750     'key'         => 'payment_receipt',
1751     'section'     => 'notification',
1752     'description' => 'Send payment receipts.',
1753     'type'        => 'checkbox',
1754     'per_agent'   => 1,
1755     'agent_bool'  => 1,
1756   },
1757
1758   {
1759     'key'         => 'payment_receipt_statement_mode',
1760     'section'     => 'notification',
1761     'description' => 'Automatic payments will cause a post-payment statement to be sent to the customer. Select the invoice mode to use for this statement. If unspecified, it will use the "_statement" versions of invoice configuration settings, and have the notice name "Statement".',
1762     %invoice_mode_options,
1763   },
1764
1765   {
1766     'key'         => 'payment_receipt_msgnum',
1767     'section'     => 'notification',
1768     'description' => 'Template to use for manual payment receipts.',
1769     %msg_template_options,
1770   },
1771   
1772   {
1773     'key'         => 'payment_receipt_from',
1774     'section'     => 'notification',
1775     'description' => 'From: address for payment receipts, if not specified in the template.',
1776     'type'        => 'text',
1777     'per_agent'   => 1,
1778   },
1779
1780   {
1781     'key'         => 'payment_receipt_email',
1782     'section'     => 'deprecated',
1783     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.',
1784     'type'        => [qw( checkbox textarea )],
1785   },
1786
1787   {
1788     'key'         => 'payment_receipt-trigger',
1789     'section'     => 'notification',
1790     'description' => 'When payment receipts are triggered.  Defaults to when payment is made.',
1791     'type'        => 'select',
1792     'select_hash' => [
1793                        'cust_pay'          => 'When payment is made.',
1794                        'cust_bill_pay_pkg' => 'When payment is applied.',
1795                      ],
1796     'per_agent'   => 1,
1797   },
1798
1799   {
1800     'key'         => 'trigger_export_insert_on_payment',
1801     'section'     => 'billing',
1802     'description' => 'Enable exports on payment application.',
1803     'type'        => 'checkbox',
1804   },
1805
1806   {
1807     'key'         => 'lpr',
1808     'section'     => 'required',
1809     'description' => 'Print command for paper invoices, for example `lpr -h\'',
1810     'type'        => 'text',
1811     'per_agent'   => 1,
1812   },
1813
1814   {
1815     'key'         => 'lpr-postscript_prefix',
1816     'section'     => 'billing',
1817     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1818     'type'        => 'text',
1819   },
1820
1821   {
1822     'key'         => 'lpr-postscript_suffix',
1823     'section'     => 'billing',
1824     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1825     'type'        => 'text',
1826   },
1827
1828   {
1829     'key'         => 'papersize',
1830     'section'     => 'billing',
1831     'description' => 'Invoice paper size.  Default is "letter" (U.S. standard).  The LaTeX template must be configured to match this size.',
1832     'type'        => 'select',
1833     'select_enum' => [ qw(letter a4) ],
1834   },
1835
1836   {
1837     'key'         => 'money_char',
1838     'section'     => '',
1839     'description' => 'Currency symbol - defaults to `$\'',
1840     'type'        => 'text',
1841   },
1842
1843   {
1844     'key'         => 'defaultrecords',
1845     'section'     => 'BIND',
1846     'description' => 'DNS entries to add automatically when creating a domain',
1847     'type'        => 'editlist',
1848     'editlist_parts' => [ { type=>'text' },
1849                           { type=>'immutable', value=>'IN' },
1850                           { type=>'select',
1851                             select_enum => {
1852                               map { $_=>$_ }
1853                                   #@{ FS::domain_record->rectypes }
1854                                   qw(A AAAA CNAME MX NS PTR SPF SRV TXT)
1855                             },
1856                           },
1857                           { type=> 'text' }, ],
1858   },
1859
1860   {
1861     'key'         => 'passwordmin',
1862     'section'     => 'password',
1863     'description' => 'Minimum password length (default 6)',
1864     'type'        => 'text',
1865   },
1866
1867   {
1868     'key'         => 'passwordmax',
1869     'section'     => 'password',
1870     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1871     'type'        => 'text',
1872   },
1873
1874   {
1875     'key'         => 'sip_passwordmin',
1876     'section'     => 'telephony',
1877     'description' => 'Minimum SIP password length (default 6)',
1878     'type'        => 'text',
1879   },
1880
1881   {
1882     'key'         => 'sip_passwordmax',
1883     'section'     => 'telephony',
1884     'description' => 'Maximum SIP password length (default 80)',
1885     'type'        => 'text',
1886   },
1887
1888
1889   {
1890     'key'         => 'password-noampersand',
1891     'section'     => 'password',
1892     'description' => 'Disallow ampersands in passwords',
1893     'type'        => 'checkbox',
1894   },
1895
1896   {
1897     'key'         => 'password-noexclamation',
1898     'section'     => 'password',
1899     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1900     'type'        => 'checkbox',
1901   },
1902
1903   {
1904     'key'         => 'default-password-encoding',
1905     'section'     => 'password',
1906     'description' => 'Default storage format for passwords',
1907     'type'        => 'select',
1908     'select_hash' => [
1909       'plain'       => 'Plain text',
1910       'crypt-des'   => 'Unix password (DES encrypted)',
1911       'crypt-md5'   => 'Unix password (MD5 digest)',
1912       'ldap-plain'  => 'LDAP (plain text)',
1913       'ldap-crypt'  => 'LDAP (DES encrypted)',
1914       'ldap-md5'    => 'LDAP (MD5 digest)',
1915       'ldap-sha1'   => 'LDAP (SHA1 digest)',
1916       'legacy'      => 'Legacy mode',
1917     ],
1918   },
1919
1920   {
1921     'key'         => 'referraldefault',
1922     'section'     => 'UI',
1923     'description' => 'Default referral, specified by refnum',
1924     'type'        => 'select-sub',
1925     'options_sub' => sub { require FS::Record;
1926                            require FS::part_referral;
1927                            map { $_->refnum => $_->referral }
1928                                FS::Record::qsearch( 'part_referral', 
1929                                                     { 'disabled' => '' }
1930                                                   );
1931                          },
1932     'option_sub'  => sub { require FS::Record;
1933                            require FS::part_referral;
1934                            my $part_referral = FS::Record::qsearchs(
1935                              'part_referral', { 'refnum'=>shift } );
1936                            $part_referral ? $part_referral->referral : '';
1937                          },
1938   },
1939
1940 #  {
1941 #    'key'         => 'registries',
1942 #    'section'     => 'required',
1943 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
1944 #  },
1945
1946   {
1947     'key'         => 'report_template',
1948     'section'     => 'deprecated',
1949     'description' => 'Deprecated template file for reports.',
1950     'type'        => 'textarea',
1951   },
1952
1953   {
1954     'key'         => 'maxsearchrecordsperpage',
1955     'section'     => 'UI',
1956     'description' => 'If set, number of search records to return per page.',
1957     'type'        => 'text',
1958   },
1959
1960   {
1961     'key'         => 'disable_maxselect',
1962     'section'     => 'UI',
1963     'description' => 'Prevent changing the number of records per page.',
1964     'type'        => 'checkbox',
1965   },
1966
1967   {
1968     'key'         => 'session-start',
1969     'section'     => 'session',
1970     'description' => 'If defined, the command which is executed on the Freeside machine when a session begins.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
1971     'type'        => 'text',
1972   },
1973
1974   {
1975     'key'         => 'session-stop',
1976     'section'     => 'session',
1977     'description' => 'If defined, the command which is executed on the Freeside machine when a session ends.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
1978     'type'        => 'text',
1979   },
1980
1981   {
1982     'key'         => 'shells',
1983     'section'     => 'shell',
1984     'description' => 'Legal shells (think /etc/shells).  You probably want to `cut -d: -f7 /etc/passwd | sort | uniq\' initially so that importing doesn\'t fail with `Illegal shell\' errors, then remove any special entries afterwords.  A blank line specifies that an empty shell is permitted.',
1985     'type'        => 'textarea',
1986   },
1987
1988   {
1989     'key'         => 'showpasswords',
1990     'section'     => 'UI',
1991     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1992     'type'        => 'checkbox',
1993   },
1994
1995   {
1996     'key'         => 'report-showpasswords',
1997     'section'     => 'UI',
1998     'description' => 'This is a terrible idea.  Do not enable it.  STRONGLY NOT RECOMMENDED.  Enables display of passwords on services reports.',
1999     'type'        => 'checkbox',
2000   },
2001
2002   {
2003     'key'         => 'signupurl',
2004     'section'     => 'UI',
2005     'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
2006     'type'        => 'text',
2007   },
2008
2009   {
2010     'key'         => 'smtpmachine',
2011     'section'     => 'required',
2012     'description' => 'SMTP relay for Freeside\'s outgoing mail',
2013     'type'        => 'text',
2014   },
2015
2016   {
2017     'key'         => 'smtp-username',
2018     'section'     => '',
2019     'description' => 'Optional SMTP username for Freeside\'s outgoing mail',
2020     'type'        => 'text',
2021   },
2022
2023   {
2024     'key'         => 'smtp-password',
2025     'section'     => '',
2026     'description' => 'Optional SMTP password for Freeside\'s outgoing mail',
2027     'type'        => 'text',
2028   },
2029
2030   {
2031     'key'         => 'smtp-encryption',
2032     'section'     => '',
2033     'description' => 'Optional SMTP encryption method.  The STARTTLS methods require smtp-username and smtp-password to be set.',
2034     'type'        => 'select',
2035     'select_hash' => [ '25'           => 'None (port 25)',
2036                        '25-starttls'  => 'STARTTLS (port 25)',
2037                        '587-starttls' => 'STARTTLS / submission (port 587)',
2038                        '465-tls'      => 'SMTPS (SSL) (port 465)',
2039                      ],
2040   },
2041
2042   {
2043     'key'         => 'soadefaultttl',
2044     'section'     => 'BIND',
2045     'description' => 'SOA default TTL for new domains.',
2046     'type'        => 'text',
2047   },
2048
2049   {
2050     'key'         => 'soaemail',
2051     'section'     => 'BIND',
2052     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
2053     'type'        => 'text',
2054   },
2055
2056   {
2057     'key'         => 'soaexpire',
2058     'section'     => 'BIND',
2059     'description' => 'SOA expire for new domains',
2060     'type'        => 'text',
2061   },
2062
2063   {
2064     'key'         => 'soamachine',
2065     'section'     => 'BIND',
2066     'description' => 'SOA machine for new domains, with trailing `.\'',
2067     'type'        => 'text',
2068   },
2069
2070   {
2071     'key'         => 'soarefresh',
2072     'section'     => 'BIND',
2073     'description' => 'SOA refresh for new domains',
2074     'type'        => 'text',
2075   },
2076
2077   {
2078     'key'         => 'soaretry',
2079     'section'     => 'BIND',
2080     'description' => 'SOA retry for new domains',
2081     'type'        => 'text',
2082   },
2083
2084   {
2085     'key'         => 'statedefault',
2086     'section'     => 'UI',
2087     'description' => 'Default state or province (if not supplied, the default is `CA\')',
2088     'type'        => 'text',
2089   },
2090
2091   {
2092     'key'         => 'unsuspendauto',
2093     'section'     => 'billing',
2094     'description' => 'Enables the automatic unsuspension of suspended packages when a customer\'s balance due changes from positive to zero or negative as the result of a payment or credit',
2095     'type'        => 'checkbox',
2096   },
2097
2098   {
2099     'key'         => 'unsuspend-always_adjust_next_bill_date',
2100     'section'     => 'billing',
2101     'description' => 'Global override that causes unsuspensions to always adjust the next bill date under any circumstances.  This is now controlled on a per-package bases - probably best not to use this option unless you are a legacy installation that requires this behaviour.',
2102     'type'        => 'checkbox',
2103   },
2104
2105   {
2106     'key'         => 'usernamemin',
2107     'section'     => 'username',
2108     'description' => 'Minimum username length (default 2)',
2109     'type'        => 'text',
2110   },
2111
2112   {
2113     'key'         => 'usernamemax',
2114     'section'     => 'username',
2115     'description' => 'Maximum username length',
2116     'type'        => 'text',
2117   },
2118
2119   {
2120     'key'         => 'username-ampersand',
2121     'section'     => 'username',
2122     'description' => 'Allow the ampersand character (&amp;) in usernames.  Be careful when using this option in conjunction with <a href="../browse/part_export.cgi">exports</a> which execute shell commands, as the ampersand will be interpreted by the shell if not quoted.',
2123     'type'        => 'checkbox',
2124   },
2125
2126   {
2127     'key'         => 'username-letter',
2128     'section'     => 'username',
2129     'description' => 'Usernames must contain at least one letter',
2130     'type'        => 'checkbox',
2131     'per_agent'   => 1,
2132   },
2133
2134   {
2135     'key'         => 'username-letterfirst',
2136     'section'     => 'username',
2137     'description' => 'Usernames must start with a letter',
2138     'type'        => 'checkbox',
2139   },
2140
2141   {
2142     'key'         => 'username-noperiod',
2143     'section'     => 'username',
2144     'description' => 'Disallow periods in usernames',
2145     'type'        => 'checkbox',
2146   },
2147
2148   {
2149     'key'         => 'username-nounderscore',
2150     'section'     => 'username',
2151     'description' => 'Disallow underscores in usernames',
2152     'type'        => 'checkbox',
2153   },
2154
2155   {
2156     'key'         => 'username-nodash',
2157     'section'     => 'username',
2158     'description' => 'Disallow dashes in usernames',
2159     'type'        => 'checkbox',
2160   },
2161
2162   {
2163     'key'         => 'username-uppercase',
2164     'section'     => 'username',
2165     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
2166     'type'        => 'checkbox',
2167     'per_agent'   => 1,
2168   },
2169
2170   { 
2171     'key'         => 'username-percent',
2172     'section'     => 'username',
2173     'description' => 'Allow the percent character (%) in usernames.',
2174     'type'        => 'checkbox',
2175   },
2176
2177   { 
2178     'key'         => 'username-colon',
2179     'section'     => 'username',
2180     'description' => 'Allow the colon character (:) in usernames.',
2181     'type'        => 'checkbox',
2182   },
2183
2184   { 
2185     'key'         => 'username-slash',
2186     'section'     => 'username',
2187     'description' => 'Allow the slash character (/) in usernames.  When using, make sure to set "Home directory" to fixed and blank in all svc_acct service definitions.',
2188     'type'        => 'checkbox',
2189   },
2190
2191   { 
2192     'key'         => 'username-equals',
2193     'section'     => 'username',
2194     'description' => 'Allow the equal sign character (=) in usernames.',
2195     'type'        => 'checkbox',
2196   },
2197
2198   {
2199     'key'         => 'show_ship_company',
2200     'section'     => 'UI',
2201     'description' => 'Turns on display/collection of a "service company name" field for customers.',
2202     'type'        => 'checkbox',
2203   },
2204
2205   {
2206     'key'         => 'show_ss',
2207     'section'     => 'UI',
2208     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
2209     'type'        => 'checkbox',
2210   },
2211
2212   {
2213     'key'         => 'unmask_ss',
2214     'section'     => 'UI',
2215     'description' => "Don't mask social security numbers in the web interface.",
2216     'type'        => 'checkbox',
2217   },
2218
2219   {
2220     'key'         => 'show_stateid',
2221     'section'     => 'UI',
2222     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
2223     'type'        => 'checkbox',
2224   },
2225
2226   {
2227     'key'         => 'national_id-country',
2228     'section'     => 'UI',
2229     'description' => 'Track a national identification number, for specific countries.',
2230     'type'        => 'select',
2231     'select_enum' => [ '', 'MY' ],
2232   },
2233
2234   {
2235     'key'         => 'show_bankstate',
2236     'section'     => 'UI',
2237     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
2238     'type'        => 'checkbox',
2239   },
2240
2241   { 
2242     'key'         => 'agent_defaultpkg',
2243     'section'     => 'UI',
2244     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
2245     'type'        => 'checkbox',
2246   },
2247
2248   {
2249     'key'         => 'legacy_link',
2250     'section'     => 'UI',
2251     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
2252     'type'        => 'checkbox',
2253   },
2254
2255   {
2256     'key'         => 'legacy_link-steal',
2257     'section'     => 'UI',
2258     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
2259     'type'        => 'checkbox',
2260   },
2261
2262   {
2263     'key'         => 'queue_dangerous_controls',
2264     'section'     => 'UI',
2265     'description' => 'Enable queue modification controls on account pages and for new jobs.  Unless you are a developer working on new export code, you should probably leave this off to avoid causing provisioning problems.',
2266     'type'        => 'checkbox',
2267   },
2268
2269   {
2270     'key'         => 'security_phrase',
2271     'section'     => 'password',
2272     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
2273     'type'        => 'checkbox',
2274   },
2275
2276   {
2277     'key'         => 'locale',
2278     'section'     => 'UI',
2279     'description' => 'Default locale',
2280     'type'        => 'select-sub',
2281     'options_sub' => sub {
2282       map { $_ => FS::Locales->description($_) } FS::Locales->locales;
2283     },
2284     'option_sub'  => sub {
2285       FS::Locales->description(shift)
2286     },
2287   },
2288
2289   {
2290     'key'         => 'signup_server-payby',
2291     'section'     => 'self-service',
2292     'description' => 'Acceptable payment types for the signup server',
2293     'type'        => 'selectmultiple',
2294     'select_enum' => [ qw(CARD DCRD CHEK DCHK PREPAY PPAL ) ], # BILL COMP) ],
2295   },
2296
2297   {
2298     'key'         => 'selfservice-payment_gateway',
2299     'section'     => 'self-service',
2300     'description' => 'Force the use of this payment gateway for self-service.',
2301     %payment_gateway_options,
2302   },
2303
2304   {
2305     'key'         => 'selfservice-save_unchecked',
2306     'section'     => 'self-service',
2307     'description' => 'In self-service, uncheck "Remember information" checkboxes by default (normally, they are checked by default).',
2308     'type'        => 'checkbox',
2309   },
2310
2311   {
2312     'key'         => 'default_agentnum',
2313     'section'     => 'UI',
2314     'description' => 'Default agent for the backoffice',
2315     'type'        => 'select-agent',
2316   },
2317
2318   {
2319     'key'         => 'signup_server-default_agentnum',
2320     'section'     => 'self-service',
2321     'description' => 'Default agent for the signup server',
2322     'type'        => 'select-agent',
2323   },
2324
2325   {
2326     'key'         => 'signup_server-default_refnum',
2327     'section'     => 'self-service',
2328     'description' => 'Default advertising source for the signup server',
2329     'type'        => 'select-sub',
2330     'options_sub' => sub { require FS::Record;
2331                            require FS::part_referral;
2332                            map { $_->refnum => $_->referral }
2333                                FS::Record::qsearch( 'part_referral', 
2334                                                     { 'disabled' => '' }
2335                                                   );
2336                          },
2337     'option_sub'  => sub { require FS::Record;
2338                            require FS::part_referral;
2339                            my $part_referral = FS::Record::qsearchs(
2340                              'part_referral', { 'refnum'=>shift } );
2341                            $part_referral ? $part_referral->referral : '';
2342                          },
2343   },
2344
2345   {
2346     'key'         => 'signup_server-default_pkgpart',
2347     'section'     => 'self-service',
2348     'description' => 'Default package for the signup server',
2349     'type'        => 'select-part_pkg',
2350   },
2351
2352   {
2353     'key'         => 'signup_server-default_svcpart',
2354     'section'     => 'self-service',
2355     'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning or domain selection).',
2356     'type'        => 'select-part_svc',
2357   },
2358
2359   {
2360     'key'         => 'signup_server-default_domsvc',
2361     'section'     => 'self-service',
2362     'description' => 'If specified, the default domain svcpart for signup (useful when domain is set to selectable choice).',
2363     'type'        => 'text',
2364   },
2365
2366   {
2367     'key'         => 'signup_server-mac_addr_svcparts',
2368     'section'     => 'self-service',
2369     'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
2370     'type'        => 'select-part_svc',
2371     'multiple'    => 1,
2372   },
2373
2374   {
2375     'key'         => 'signup_server-nomadix',
2376     'section'     => 'self-service',
2377     'description' => 'Signup page Nomadix integration',
2378     'type'        => 'checkbox',
2379   },
2380
2381   {
2382     'key'         => 'signup_server-service',
2383     'section'     => 'self-service',
2384     'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
2385     'type'        => 'select',
2386     'select_hash' => [
2387                        'svc_acct'  => 'Account (svc_acct)',
2388                        'svc_phone' => 'Phone number (svc_phone)',
2389                        'svc_pbx'   => 'PBX (svc_pbx)',
2390                      ],
2391   },
2392   
2393   {
2394     'key'         => 'signup_server-prepaid-template-custnum',
2395     'section'     => 'self-service',
2396     'description' => 'When the signup server is used with prepaid cards and customer info is not required for signup, the contact/address info will be copied from this customer, if specified',
2397     'type'        => 'text',
2398   },
2399
2400   {
2401     'key'         => 'signup_server-terms_of_service',
2402     'section'     => 'self-service',
2403     'description' => 'Terms of Service for the signup server.  May contain HTML.',
2404     'type'        => 'textarea',
2405     'per_agent'   => 1,
2406   },
2407
2408   {
2409     'key'         => 'selfservice_server-base_url',
2410     'section'     => 'self-service',
2411     'description' => 'Base URL for the self-service web interface - necessary for some widgets to find their way, including retrieval of non-US state information and phone number provisioning.',
2412     'type'        => 'text',
2413   },
2414
2415   {
2416     'key'         => 'show-msgcat-codes',
2417     'section'     => 'UI',
2418     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
2419     'type'        => 'checkbox',
2420   },
2421
2422   {
2423     'key'         => 'signup_server-realtime',
2424     'section'     => 'self-service',
2425     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
2426     'type'        => 'checkbox',
2427   },
2428
2429   {
2430     'key'         => 'signup_server-classnum2',
2431     'section'     => 'self-service',
2432     'description' => 'Package Class for first optional purchase',
2433     'type'        => 'select-pkg_class',
2434   },
2435
2436   {
2437     'key'         => 'signup_server-classnum3',
2438     'section'     => 'self-service',
2439     'description' => 'Package Class for second optional purchase',
2440     'type'        => 'select-pkg_class',
2441   },
2442
2443   {
2444     'key'         => 'signup_server-third_party_as_card',
2445     'section'     => 'self-service',
2446     'description' => 'Allow customer payment type to be set to CARD even when using third-party credit card billing.',
2447     'type'        => 'checkbox',
2448   },
2449
2450   {
2451     'key'         => 'selfservice-xmlrpc',
2452     'section'     => 'self-service',
2453     'description' => 'Run a standalone self-service XML-RPC server on the backend (on port 8080).',
2454     'type'        => 'checkbox',
2455   },
2456
2457   {
2458     'key'         => 'selfservice-timeout',
2459     'section'     => 'self-service',
2460     'description' => 'Timeout for the self-service login cookie, in seconds.  Defaults to 1 hour.',
2461     'type'        => 'text',
2462   },
2463
2464   {
2465     'key'         => 'backend-realtime',
2466     'section'     => 'billing',
2467     'description' => 'Run billing for backend signups immediately.',
2468     'type'        => 'checkbox',
2469   },
2470
2471   {
2472     'key'         => 'decline_msgnum',
2473     'section'     => 'notification',
2474     'description' => 'Template to use for credit card and electronic check decline messages.',
2475     %msg_template_options,
2476   },
2477
2478   {
2479     'key'         => 'declinetemplate',
2480     'section'     => 'deprecated',
2481     'description' => 'Template file for credit card and electronic check decline emails.',
2482     'type'        => 'textarea',
2483   },
2484
2485   {
2486     'key'         => 'emaildecline',
2487     'section'     => 'notification',
2488     'description' => 'Enable emailing of credit card and electronic check decline notices.',
2489     'type'        => 'checkbox',
2490     'per_agent'   => 1,
2491   },
2492
2493   {
2494     'key'         => 'emaildecline-exclude',
2495     'section'     => 'notification',
2496     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
2497     'type'        => 'textarea',
2498     'per_agent'   => 1,
2499   },
2500
2501   {
2502     'key'         => 'cancel_msgnum',
2503     'section'     => 'notification',
2504     'description' => 'Template to use for cancellation emails.',
2505     %msg_template_options,
2506   },
2507
2508   {
2509     'key'         => 'cancelmessage',
2510     'section'     => 'deprecated',
2511     'description' => 'Template file for cancellation emails.',
2512     'type'        => 'textarea',
2513   },
2514
2515   {
2516     'key'         => 'cancelsubject',
2517     'section'     => 'deprecated',
2518     'description' => 'Subject line for cancellation emails.',
2519     'type'        => 'text',
2520   },
2521
2522   {
2523     'key'         => 'emailcancel',
2524     'section'     => 'notification',
2525     'description' => 'Enable emailing of cancellation notices.  Make sure to select the template in the cancel_msgnum option.',
2526     'type'        => 'checkbox',
2527     'per_agent'   => 1,
2528   },
2529
2530   {
2531     'key'         => 'bill_usage_on_cancel',
2532     'section'     => 'billing',
2533     'description' => 'Enable automatic generation of an invoice for usage when a package is cancelled.  Not all packages can do this.  Usage data must already be available.',
2534     'type'        => 'checkbox',
2535   },
2536
2537   {
2538     'key'         => 'require_cardname',
2539     'section'     => 'billing',
2540     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
2541     'type'        => 'checkbox',
2542   },
2543
2544   {
2545     'key'         => 'enable_taxclasses',
2546     'section'     => 'billing',
2547     'description' => 'Enable per-package tax classes',
2548     'type'        => 'checkbox',
2549   },
2550
2551   {
2552     'key'         => 'require_taxclasses',
2553     'section'     => 'billing',
2554     'description' => 'Require a taxclass to be entered for every package',
2555     'type'        => 'checkbox',
2556   },
2557
2558   {
2559     'key'         => 'enable_taxproducts',
2560     'section'     => 'billing',
2561     'description' => 'Tax data vendor you are using.',
2562     'type'        => 'select',
2563     'select_enum' => [ 'cch', 'billsoft', 'avalara' ],
2564   },
2565
2566   {
2567     'key'         => 'taxdatadirectdownload',
2568     'section'     => 'billing',  #well
2569     'description' => 'Enable downloading tax data directly from the vendor site. at least three lines: URL, username, and password.j',
2570     'type'        => 'textarea',
2571   },
2572
2573   {
2574     'key'         => 'ignore_incalculable_taxes',
2575     'section'     => 'billing',
2576     'description' => 'Prefer to invoice without tax over not billing at all',
2577     'type'        => 'checkbox',
2578   },
2579
2580   {
2581     'key'         => 'billsoft-company_code',
2582     'section'     => 'billing',
2583     'description' => 'Billsoft tax service company code (3 letters)',
2584     'type'        => 'text',
2585   },
2586
2587   {
2588     'key'         => 'avalara-taxconfig',
2589     'section'     => 'billing',
2590     'description' => 'Avalara tax service configuration. Four lines: company code, account number, license key, test mode (1 to enable).',
2591     'type'        => 'textarea',
2592   },
2593
2594   {
2595     'key'         => 'welcome_msgnum',
2596     'section'     => 'notification',
2597     'description' => 'Template to use for welcome messages when a svc_acct record is created.',
2598     %msg_template_options,
2599   },
2600   
2601   {
2602     'key'         => 'svc_acct_welcome_exclude',
2603     'section'     => 'notification',
2604     'description' => 'A list of svc_acct services for which no welcome email is to be sent.',
2605     'type'        => 'select-part_svc',
2606     'multiple'    => 1,
2607   },
2608
2609   {
2610     'key'         => 'welcome_email',
2611     'section'     => 'deprecated',
2612     'description' => 'Template file for welcome email.  Welcome emails are sent to the customer email invoice destination(s) each time a svc_acct record is created.',
2613     'type'        => 'textarea',
2614     'per_agent'   => 1,
2615   },
2616
2617   {
2618     'key'         => 'welcome_email-from',
2619     'section'     => 'deprecated',
2620     'description' => 'From: address header for welcome email',
2621     'type'        => 'text',
2622     'per_agent'   => 1,
2623   },
2624
2625   {
2626     'key'         => 'welcome_email-subject',
2627     'section'     => 'deprecated',
2628     'description' => 'Subject: header for welcome email',
2629     'type'        => 'text',
2630     'per_agent'   => 1,
2631   },
2632   
2633   {
2634     'key'         => 'welcome_email-mimetype',
2635     'section'     => 'deprecated',
2636     'description' => 'MIME type for welcome email',
2637     'type'        => 'select',
2638     'select_enum' => [ 'text/plain', 'text/html' ],
2639     'per_agent'   => 1,
2640   },
2641
2642   {
2643     'key'         => 'welcome_letter',
2644     'section'     => '',
2645     'description' => 'Optional LaTex template file for a printed welcome letter.  A welcome letter is printed the first time a cust_pkg record is created.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation and the billing documentation for details on the template substitution language.  A variable exists for each fieldname in the customer record (<code>$first, $last, etc</code>).  The following additional variables are available<ul><li><code>$payby</code> - a friendler represenation of the field<li><code>$payinfo</code> - the masked payment information<li><code>$expdate</code> - the time at which the payment method expires (a UNIX timestamp)<li><code>$returnaddress</code> - the invoice return address for this customer\'s agent</ul>',
2646     'type'        => 'textarea',
2647   },
2648
2649 #  {
2650 #    'key'         => 'warning_msgnum',
2651 #    'section'     => 'notification',
2652 #    'description' => 'Template to use for warning messages, sent to the customer email invoice destination(s) when a svc_acct record has its usage drop below a threshold.',
2653 #    %msg_template_options,
2654 #  },
2655
2656   {
2657     'key'         => 'warning_email',
2658     'section'     => 'notification',
2659     'description' => 'Template file for warning email.  Warning emails are sent to the customer email invoice destination(s) each time a svc_acct record has its usage drop below a threshold or 0.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code> <li><code>$column</code> <li><code>$amount</code> <li><code>$threshold</code></ul>',
2660     'type'        => 'textarea',
2661   },
2662
2663   {
2664     'key'         => 'warning_email-from',
2665     'section'     => 'notification',
2666     'description' => 'From: address header for warning email',
2667     'type'        => 'text',
2668   },
2669
2670   {
2671     'key'         => 'warning_email-cc',
2672     'section'     => 'notification',
2673     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
2674     'type'        => 'text',
2675   },
2676
2677   {
2678     'key'         => 'warning_email-subject',
2679     'section'     => 'notification',
2680     'description' => 'Subject: header for warning email',
2681     'type'        => 'text',
2682   },
2683   
2684   {
2685     'key'         => 'warning_email-mimetype',
2686     'section'     => 'notification',
2687     'description' => 'MIME type for warning email',
2688     'type'        => 'select',
2689     'select_enum' => [ 'text/plain', 'text/html' ],
2690   },
2691
2692   {
2693     'key'         => 'payby',
2694     'section'     => 'billing',
2695     'description' => 'Available payment types.',
2696     'type'        => 'selectmultiple',
2697     'select_enum' => [ qw(CARD DCRD CHEK DCHK CASH WEST MCRD MCHK PPAL) ],
2698   },
2699
2700   {
2701     'key'         => 'banned_pay-pad',
2702     'section'     => 'billing',
2703     'description' => 'Padding for encrypted storage of banned credit card hashes.  If you already have new-style SHA512 entries in the banned_pay table, do not change as this will invalidate the old entries.',
2704     'type'        => 'text',
2705   },
2706
2707   {
2708     'key'         => 'payby-default',
2709     'section'     => 'deprecated',
2710     'description' => 'Deprecated; in 4.x there is no longer the concept of a single "payment type".  Used to indicate the default payment type.  HIDE disables display of billing information and sets customers to BILL.',
2711     'type'        => 'select',
2712     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD PPAL COMP HIDE) ],
2713   },
2714
2715   {
2716     'key'         => 'require_cash_deposit_info',
2717     'section'     => 'billing',
2718     'description' => 'When recording cash payments, display bank deposit information fields.',
2719     'type'        => 'checkbox',
2720   },
2721
2722   {
2723     'key'         => 'paymentforcedtobatch',
2724     'section'     => 'deprecated',
2725     'description' => 'See batch-enable_payby and realtime-disable_payby.  Used to (for CHEK): Cause per customer payment entry to be forced to a batch processor rather than performed realtime.',
2726     'type'        => 'checkbox',
2727   },
2728
2729   {
2730     'key'         => 'svc_acct-notes',
2731     'section'     => 'deprecated',
2732     'description' => 'Extra HTML to be displayed on the Account View screen.',
2733     'type'        => 'textarea',
2734   },
2735
2736   {
2737     'key'         => 'radius-password',
2738     'section'     => '',
2739     'description' => 'RADIUS attribute for plain-text passwords.',
2740     'type'        => 'select',
2741     'select_enum' => [ 'Password', 'User-Password', 'Cleartext-Password' ],
2742   },
2743
2744   {
2745     'key'         => 'radius-ip',
2746     'section'     => '',
2747     'description' => 'RADIUS attribute for IP addresses.',
2748     'type'        => 'select',
2749     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
2750   },
2751
2752   #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
2753   {
2754     'key'         => 'radius-chillispot-max',
2755     'section'     => '',
2756     'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
2757     'type'        => 'checkbox',
2758   },
2759
2760   {
2761     'key'         => 'svc_broadband-radius',
2762     'section'     => '',
2763     'description' => 'Enable RADIUS groups for broadband services.',
2764     'type'        => 'checkbox',
2765   },
2766
2767   {
2768     'key'         => 'svc_acct-alldomains',
2769     'section'     => '',
2770     'description' => 'Allow accounts to select any domain in the database.  Normally accounts can only select from the domain set in the service definition and those purchased by the customer.',
2771     'type'        => 'checkbox',
2772   },
2773
2774   {
2775     'key'         => 'dump-localdest',
2776     'section'     => '',
2777     'description' => 'Destination for local database dumps (full path)',
2778     'type'        => 'text',
2779   },
2780
2781   {
2782     'key'         => 'dump-scpdest',
2783     'section'     => '',
2784     'description' => 'Destination for scp database dumps: user@host:/path',
2785     'type'        => 'text',
2786   },
2787
2788   {
2789     'key'         => 'dump-pgpid',
2790     'section'     => '',
2791     'description' => "Optional PGP public key user or key id for database dumps.  The public key should exist on the freeside user's public keyring, and the gpg binary and GnuPG perl module should be installed.",
2792     'type'        => 'text',
2793   },
2794
2795   {
2796     'key'         => 'users-allow_comp',
2797     'section'     => 'deprecated',
2798     'description' => '<b>DEPRECATED</b>, enable the <i>Complimentary customer</i> access right instead.  Was: Usernames (Freeside users, created with <a href="../docs/man/bin/freeside-adduser.html">freeside-adduser</a>) which can create complimentary customers, one per line.  If no usernames are entered, all users can create complimentary accounts.',
2799     'type'        => 'textarea',
2800   },
2801
2802   {
2803     'key'         => 'credit_card-recurring_billing_flag',
2804     'section'     => 'billing',
2805     'description' => 'This controls when the system passes the "recurring_billing" flag on credit card transactions.  If supported by your processor (and the Business::OnlinePayment processor module), passing the flag indicates this is a recurring transaction and may turn off the CVV requirement. ',
2806     'type'        => 'select',
2807     'select_hash' => [
2808                        'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
2809                        'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
2810                      ],
2811   },
2812
2813   {
2814     'key'         => 'credit_card-recurring_billing_acct_code',
2815     'section'     => 'billing',
2816     'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
2817     'type'        => 'checkbox',
2818   },
2819
2820   {
2821     'key'         => 'cvv-save',
2822     'section'     => 'billing',
2823     'description' => 'NOT RECOMMENDED.  Saves CVV2 information after the initial transaction for the selected credit card types.  Enabling this option is almost certainly in violation of your merchant agreement(s), so please check them carefully before enabling this option for any credit card types.',
2824     'type'        => 'selectmultiple',
2825     'select_enum' => \@card_types,
2826   },
2827
2828   {
2829     'key'         => 'signup-require_cvv',
2830     'section'     => 'self-service',
2831     'description' => 'Require CVV for credit card signup.',
2832     'type'        => 'checkbox',
2833   },
2834
2835   {
2836     'key'         => 'backoffice-require_cvv',
2837     'section'     => 'billing',
2838     'description' => 'Require CVV for manual credit card entry.',
2839     'type'        => 'checkbox',
2840   },
2841
2842   {
2843     'key'         => 'selfservice-onfile_require_cvv',
2844     'section'     => 'self-service',
2845     'description' => 'Require CVV for on-file credit card during self-service payments.',
2846     'type'        => 'checkbox',
2847   },
2848
2849   {
2850     'key'         => 'selfservice-require_cvv',
2851     'section'     => 'self-service',
2852     'description' => 'Require CVV for credit card self-service payments, except for cards on-file.',
2853     'type'        => 'checkbox',
2854   },
2855
2856   {
2857     'key'         => 'manual_process-single_invoice_amount',
2858     'section'     => 'billing',
2859     'description' => 'When entering manual credit card and ACH payments, amount will not autofill if the customer has more than one open invoice',
2860     'type'        => 'checkbox',
2861   },
2862
2863   {
2864     'key'         => 'manual_process-pkgpart',
2865     'section'     => 'billing',
2866     'description' => 'Package to add to each manual credit card and ACH payment entered by employees from the backend.  Enabling this option may be in violation of your merchant agreement(s), so please check it(/them) carefully before enabling this option.',
2867     'type'        => 'select-part_pkg',
2868     'per_agent'   => 1,
2869   },
2870
2871   {
2872     'key'         => 'manual_process-display',
2873     'section'     => 'billing',
2874     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2875     'type'        => 'select',
2876     'select_hash' => [
2877                        'add'      => 'Add fee to amount entered',
2878                        'subtract' => 'Subtract fee from amount entered',
2879                      ],
2880   },
2881
2882   {
2883     'key'         => 'manual_process-skip_first',
2884     'section'     => 'billing',
2885     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
2886     'type'        => 'checkbox',
2887   },
2888
2889   {
2890     'key'         => 'selfservice_immutable-package',
2891     'section'     => 'self-service',
2892     'description' => 'Disable package changes in self-service interface.',
2893     'type'        => 'checkbox',
2894     'per_agent'   => 1,
2895   },
2896
2897   {
2898     'key'         => 'selfservice_hide-usage',
2899     'section'     => 'self-service',
2900     'description' => 'Hide usage data in self-service interface.',
2901     'type'        => 'checkbox',
2902     'per_agent'   => 1,
2903   },
2904
2905   {
2906     'key'         => 'selfservice_process-pkgpart',
2907     'section'     => 'billing',
2908     'description' => 'Package to add to each manual credit card and ACH payment entered by the customer themselves in the self-service interface.  Enabling this option may be in violation of your merchant agreement(s), so please check it(/them) carefully before enabling this option.',
2909     'type'        => 'select-part_pkg',
2910     'per_agent'   => 1,
2911   },
2912
2913   {
2914     'key'         => 'selfservice_process-display',
2915     'section'     => 'billing',
2916     'description' => 'When using selfservice_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2917     'type'        => 'select',
2918     'select_hash' => [
2919                        'add'      => 'Add fee to amount entered',
2920                        'subtract' => 'Subtract fee from amount entered',
2921                      ],
2922   },
2923
2924   {
2925     'key'         => 'selfservice_process-skip_first',
2926     'section'     => 'billing',
2927     'description' => "When using selfservice_process-pkgpart, omit the fee if it is the customer's first payment.",
2928     'type'        => 'checkbox',
2929   },
2930
2931 #  {
2932 #    'key'         => 'auto_process-pkgpart',
2933 #    'section'     => 'billing',
2934 #    'description' => 'Package to add to each automatic credit card and ACH payment processed by billing events.  Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option.',
2935 #    'type'        => 'select-part_pkg',
2936 #  },
2937 #
2938 ##  {
2939 ##    'key'         => 'auto_process-display',
2940 ##    'section'     => 'billing',
2941 ##    'description' => 'When using auto_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2942 ##    'type'        => 'select',
2943 ##    'select_hash' => [
2944 ##                       'add'      => 'Add fee to amount entered',
2945 ##                       'subtract' => 'Subtract fee from amount entered',
2946 ##                     ],
2947 ##  },
2948 #
2949 #  {
2950 #    'key'         => 'auto_process-skip_first',
2951 #    'section'     => 'billing',
2952 #    'description' => "When using auto_process-pkgpart, omit the fee if it is the customer's first payment.",
2953 #    'type'        => 'checkbox',
2954 #  },
2955
2956   {
2957     'key'         => 'allow_negative_charges',
2958     'section'     => 'billing',
2959     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
2960     'type'        => 'checkbox',
2961   },
2962   {
2963       'key'         => 'auto_unset_catchall',
2964       'section'     => '',
2965       'description' => 'When canceling a svc_acct that is the email catchall for one or more svc_domains, automatically set their catchall fields to null.  If this option is not set, the attempt will simply fail.',
2966       'type'        => 'checkbox',
2967   },
2968
2969   {
2970     'key'         => 'system_usernames',
2971     'section'     => 'username',
2972     'description' => 'A list of system usernames that cannot be edited or removed, one per line.  Use a bare username to prohibit modification/deletion of the username in any domain, or username@domain to prohibit modification/deletetion of a specific username and domain.',
2973     'type'        => 'textarea',
2974   },
2975
2976   {
2977     'key'         => 'cust_pkg-change_svcpart',
2978     'section'     => '',
2979     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
2980     'type'        => 'checkbox',
2981   },
2982
2983   {
2984     'key'         => 'cust_pkg-change_pkgpart-bill_now',
2985     'section'     => '',
2986     'description' => "When changing packages, bill the new package immediately.  Useful for prepaid situations with RADIUS where an Expiration attribute based on the package must be present at all times.",
2987     'type'        => 'checkbox',
2988   },
2989
2990   {
2991     'key'         => 'disable_autoreverse',
2992     'section'     => 'BIND',
2993     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
2994     'type'        => 'checkbox',
2995   },
2996
2997   {
2998     'key'         => 'svc_www-enable_subdomains',
2999     'section'     => '',
3000     'description' => 'Enable selection of specific subdomains for virtual host creation.',
3001     'type'        => 'checkbox',
3002   },
3003
3004   {
3005     'key'         => 'svc_www-usersvc_svcpart',
3006     'section'     => '',
3007     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
3008     'type'        => 'select-part_svc',
3009     'multiple'    => 1,
3010   },
3011
3012   {
3013     'key'         => 'selfservice_server-primary_only',
3014     'section'     => 'self-service',
3015     'description' => 'Only allow primary accounts to access self-service functionality.',
3016     'type'        => 'checkbox',
3017   },
3018
3019   {
3020     'key'         => 'selfservice_server-phone_login',
3021     'section'     => 'self-service',
3022     'description' => 'Allow login to self-service with phone number and PIN.',
3023     'type'        => 'checkbox',
3024   },
3025
3026   {
3027     'key'         => 'selfservice_server-single_domain',
3028     'section'     => 'self-service',
3029     'description' => 'If specified, only use this one domain for self-service access.',
3030     'type'        => 'text',
3031   },
3032
3033   {
3034     'key'         => 'selfservice_server-login_svcpart',
3035     'section'     => 'self-service',
3036     'description' => 'If specified, only allow the specified svcparts to login to self-service.',
3037     'type'        => 'select-part_svc',
3038     'multiple'    => 1,
3039   },
3040
3041   {
3042     'key'         => 'selfservice-svc_forward_svcpart',
3043     'section'     => 'self-service',
3044     'description' => 'Service for self-service forward editing.',
3045     'type'        => 'select-part_svc',
3046   },
3047
3048   {
3049     'key'         => 'selfservice-password_reset_verification',
3050     'section'     => 'self-service',
3051     'description' => 'If enabled, specifies the type of verification required for self-service password resets.',
3052     'type'        => 'select',
3053     'select_hash' => [ '' => 'Password reset disabled',
3054                        'email' => 'Click on a link in email',
3055                        'paymask,amount,zip' => 'Click on a link in email, and also verify with credit card (or bank account) last 4 digits, payment amount and zip code.  Note: Do not use if you have multi-customer contacts, as they will be unable to reset their passwords.',
3056                      ],
3057   },
3058
3059   {
3060     'key'         => 'selfservice-password_reset_msgnum',
3061     'section'     => 'self-service',
3062     'description' => 'Template to use for password reset emails.',
3063     %msg_template_options,
3064   },
3065
3066   {
3067     'key'         => 'selfservice-password_change_oldpass',
3068     'section'     => 'self-service',
3069     'description' => 'Require old password to be entered again for password changes (in addition to being logged in), at the API level.',
3070     'type'        => 'checkbox',
3071   },
3072
3073   {
3074     'key'         => 'selfservice-hide_invoices-taxclass',
3075     'section'     => 'self-service',
3076     'description' => 'Hide invoices with only this package tax class from self-service and supress sending (emailing, printing, faxing) them.  Typically set to something like "Previous balance" and used when importing legacy invoices into legacy_cust_bill.',
3077     'type'        => 'text',
3078   },
3079
3080   {
3081     'key'         => 'selfservice-recent-did-age',
3082     'section'     => 'self-service',
3083     'description' => 'If specified, defines "recent", in number of seconds, for "Download recently allocated DIDs" in self-service.',
3084     'type'        => 'text',
3085   },
3086
3087   {
3088     'key'         => 'selfservice_server-view-wholesale',
3089     'section'     => 'self-service',
3090     'description' => 'If enabled, use a wholesale package view in the self-service.',
3091     'type'        => 'checkbox',
3092   },
3093   
3094   {
3095     'key'         => 'selfservice-agent_signup',
3096     'section'     => 'self-service',
3097     'description' => 'Allow agent signup via self-service.',
3098     'type'        => 'checkbox',
3099   },
3100
3101   {
3102     'key'         => 'selfservice-agent_signup-agent_type',
3103     'section'     => 'self-service',
3104     'description' => 'Agent type when allowing agent signup via self-service.',
3105     'type'        => 'select-sub',
3106     'options_sub' => sub { require FS::Record;
3107                            require FS::agent_type;
3108                            map { $_->typenum => $_->atype }
3109                                FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
3110                          },
3111     'option_sub'  => sub { require FS::Record;
3112                            require FS::agent_type;
3113                            my $agent_type = FS::Record::qsearchs(
3114                              'agent_type', { 'typenum'=>shift }
3115                            );
3116                            $agent_type ? $agent_type->atype : '';
3117                          },
3118   },
3119
3120   {
3121     'key'         => 'selfservice-agent_login',
3122     'section'     => 'self-service',
3123     'description' => 'Allow agent login via self-service.',
3124     'type'        => 'checkbox',
3125   },
3126
3127   {
3128     'key'         => 'selfservice-self_suspend_reason',
3129     'section'     => 'self-service',
3130     'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
3131     'type'        => 'select-sub',
3132     #false laziness w/api_credit_reason
3133     'options_sub' => sub { require FS::Record;
3134                            require FS::reason;
3135                            my $type = qsearchs('reason_type', 
3136                              { class => 'S' }) 
3137                               or return ();
3138                            map { $_->reasonnum => $_->reason }
3139                                FS::Record::qsearch('reason', 
3140                                  { reason_type => $type->typenum } 
3141                                );
3142                          },
3143     'option_sub'  => sub { require FS::Record;
3144                            require FS::reason;
3145                            my $reason = FS::Record::qsearchs(
3146                              'reason', { 'reasonnum' => shift }
3147                            );
3148                            $reason ? $reason->reason : '';
3149                          },
3150
3151     'per_agent'   => 1,
3152   },
3153
3154   {
3155     'key'         => 'card_refund-days',
3156     'section'     => 'billing',
3157     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
3158     'type'        => 'text',
3159   },
3160
3161   {
3162     'key'         => 'agent-showpasswords',
3163     'section'     => '',
3164     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
3165     'type'        => 'checkbox',
3166   },
3167
3168   {
3169     'key'         => 'global_unique-username',
3170     'section'     => 'username',
3171     'description' => 'Global username uniqueness control: none (usual setting - check uniqueness per exports), username (all usernames are globally unique, regardless of domain or exports), or username@domain (all username@domain pairs are globally unique, regardless of exports).  disabled turns off duplicate checking completely and is STRONGLY NOT RECOMMENDED unless you REALLY need to turn this off.',
3172     'type'        => 'select',
3173     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
3174   },
3175
3176   {
3177     'key'         => 'global_unique-phonenum',
3178     'section'     => '',
3179     'description' => 'Global phone number uniqueness control: none (usual setting - check countrycode+phonenumun uniqueness per exports), or countrycode+phonenum (all countrycode+phonenum pairs are globally unique, regardless of exports).  disabled turns off duplicate checking completely and is STRONGLY NOT RECOMMENDED unless you REALLY need to turn this off.',
3180     'type'        => 'select',
3181     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
3182   },
3183
3184   {
3185     'key'         => 'global_unique-pbx_title',
3186     'section'     => '',
3187     'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
3188     'type'        => 'select',
3189     'select_enum' => [ 'enabled', 'disabled' ],
3190   },
3191
3192   {
3193     'key'         => 'global_unique-pbx_id',
3194     'section'     => '',
3195     'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
3196     'type'        => 'select',
3197     'select_enum' => [ 'enabled', 'disabled' ],
3198   },
3199
3200   {
3201     'key'         => 'svc_external-skip_manual',
3202     'section'     => 'UI',
3203     'description' => 'When provisioning svc_external services, skip manual entry of id and title fields in the UI.  Usually used in conjunction with an export that populates these fields (i.e. artera_turbo).',
3204     'type'        => 'checkbox',
3205   },
3206
3207   {
3208     'key'         => 'svc_external-display_type',
3209     'section'     => 'UI',
3210     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
3211     'type'        => 'select',
3212     'select_enum' => [ 'generic', 'artera_turbo', ],
3213   },
3214
3215   {
3216     'key'         => 'ticket_system',
3217     'section'     => 'ticketing',
3218     'description' => 'Ticketing system integration.  <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:RT_Installation">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
3219     'type'        => 'select',
3220     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
3221     'select_enum' => [ '', qw(RT_Internal RT_External) ],
3222   },
3223
3224   {
3225     'key'         => 'network_monitoring_system',
3226     'section'     => 'network_monitoring',
3227     'description' => 'Networking monitoring system (NMS) integration.  <b>Torrus_Internal</b> uses the built-in Torrus ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:3:Documentation:Torrus_Installation">integrated networking monitoring system installation instructions</a>).',
3228     'type'        => 'select',
3229     'select_enum' => [ '', qw(Torrus_Internal) ],
3230   },
3231
3232   {
3233     'key'         => 'nms-auto_add-svc_ips',
3234     'section'     => 'network_monitoring',
3235     'description' => 'Automatically add (and remove) IP addresses from these service tables to the network monitoring system.',
3236     'type'        => 'selectmultiple',
3237     'select_enum' => [ 'svc_acct', 'svc_broadband', 'svc_dsl' ],
3238   },
3239
3240   {
3241     'key'         => 'nms-auto_add-community',
3242     'section'     => 'network_monitoring',
3243     'description' => 'SNMP community string to use when automatically adding IP addresses from these services to the network monitoring system.',
3244     'type'        => 'text',
3245   },
3246
3247   {
3248     'key'         => 'ticket_system-default_queueid',
3249     'section'     => 'ticketing',
3250     'description' => 'Default queue used when creating new customer tickets.',
3251     'type'        => 'select-sub',
3252     'options_sub' => sub {
3253                            my $conf = new FS::Conf;
3254                            if ( $conf->config('ticket_system') ) {
3255                              eval "use FS::TicketSystem;";
3256                              die $@ if $@;
3257                              FS::TicketSystem->queues();
3258                            } else {
3259                              ();
3260                            }
3261                          },
3262     'option_sub'  => sub { 
3263                            my $conf = new FS::Conf;
3264                            if ( $conf->config('ticket_system') ) {
3265                              eval "use FS::TicketSystem;";
3266                              die $@ if $@;
3267                              FS::TicketSystem->queue(shift);
3268                            } else {
3269                              '';
3270                            }
3271                          },
3272   },
3273   {
3274     'key'         => 'ticket_system-force_default_queueid',
3275     'section'     => 'ticketing',
3276     'description' => 'Disallow queue selection when creating new tickets from customer view.',
3277     'type'        => 'checkbox',
3278   },
3279   {
3280     'key'         => 'ticket_system-selfservice_queueid',
3281     'section'     => 'ticketing',
3282     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
3283     #false laziness w/above
3284     'type'        => 'select-sub',
3285     'options_sub' => sub {
3286                            my $conf = new FS::Conf;
3287                            if ( $conf->config('ticket_system') ) {
3288                              eval "use FS::TicketSystem;";
3289                              die $@ if $@;
3290                              FS::TicketSystem->queues();
3291                            } else {
3292                              ();
3293                            }
3294                          },
3295     'option_sub'  => sub { 
3296                            my $conf = new FS::Conf;
3297                            if ( $conf->config('ticket_system') ) {
3298                              eval "use FS::TicketSystem;";
3299                              die $@ if $@;
3300                              FS::TicketSystem->queue(shift);
3301                            } else {
3302                              '';
3303                            }
3304                          },
3305   },
3306
3307   {
3308     'key'         => 'ticket_system-requestor',
3309     'section'     => 'ticketing',
3310     'description' => 'Email address to use as the requestor for new tickets.  If blank, the customer\'s invoicing address(es) will be used.',
3311     'type'        => 'text',
3312   },
3313
3314   {
3315     'key'         => 'ticket_system-priority_reverse',
3316     'section'     => 'ticketing',
3317     'description' => 'Enable this to consider lower numbered priorities more important.  A bad habit we picked up somewhere.  You probably want to avoid it and use the default.',
3318     'type'        => 'checkbox',
3319   },
3320
3321   {
3322     'key'         => 'ticket_system-custom_priority_field',
3323     'section'     => 'ticketing',
3324     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
3325     'type'        => 'text',
3326   },
3327
3328   {
3329     'key'         => 'ticket_system-custom_priority_field-values',
3330     'section'     => 'ticketing',
3331     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
3332     'type'        => 'textarea',
3333   },
3334
3335   {
3336     'key'         => 'ticket_system-custom_priority_field_queue',
3337     'section'     => 'ticketing',
3338     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
3339     'type'        => 'text',
3340   },
3341
3342   {
3343     'key'         => 'ticket_system-selfservice_priority_field',
3344     'section'     => 'ticketing',
3345     'description' => 'Custom field from the ticket system to use as a customer-managed priority field.',
3346     'type'        => 'text',
3347   },
3348
3349   {
3350     'key'         => 'ticket_system-selfservice_edit_subject',
3351     'section'     => 'ticketing',
3352     'description' => 'Allow customers to edit ticket subjects through selfservice.',
3353     'type'        => 'checkbox',
3354   },
3355
3356   {
3357     'key'         => 'ticket_system-escalation',
3358     'section'     => 'ticketing',
3359     'description' => 'Enable priority escalation of tickets as part of daily batch processing.',
3360     'type'        => 'checkbox',
3361   },
3362
3363   {
3364     'key'         => 'ticket_system-rt_external_datasrc',
3365     'section'     => 'ticketing',
3366     'description' => 'With external RT integration, the DBI data source for the external RT installation, for example, <code>DBI:Pg:user=rt_user;password=rt_word;host=rt.example.com;dbname=rt</code>',
3367     'type'        => 'text',
3368
3369   },
3370
3371   {
3372     'key'         => 'ticket_system-rt_external_url',
3373     'section'     => 'ticketing',
3374     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
3375     'type'        => 'text',
3376   },
3377
3378   {
3379     'key'         => 'company_name',
3380     'section'     => 'required',
3381     'description' => 'Your company name',
3382     'type'        => 'text',
3383     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
3384   },
3385
3386   {
3387     'key'         => 'company_url',
3388     'section'     => 'UI',
3389     'description' => 'Your company URL',
3390     'type'        => 'text',
3391     'per_agent'   => 1,
3392   },
3393
3394   {
3395     'key'         => 'company_address',
3396     'section'     => 'required',
3397     'description' => 'Your company address',
3398     'type'        => 'textarea',
3399     'per_agent'   => 1,
3400   },
3401
3402   {
3403     'key'         => 'company_phonenum',
3404     'section'     => 'notification',
3405     'description' => 'Your company phone number',
3406     'type'        => 'text',
3407     'per_agent'   => 1,
3408   },
3409
3410   {
3411     'key'         => 'city_not_required',
3412     'section'     => 'required',
3413     'description' => 'Turn off requirement for a City to be entered for billing & shipping addresses',
3414     'type'        => 'checkbox',
3415     'per_agent'   => 1,
3416   },
3417
3418   {
3419     'key'         => 'echeck-void',
3420     'section'     => 'deprecated',
3421     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
3422     'type'        => 'checkbox',
3423   },
3424
3425   {
3426     'key'         => 'cc-void',
3427     'section'     => 'deprecated',
3428     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
3429     'type'        => 'checkbox',
3430   },
3431
3432   {
3433     'key'         => 'unvoid',
3434     'section'     => 'deprecated',
3435     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
3436     'type'        => 'checkbox',
3437   },
3438
3439   {
3440     'key'         => 'address1-search',
3441     'section'     => 'UI',
3442     'description' => 'Enable the ability to search the address1 field from the quick customer search.  Not recommended in most cases as it tends to bring up too many search results - use explicit address searching from the advanced customer search instead.',
3443     'type'        => 'checkbox',
3444   },
3445
3446   {
3447     'key'         => 'address2-search',
3448     'section'     => 'UI',
3449     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
3450     'type'        => 'checkbox',
3451   },
3452
3453   {
3454     'key'         => 'cust_main-require_address2',
3455     'section'     => 'UI',
3456     'description' => 'Second address field is required (on service address only, if billing and service addresses differ).  Also enables "Unit" labeling of address2 on customer view and edit pages.  Useful for multi-tenant applications.  See also: address2-search',
3457     'type'        => 'checkbox',
3458   },
3459
3460   {
3461     'key'         => 'agent-ship_address',
3462     'section'     => '',
3463     'description' => "Use the agent's master service address as the service address (only ship_address2 can be entered, if blank on the master address).  Useful for multi-tenant applications.",
3464     'type'        => 'checkbox',
3465     'per_agent'   => 1,
3466   },
3467
3468   { 'key'         => 'referral_credit',
3469     'section'     => 'deprecated',
3470     'description' => "Used to enable one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).  Replace with a billing event on appropriate packages.",
3471     'type'        => 'checkbox',
3472   },
3473
3474   { 'key'         => 'selfservice_server-cache_module',
3475     'section'     => 'self-service',
3476     'description' => 'Module used to store self-service session information.  All modules handle any number of self-service servers.  Cache::SharedMemoryCache is appropriate for a single database / single Freeside server.  Cache::FileCache is useful for multiple databases on a single server, or when IPC::ShareLite is not available (i.e. FreeBSD).', #  _Database stores session information in the database and is appropriate for multiple Freeside servers, but may be slower.',
3477     'type'        => 'select',
3478     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
3479   },
3480
3481   {
3482     'key'         => 'hylafax',
3483     'section'     => 'billing',
3484     'description' => 'Options for a HylaFAX server to enable the FAX invoice destination.  They should be in the form of a space separated list of arguments to the Fax::Hylafax::Client::sendfax subroutine.  You probably shouldn\'t override things like \'docfile\'.  *Note* Only supported when using typeset invoices (see the invoice_latex configuration option).',
3485     'type'        => [qw( checkbox textarea )],
3486   },
3487
3488   {
3489     'key'         => 'cust_bill-ftpformat',
3490     'section'     => 'invoicing',
3491     'description' => 'Enable FTP of raw invoice data - format.',
3492     'type'        => 'select',
3493     'options'     => [ spool_formats() ],
3494   },
3495
3496   {
3497     'key'         => 'cust_bill-ftpserver',
3498     'section'     => 'invoicing',
3499     'description' => 'Enable FTP of raw invoice data - server.',
3500     'type'        => 'text',
3501   },
3502
3503   {
3504     'key'         => 'cust_bill-ftpusername',
3505     'section'     => 'invoicing',
3506     'description' => 'Enable FTP of raw invoice data - server.',
3507     'type'        => 'text',
3508   },
3509
3510   {
3511     'key'         => 'cust_bill-ftppassword',
3512     'section'     => 'invoicing',
3513     'description' => 'Enable FTP of raw invoice data - server.',
3514     'type'        => 'text',
3515   },
3516
3517   {
3518     'key'         => 'cust_bill-ftpdir',
3519     'section'     => 'invoicing',
3520     'description' => 'Enable FTP of raw invoice data - server.',
3521     'type'        => 'text',
3522   },
3523
3524   {
3525     'key'         => 'cust_bill-spoolformat',
3526     'section'     => 'invoicing',
3527     'description' => 'Enable spooling of raw invoice data - format.',
3528     'type'        => 'select',
3529     'options'     => [ spool_formats() ],
3530   },
3531
3532   {
3533     'key'         => 'cust_bill-spoolagent',
3534     'section'     => 'invoicing',
3535     'description' => 'Enable per-agent spooling of raw invoice data.',
3536     'type'        => 'checkbox',
3537   },
3538
3539   {
3540     'key'         => 'bridgestone-batch_counter',
3541     'section'     => '',
3542     'description' => 'Batch counter for spool files.  Increments every time a spool file is uploaded.',
3543     'type'        => 'text',
3544     'per_agent'   => 1,
3545   },
3546
3547   {
3548     'key'         => 'bridgestone-prefix',
3549     'section'     => '',
3550     'description' => 'Agent identifier for uploading to BABT printing service.',
3551     'type'        => 'text',
3552     'per_agent'   => 1,
3553   },
3554
3555   {
3556     'key'         => 'bridgestone-confirm_template',
3557     'section'     => '',
3558     'description' => 'Confirmation email template for uploading to BABT service.  Text::Template format, with variables "$zipfile" (name of the zipped file), "$seq" (sequence number), "$prefix" (user ID string), and "$rows" (number of records in the file).  Should include Subject: and To: headers, separated from the rest of the message by a blank line.',
3559     # this could use a true message template, but it's hard to see how that
3560     # would make the world a better place
3561     'type'        => 'textarea',
3562     'per_agent'   => 1,
3563   },
3564
3565   {
3566     'key'         => 'ics-confirm_template',
3567     'section'     => '',
3568     'description' => 'Confirmation email template for uploading to ICS invoice printing.  Text::Template format, with variables "%count" and "%sum".',
3569     'type'        => 'textarea',
3570     'per_agent'   => 1,
3571   },
3572
3573   {
3574     'key'         => 'svc_acct-usage_suspend',
3575     'section'     => 'billing',
3576     'description' => 'Suspends the package an account belongs to when svc_acct.seconds or a bytecount is decremented to 0 or below (accounts with an empty seconds and up|down|totalbytes value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
3577     'type'        => 'checkbox',
3578   },
3579
3580   {
3581     'key'         => 'svc_acct-usage_unsuspend',
3582     'section'     => 'billing',
3583     'description' => 'Unuspends the package an account belongs to when svc_acct.seconds or a bytecount is incremented from 0 or below to a positive value (accounts with an empty seconds and up|down|totalbytes value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
3584     'type'        => 'checkbox',
3585   },
3586
3587   {
3588     'key'         => 'svc_acct-usage_threshold',
3589     'section'     => 'billing',
3590     'description' => 'The threshold (expressed as percentage) of acct.seconds or acct.up|down|totalbytes at which a warning message is sent to a service holder.  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
3591     'type'        => 'text',
3592   },
3593
3594   {
3595     'key'         => 'overlimit_groups',
3596     'section'     => '',
3597     'description' => 'RADIUS group(s) to assign to svc_acct which has exceeded its bandwidth or time limit.',
3598     'type'        => 'select-sub',
3599     'per_agent'   => 1,
3600     'multiple'    => 1,
3601     'options_sub' => sub { require FS::Record;
3602                            require FS::radius_group;
3603                            map { $_->groupnum => $_->long_description }
3604                                FS::Record::qsearch('radius_group', {} );
3605                          },
3606     'option_sub'  => sub { require FS::Record;
3607                            require FS::radius_group;
3608                            my $radius_group = FS::Record::qsearchs(
3609                              'radius_group', { 'groupnum' => shift }
3610                            );
3611                $radius_group ? $radius_group->long_description : '';
3612                          },
3613   },
3614
3615   {
3616     'key'         => 'cust-fields',
3617     'section'     => 'UI',
3618     'description' => 'Which customer fields to display on reports by default',
3619     'type'        => 'select',
3620     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
3621   },
3622
3623   {
3624     'key'         => 'cust_location-label_prefix',
3625     'section'     => 'UI',
3626     'description' => 'Optional "site ID" to show in the location label',
3627     'type'        => 'select',
3628     'select_hash' => [ '' => '',
3629                        'CoStAg'    => 'CoStAgXXXXX (country, state, agent name, locationnum)',
3630                        '_location' => 'Manually defined per location',
3631                       ],
3632   },
3633
3634   {
3635     'key'         => 'cust_pkg-display_times',
3636     'section'     => 'UI',
3637     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
3638     'type'        => 'checkbox',
3639   },
3640
3641   {
3642     'key'         => 'cust_pkg-always_show_location',
3643     'section'     => 'UI',
3644     'description' => "Always display package locations, even when they're all the default service address.",
3645     'type'        => 'checkbox',
3646   },
3647
3648   {
3649     'key'         => 'cust_pkg-group_by_location',
3650     'section'     => 'UI',
3651     'description' => "Group packages by location.",
3652     'type'        => 'checkbox',
3653   },
3654
3655   {
3656     'key'         => 'cust_pkg-large_pkg_size',
3657     'section'     => 'UI',
3658     'description' => "In customer view, summarize packages with more than this many services.  Set to zero to never summarize packages.",
3659     'type'        => 'text',
3660   },
3661
3662   {
3663     'key'         => 'cust_pkg-hide_discontinued-part_svc',
3664     'section'     => 'UI',
3665     'description' => "In customer view, hide provisioned services which are no longer available in the package definition.  Not normally used except for very specific situations as it hides still-provisioned services.",
3666     'type'        => 'checkbox',
3667   },
3668
3669   {
3670     'key'         => 'part_pkg-show_fcc_options',
3671     'section'     => 'UI',
3672     'description' => "Show fields on package definitions for FCC Form 477 classification",
3673     'type'        => 'checkbox',
3674   },
3675
3676   {
3677     'key'         => 'svc_acct-edit_uid',
3678     'section'     => 'shell',
3679     'description' => 'Allow UID editing.',
3680     'type'        => 'checkbox',
3681   },
3682
3683   {
3684     'key'         => 'svc_acct-edit_gid',
3685     'section'     => 'shell',
3686     'description' => 'Allow GID editing.',
3687     'type'        => 'checkbox',
3688   },
3689
3690   {
3691     'key'         => 'svc_acct-no_edit_username',
3692     'section'     => 'shell',
3693     'description' => 'Disallow username editing.',
3694     'type'        => 'checkbox',
3695   },
3696
3697   {
3698     'key'         => 'zone-underscore',
3699     'section'     => 'BIND',
3700     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
3701     'type'        => 'checkbox',
3702   },
3703
3704   {
3705     'key'         => 'echeck-country',
3706     'section'     => 'billing',
3707     'description' => 'Format electronic check information for the specified country.',
3708     'type'        => 'select',
3709     'select_hash' => [ 'US' => 'United States',
3710                        'CA' => 'Canada (enables branch)',
3711                        'XX' => 'Other',
3712                      ],
3713   },
3714
3715   {
3716     'key'         => 'voip-cust_accountcode_cdr',
3717     'section'     => 'telephony',
3718     'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
3719     'type'        => 'checkbox',
3720   },
3721
3722   {
3723     'key'         => 'voip-cust_cdr_spools',
3724     'section'     => 'telephony',
3725     'description' => 'Enable the per-customer option for individual CDR spools.',
3726     'type'        => 'checkbox',
3727   },
3728
3729   {
3730     'key'         => 'voip-cust_cdr_squelch',
3731     'section'     => 'telephony',
3732     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
3733     'type'        => 'checkbox',
3734   },
3735
3736   {
3737     'key'         => 'voip-cdr_email',
3738     'section'     => 'telephony',
3739     'description' => 'Include the call details on emailed invoices (and HTML invoices viewed in the backend), even if the customer is configured for not printing them on the invoices.',
3740     'type'        => 'checkbox',
3741   },
3742
3743   {
3744     'key'         => 'voip-cust_email_csv_cdr',
3745     'section'     => 'telephony',
3746     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
3747     'type'        => 'checkbox',
3748   },
3749
3750   {
3751     'key'         => 'cgp_rule-domain_templates',
3752     'section'     => '',
3753     'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
3754     'type'        => 'textarea',
3755   },
3756
3757   {
3758     'key'         => 'svc_forward-no_srcsvc',
3759     'section'     => '',
3760     'description' => "Don't allow forwards from existing accounts, only arbitrary addresses.  Useful when exporting to systems such as Communigate Pro which treat forwards in this fashion.",
3761     'type'        => 'checkbox',
3762   },
3763
3764   {
3765     'key'         => 'svc_forward-arbitrary_dst',
3766     'section'     => '',
3767     'description' => "Allow forwards to point to arbitrary strings that don't necessarily look like email addresses.  Only used when using forwards for weird, non-email things.",
3768     'type'        => 'checkbox',
3769   },
3770
3771   {
3772     'key'         => 'tax-ship_address',
3773     'section'     => 'billing',
3774     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
3775     'type'        => 'checkbox',
3776   }
3777 ,
3778   {
3779     'key'         => 'tax-pkg_address',
3780     'section'     => 'billing',
3781     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the package address instead (when present).',
3782     'type'        => 'checkbox',
3783   },
3784
3785   {
3786     'key'         => 'invoice-ship_address',
3787     'section'     => 'invoicing',
3788     'description' => 'Include the shipping address on invoices.',
3789     'type'        => 'checkbox',
3790   },
3791
3792   {
3793     'key'         => 'invoice-unitprice',
3794     'section'     => 'invoicing',
3795     'description' => 'Enable unit pricing on invoices and quantities on packages.',
3796     'type'        => 'checkbox',
3797   },
3798
3799   {
3800     'key'         => 'invoice-smallernotes',
3801     'section'     => 'invoicing',
3802     'description' => 'Display the notes section in a smaller font on invoices.',
3803     'type'        => 'checkbox',
3804   },
3805
3806   {
3807     'key'         => 'invoice-smallerfooter',
3808     'section'     => 'invoicing',
3809     'description' => 'Display footers in a smaller font on invoices.',
3810     'type'        => 'checkbox',
3811   },
3812
3813   {
3814     'key'         => 'postal_invoice-fee_pkgpart',
3815     'section'     => 'billing',
3816     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
3817     'type'        => 'select-part_pkg',
3818     'per_agent'   => 1,
3819   },
3820
3821   {
3822     'key'         => 'postal_invoice-recurring_only',
3823     'section'     => 'billing',
3824     'description' => 'The postal invoice fee is omitted on invoices without recurring charges when this is set.',
3825     'type'        => 'checkbox',
3826   },
3827
3828   {
3829     'key'         => 'batch-enable',
3830     'section'     => 'deprecated', #make sure batch-enable_payby is set for
3831                                    #everyone before removing
3832     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
3833     'type'        => 'checkbox',
3834   },
3835
3836   {
3837     'key'         => 'batch-enable_payby',
3838     'section'     => 'billing',
3839     'description' => 'Enable batch processing for the specified payment types.',
3840     'type'        => 'selectmultiple',
3841     'select_enum' => [qw( CARD CHEK )],
3842   },
3843
3844   {
3845     'key'         => 'realtime-disable_payby',
3846     'section'     => 'billing',
3847     'description' => 'Disable realtime processing for the specified payment types.',
3848     'type'        => 'selectmultiple',
3849     'select_enum' => [qw( CARD CHEK )],
3850   },
3851
3852   {
3853     'key'         => 'batch-default_format',
3854     'section'     => 'billing',
3855     'description' => 'Default format for batches.',
3856     'type'        => 'select',
3857     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch',
3858                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
3859                        'paymentech', 'ach-spiritone', 'RBC', 'CIBC',
3860                     ]
3861   },
3862
3863   { 'key'         => 'batch-gateway-CARD',
3864     'section'     => 'billing',
3865     'description' => 'Business::BatchPayment gateway for credit card batches.',
3866     %batch_gateway_options,
3867   },
3868
3869   { 'key'         => 'batch-gateway-CHEK',
3870     'section'     => 'billing', 
3871     'description' => 'Business::BatchPayment gateway for check batches.',
3872     %batch_gateway_options,
3873   },
3874
3875   {
3876     'key'         => 'batch-reconsider',
3877     'section'     => 'billing',
3878     'description' => 'Allow imported batch results to change the status of payments from previous imports.  Enable this only if your gateway is known to send both positive and negative results for the same batch.',
3879     'type'        => 'checkbox',
3880   },
3881
3882   {
3883     'key'         => 'batch-auto_resolve_days',
3884     'section'     => 'billing',
3885     'description' => 'Automatically resolve payment batches this many days after they were first downloaded.',
3886     'type'        => 'text',
3887   },
3888
3889   {
3890     'key'         => 'batch-auto_resolve_status',
3891     'section'     => 'billing',
3892     'description' => 'When automatically resolving payment batches, take this action for payments of unknown status.',
3893     'type'        => 'select',
3894     'select_enum' => [ 'approve', 'decline' ],
3895   },
3896
3897   {
3898     'key'         => 'batch-errors_to',
3899     'section'     => 'billing',
3900     'description' => 'Email errors when processing batches to this address.  If unspecified, batch processing will stop immediately on error.',
3901     'type'        => 'text',
3902   },
3903
3904   #lists could be auto-generated from pay_batch info
3905   {
3906     'key'         => 'batch-fixed_format-CARD',
3907     'section'     => 'billing',
3908     'description' => 'Fixed (unchangeable) format for credit card batches.',
3909     'type'        => 'select',
3910     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
3911                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
3912   },
3913
3914   {
3915     'key'         => 'batch-fixed_format-CHEK',
3916     'section'     => 'billing',
3917     'description' => 'Fixed (unchangeable) format for electronic check batches.',
3918     'type'        => 'select',
3919     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch', 'BoM',
3920                        'PAP', 'paymentech', 'ach-spiritone', 'RBC',
3921                        'td_eft1464', 'eft_canada', 'CIBC'
3922                      ]
3923   },
3924
3925   {
3926     'key'         => 'batch-increment_expiration',
3927     'section'     => 'billing',
3928     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
3929     'type'        => 'checkbox'
3930   },
3931
3932   {
3933     'key'         => 'batchconfig-BoM',
3934     'section'     => 'billing',
3935     'description' => 'Configuration for Bank of Montreal batching, seven lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Long name, 6. Bank, 7. Bank account',
3936     'type'        => 'textarea',
3937   },
3938
3939 {
3940     'key'         => 'batchconfig-CIBC',
3941     'section'     => 'billing',
3942     'description' => 'Configuration for Canadian Imperial Bank of Commerce, six lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Bank, 6. Bank account',
3943     'type'        => 'textarea',
3944   },
3945
3946   {
3947     'key'         => 'batchconfig-PAP',
3948     'section'     => 'billing',
3949     'description' => 'Configuration for PAP batching, seven lines: 1. Origin ID, 2. Datacenter, 3. Typecode, 4. Short name, 5. Long name, 6. Bank, 7. Bank account',
3950     'type'        => 'textarea',
3951   },
3952
3953   {
3954     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
3955     'section'     => 'billing',
3956     'description' => 'Gateway ID for Chase Canada E-xact batching',
3957     'type'        => 'text',
3958   },
3959
3960   {
3961     'key'         => 'batchconfig-paymentech',
3962     'section'     => 'billing',
3963     'description' => 'Configuration for Chase Paymentech batching, six lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads), 6. Flag to send recurring indicator.',
3964     'type'        => 'textarea',
3965   },
3966
3967   {
3968     'key'         => 'batchconfig-RBC',
3969     'section'     => 'billing',
3970     'description' => 'Configuration for Royal Bank of Canada PDS batching, five lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code 5. (optional) set to TEST to turn on test mode.',
3971     'type'        => 'textarea',
3972   },
3973
3974   {
3975     'key'         => 'batchconfig-td_eft1464',
3976     'section'     => 'billing',
3977     'description' => 'Configuration for TD Bank EFT1464 batching, seven lines: 1. Originator ID, 2. Datacenter Code, 3. Short name, 4. Long name, 5. Returned payment branch number, 6. Returned payment account, 7. Transaction code.',
3978     'type'        => 'textarea',
3979   },
3980
3981   {
3982     'key'         => 'batchconfig-eft_canada',
3983     'section'     => 'billing',
3984     'description' => 'Configuration for EFT Canada batching, five lines: 1. SFTP username, 2. SFTP password, 3. Business transaction code, 4. Personal transaction code, 5. Number of days to delay process date.  If you are using separate per-agent batches (batch-spoolagent), you must set this option separately for each agent, as the global setting will be ignored.',
3985     'type'        => 'textarea',
3986     'per_agent'   => 1,
3987   },
3988
3989   {
3990     'key'         => 'batchconfig-nacha-destination',
3991     'section'     => 'billing',
3992     'description' => 'Configuration for NACHA batching, Destination (9 digit transit routing number).',
3993     'type'        => 'text',
3994   },
3995
3996   {
3997     'key'         => 'batchconfig-nacha-destination_name',
3998     'section'     => 'billing',
3999     'description' => 'Configuration for NACHA batching, Destination (Bank Name, up to 23 characters).',
4000     'type'        => 'text',
4001   },
4002
4003   {
4004     'key'         => 'batchconfig-nacha-origin',
4005     'section'     => 'billing',
4006     'description' => 'Configuration for NACHA batching, Origin (your 10-digit company number, IRS tax ID recommended).',
4007     'type'        => 'text',
4008   },
4009
4010   {
4011     'key'         => 'batch-manual_approval',
4012     'section'     => 'billing',
4013     'description' => 'Allow manual batch closure, which will approve all payments that do not yet have a status.  This is not advised unless needed for specific payment processors that provide a report of rejected rather than approved payments.',
4014     'type'        => 'checkbox',
4015   },
4016
4017   {
4018     'key'         => 'batch-spoolagent',
4019     'section'     => 'billing',
4020     'description' => 'Store payment batches per-agent.',
4021     'type'        => 'checkbox',
4022   },
4023
4024   {
4025     'key'         => 'payment_history-years',
4026     'section'     => 'UI',
4027     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
4028     'type'        => 'text',
4029   },
4030
4031   {
4032     'key'         => 'change_history-years',
4033     'section'     => 'UI',
4034     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
4035     'type'        => 'text',
4036   },
4037
4038   {
4039     'key'         => 'cust_main-packages-years',
4040     'section'     => 'UI',
4041     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
4042     'type'        => 'text',
4043   },
4044
4045   {
4046     'key'         => 'cust_main-use_comments',
4047     'section'     => 'UI',
4048     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
4049     'type'        => 'checkbox',
4050   },
4051
4052   {
4053     'key'         => 'cust_main-disable_notes',
4054     'section'     => 'UI',
4055     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
4056     'type'        => 'checkbox',
4057   },
4058
4059   {
4060     'key'         => 'cust_main_note-display_times',
4061     'section'     => 'UI',
4062     'description' => 'Display full timestamps (not just dates) for customer notes.',
4063     'type'        => 'checkbox',
4064   },
4065
4066   {
4067     'key'         => 'cust_main-ticket_statuses',
4068     'section'     => 'UI',
4069     'description' => 'Show tickets with these statuses on the customer view page.',
4070     'type'        => 'selectmultiple',
4071     'select_enum' => [qw( new open stalled resolved rejected deleted )],
4072   },
4073
4074   {
4075     'key'         => 'cust_main-max_tickets',
4076     'section'     => 'UI',
4077     'description' => 'Maximum number of tickets to show on the customer view page.',
4078     'type'        => 'text',
4079   },
4080
4081   {
4082     'key'         => 'cust_main-enable_birthdate',
4083     'section'     => 'UI',
4084     'description' => 'Enable tracking of a birth date with each customer record',
4085     'type'        => 'checkbox',
4086   },
4087
4088   {
4089     'key'         => 'cust_main-enable_spouse',
4090     'section'     => 'UI',
4091     'description' => 'Enable tracking of a spouse\'s name and date of birth with each customer record',
4092     'type'        => 'checkbox',
4093   },
4094
4095   {
4096     'key'         => 'cust_main-enable_anniversary_date',
4097     'section'     => 'UI',
4098     'description' => 'Enable tracking of an anniversary date with each customer record',
4099     'type'        => 'checkbox',
4100   },
4101
4102   {
4103     'key'         => 'cust_main-enable_order_package',
4104     'section'     => 'UI',
4105     'description' => 'Display order new package on the basic tab',
4106     'type'        => 'checkbox',
4107   },
4108
4109   {
4110     'key'         => 'cust_main-edit_calling_list_exempt',
4111     'section'     => 'UI',
4112     'description' => 'Display the "calling_list_exempt" checkbox on customer edit.',
4113     'type'        => 'checkbox',
4114   },
4115
4116   {
4117     'key'         => 'support-key',
4118     'section'     => '',
4119     'description' => 'A support key enables access to commercial services delivered over the network, such as the payroll module, access to the internal ticket system, priority support and optional backups.',
4120     'type'        => 'text',
4121   },
4122
4123   {
4124     'key'         => 'card-types',
4125     'section'     => 'billing',
4126     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
4127     'type'        => 'selectmultiple',
4128     'select_enum' => \@card_types,
4129   },
4130
4131   {
4132     'key'         => 'disable-fuzzy',
4133     'section'     => 'UI',
4134     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
4135     'type'        => 'checkbox',
4136   },
4137
4138   {
4139     'key'         => 'fuzzy-fuzziness',
4140     'section'     => 'UI',
4141     'description' => 'Set the "fuzziness" of fuzzy searching (see the String::Approx manpage for details).  Defaults to 10%',
4142     'type'        => 'text',
4143   },
4144
4145   {
4146     'key'         => 'enable_fuzzy_on_exact',
4147     'section'     => 'UI',
4148     'description' => 'Enable approximate customer searching even when an exact match is found.',
4149     'type'        => 'checkbox',
4150   },
4151
4152   { 'key'         => 'pkg_referral',
4153     'section'     => '',
4154     'description' => 'Enable package-specific advertising sources.',
4155     'type'        => 'checkbox',
4156   },
4157
4158   { 'key'         => 'pkg_referral-multiple',
4159     'section'     => '',
4160     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
4161     'type'        => 'checkbox',
4162   },
4163
4164   {
4165     'key'         => 'dashboard-install_welcome',
4166     'section'     => 'UI',
4167     'description' => 'New install welcome screen.',
4168     'type'        => 'select',
4169     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
4170   },
4171
4172   {
4173     'key'         => 'dashboard-toplist',
4174     'section'     => 'UI',
4175     'description' => 'List of items to display on the top of the front page',
4176     'type'        => 'textarea',
4177   },
4178
4179   {
4180     'key'         => 'impending_recur_msgnum',
4181     'section'     => 'notification',
4182     'description' => 'Template to use for alerts about first-time recurring billing.',
4183     %msg_template_options,
4184   },
4185
4186   {
4187     'key'         => 'impending_recur_template',
4188     'section'     => 'deprecated',
4189     'description' => 'Template file for alerts about looming first time recurrant billing.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitition language.  Also see packages with a <a href="../browse/part_pkg.cgi">flat price plan</a>  The following variables are available<ul><li><code>$packages</code> allowing <code>$packages->[0]</code> thru <code>$packages->[n]</code> <li><code>$package</code> the first package, same as <code>$packages->[0]</code> <li><code>$recurdates</code> allowing <code>$recurdates->[0]</code> thru <code>$recurdates->[n]</code> <li><code>$recurdate</code> the first recurdate, same as <code>$recurdate->[0]</code> <li><code>$first</code> <li><code>$last</code></ul>',
4190 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
4191     'type'        => 'textarea',
4192   },
4193
4194   {
4195     'key'         => 'logo.png',
4196     'section'     => 'UI',  #'invoicing' ?
4197     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
4198     'type'        => 'image',
4199     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
4200                         #old-style editor anyway...?
4201     'per_locale'  => 1,
4202   },
4203
4204   {
4205     'key'         => 'logo.eps',
4206     'section'     => 'invoicing',
4207     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
4208     'type'        => 'image',
4209     'per_agent'   => 1, #XXX as above, kinda
4210     'per_locale'  => 1,
4211   },
4212
4213   {
4214     'key'         => 'selfservice-ignore_quantity',
4215     'section'     => 'self-service',
4216     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
4217     'type'        => 'checkbox',
4218   },
4219
4220   {
4221     'key'         => 'selfservice-session_timeout',
4222     'section'     => 'self-service',
4223     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
4224     'type'        => 'select',
4225     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
4226   },
4227
4228   {
4229     'key'         => 'password-generated-allcaps',
4230     'section'     => 'password',
4231     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
4232     'type'        => 'checkbox',
4233   },
4234
4235   {
4236     'key'         => 'datavolume-forcemegabytes',
4237     'section'     => 'UI',
4238     'description' => 'All data volumes are expressed in megabytes',
4239     'type'        => 'checkbox',
4240   },
4241
4242   {
4243     'key'         => 'datavolume-significantdigits',
4244     'section'     => 'UI',
4245     'description' => 'number of significant digits to use to represent data volumes',
4246     'type'        => 'text',
4247   },
4248
4249   {
4250     'key'         => 'disable_void_after',
4251     'section'     => 'billing',
4252     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
4253     'type'        => 'text',
4254   },
4255
4256   {
4257     'key'         => 'disable_line_item_date_ranges',
4258     'section'     => 'billing',
4259     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
4260     'type'        => 'checkbox',
4261   },
4262
4263   {
4264     'key'         => 'cust_bill-line_item-date_style',
4265     'section'     => 'billing',
4266     'description' => 'Display format for line item date ranges on invoice line items.',
4267     'type'        => 'select',
4268     'select_hash' => [ ''           => 'STARTDATE-ENDDATE',
4269                        'month_of'   => 'Month of MONTHNAME',
4270                        'X_month'    => 'DATE_DESC MONTHNAME',
4271                      ],
4272     'per_agent'   => 1,
4273   },
4274
4275   {
4276     'key'         => 'cust_bill-line_item-date_style-non_monthly',
4277     'section'     => 'billing',
4278     'description' => 'If set, override cust_bill-line_item-date_style for non-monthly charges.',
4279     'type'        => 'select',
4280     'select_hash' => [ ''           => 'Default',
4281                        'start_end'  => 'STARTDATE-ENDDATE',
4282                        'month_of'   => 'Month of MONTHNAME',
4283                        'X_month'    => 'DATE_DESC MONTHNAME',
4284                      ],
4285     'per_agent'   => 1,
4286   },
4287
4288   {
4289     'key'         => 'cust_bill-line_item-date_description',
4290     'section'     => 'billing',
4291     'description' => 'Text to display for "DATE_DESC" when using cust_bill-line_item-date_style DATE_DESC MONTHNAME.',
4292     'type'        => 'text',
4293     'per_agent'   => 1,
4294   },
4295
4296   {
4297     'key'         => 'support_packages',
4298     'section'     => '',
4299     'description' => 'A list of packages eligible for RT ticket time transfer, one pkgpart per line.', #this should really be a select multiple, or specified in the packages themselves...
4300     'type'        => 'select-part_pkg',
4301     'multiple'    => 1,
4302   },
4303
4304   {
4305     'key'         => 'cust_main-require_phone',
4306     'section'     => '',
4307     'description' => 'Require daytime or night phone for all customer records.',
4308     'type'        => 'checkbox',
4309     'per_agent'   => 1,
4310   },
4311
4312   {
4313     'key'         => 'cust_main-require_invoicing_list_email',
4314     'section'     => '',
4315     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
4316     'type'        => 'checkbox',
4317     'per_agent'   => 1,
4318   },
4319
4320   {
4321     'key'         => 'cust_main-check_unique',
4322     'section'     => '',
4323     'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
4324     'type'        => 'select',
4325     'multiple'    => 1,
4326     'select_hash' => [ 
4327       'address' => 'Billing or service address',
4328     ],
4329   },
4330
4331   {
4332     'key'         => 'svc_acct-display_paid_time_remaining',
4333     'section'     => '',
4334     'description' => 'Show paid time remaining in addition to time remaining.',
4335     'type'        => 'checkbox',
4336   },
4337
4338   {
4339     'key'         => 'cancel_credit_type',
4340     'section'     => 'billing',
4341     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
4342     reason_type_options('R'),
4343   },
4344
4345   {
4346     'key'         => 'suspend_credit_type',
4347     'section'     => 'billing',
4348     'description' => 'The group to use for new, automatically generated credit reasons resulting from package suspension.',
4349     reason_type_options('R'),
4350   },
4351
4352   {
4353     'key'         => 'referral_credit_type',
4354     'section'     => 'deprecated',
4355     'description' => 'Used to be the group to use for new, automatically generated credit reasons resulting from referrals.  Now set in a package billing event for the referral.',
4356     reason_type_options('R'),
4357   },
4358
4359   {
4360     'key'         => 'signup_credit_type',
4361     'section'     => 'billing', #self-service?
4362     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
4363     reason_type_options('R'),
4364   },
4365
4366   {
4367     'key'         => 'prepayment_discounts-credit_type',
4368     'section'     => 'billing',
4369     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
4370     reason_type_options('R'),
4371   },
4372
4373   {
4374     'key'         => 'cust_main-agent_custid-format',
4375     'section'     => '',
4376     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
4377     'type'        => 'select',
4378     'select_hash' => [
4379                        ''       => 'Numeric only',
4380                        '\d{7}'  => 'Numeric only, exactly 7 digits',
4381                        'ww?d+'  => 'Numeric with one or two letter prefix',
4382                      ],
4383   },
4384
4385   {
4386     'key'         => 'card_masking_method',
4387     'section'     => 'UI',
4388     'description' => 'Digits to display when masking credit cards.  Note that the first six digits are necessary to canonically identify the credit card type (Visa/MC, Amex, Discover, Maestro, etc.) in all cases.  The first four digits can identify the most common credit card types in most cases (Visa/MC, Amex, and Discover).  The first two digits can distinguish between Visa/MC and Amex.  Note: You should manually remove stored paymasks if you change this value on an existing database, to avoid problems using stored cards.',
4389     'type'        => 'select',
4390     'select_hash' => [
4391                        ''            => '123456xxxxxx1234',
4392                        'first6last2' => '123456xxxxxxxx12',
4393                        'first4last4' => '1234xxxxxxxx1234',
4394                        'first4last2' => '1234xxxxxxxxxx12',
4395                        'first2last4' => '12xxxxxxxxxx1234',
4396                        'first2last2' => '12xxxxxxxxxxxx12',
4397                        'first0last4' => 'xxxxxxxxxxxx1234',
4398                        'first0last2' => 'xxxxxxxxxxxxxx12',
4399                      ],
4400   },
4401
4402   {
4403     'key'         => 'disable_previous_balance',
4404     'section'     => 'invoicing',
4405     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices.',
4406     'type'        => 'checkbox',
4407     'per_agent'   => 1,
4408   },
4409
4410   {
4411     'key'         => 'previous_balance-exclude_from_total',
4412     'section'     => 'invoicing',
4413     'description' => 'Do not include previous balance in the \'Total\' line.  Only meaningful when invoice_sections is false.  Optionally provide text to override the Total New Charges description',
4414     'type'        => [ qw(checkbox text) ],
4415   },
4416
4417   {
4418     'key'         => 'previous_balance-section',
4419     'section'     => 'invoicing',
4420     'description' => 'Show previous invoice balances in a separate invoice section.  Does not require invoice_sections to be enabled.',
4421     'type'        => 'checkbox',
4422   },
4423
4424   {
4425     'key'         => 'previous_balance-summary_only',
4426     'section'     => 'invoicing',
4427     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
4428     'type'        => 'checkbox',
4429   },
4430
4431   {
4432     'key'         => 'previous_balance-show_credit',
4433     'section'     => 'invoicing',
4434     'description' => 'Show the customer\'s credit balance on invoices when applicable.',
4435     'type'        => 'checkbox',
4436   },
4437
4438   {
4439     'key'         => 'previous_balance-show_on_statements',
4440     'section'     => 'invoicing',
4441     'description' => 'Show previous invoices on statements, without itemized charges.',
4442     'type'        => 'checkbox',
4443   },
4444
4445   {
4446     'key'         => 'previous_balance-payments_since',
4447     'section'     => 'invoicing',
4448     'description' => 'Instead of showing payments (and credits) applied to the invoice, show those received since the previous invoice date.',
4449     'type'        => 'checkbox',
4450                        'uscensus' => 'U.S. Census Bureau',
4451   },
4452
4453   {
4454     'key'         => 'previous_invoice_history',
4455     'section'     => 'invoicing',
4456     'description' => 'Show a month-by-month history of the customer\'s '.
4457                      'billing amounts.  This requires template '.
4458                      'modification and is currently not supported on the '.
4459                      'stock template.',
4460     'type'        => 'checkbox',
4461   },
4462
4463   {
4464     'key'         => 'balance_due_below_line',
4465     'section'     => 'invoicing',
4466     'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
4467     'type'        => 'checkbox',
4468   },
4469
4470   {
4471     'key'         => 'always_show_tax',
4472     'section'     => 'invoicing',
4473     'description' => 'Show a line for tax on the invoice even when the tax is zero.  Optionally provide text for the tax name to show.',
4474     'type'        => [ qw(checkbox text) ],
4475   },
4476
4477   {
4478     'key'         => 'address_standardize_method',
4479     'section'     => 'UI', #???
4480     'description' => 'Method for standardizing customer addresses.',
4481     'type'        => 'select',
4482     'select_hash' => [ '' => '', 
4483                        'usps'     => 'U.S. Postal Service',
4484                        'tomtom'   => 'TomTom',
4485                        'melissa'  => 'Melissa WebSmart',
4486                      ],
4487   },
4488
4489   {
4490     'key'         => 'usps_webtools-userid',
4491     'section'     => 'UI',
4492     'description' => 'Production UserID for USPS web tools.   Enables USPS address standardization.  See the <a href="http://www.usps.com/webtools/">USPS website</a>, register and agree not to use the tools for batch purposes.',
4493     'type'        => 'text',
4494   },
4495
4496   {
4497     'key'         => 'usps_webtools-password',
4498     'section'     => 'UI',
4499     'description' => 'Production password for USPS web tools.   Enables USPS address standardization.  See <a href="http://www.usps.com/webtools/">USPS website</a>, register and agree not to use the tools for batch purposes.',
4500     'type'        => 'text',
4501   },
4502
4503   {
4504     'key'         => 'tomtom-userid',
4505     'section'     => 'UI',
4506     'description' => 'TomTom geocoding service API key.  See <a href="http://geocoder.tomtom.com/">the TomTom website</a> to obtain a key.  This is recommended for addresses in the United States only.',
4507     'type'        => 'text',
4508   },
4509
4510   {
4511     'key'         => 'melissa-userid',
4512     'section'     => 'UI', # it's really not...
4513     'description' => 'User ID for Melissa WebSmart service.  See <a href="http://www.melissadata.com/">the Melissa website</a> for access and pricing.',
4514     'type'        => 'text',
4515   },
4516
4517   {
4518     'key'         => 'melissa-enable_geocoding',
4519     'section'     => 'UI',
4520     'description' => 'Use the Melissa service for census tract and coordinate lookups.  Enable this only if your subscription includes geocoding access.',
4521     'type'        => 'checkbox',
4522   },
4523
4524   {
4525     'key'         => 'cust_main-auto_standardize_address',
4526     'section'     => 'UI',
4527     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
4528     'type'        => 'checkbox',
4529   },
4530
4531   {
4532     'key'         => 'cust_main-require_censustract',
4533     'section'     => 'UI',
4534     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
4535     'type'        => 'checkbox',
4536   },
4537
4538   {
4539     'key'         => 'census_year',
4540     'section'     => 'UI',
4541     'description' => 'The year to use in census tract lookups.  NOTE: you need to select 2012 or 2013 for Year 2010 Census tract codes.  A selection of 2011 provides Year 2000 Census tract codes.  Use the freeside-censustract-update tool if exisitng customers need to be changed.',
4542     'type'        => 'select',
4543     'select_enum' => [ qw( 2013 2012 2011 ) ],
4544   },
4545
4546   {
4547     'key'         => 'tax_district_method',
4548     'section'     => 'UI',
4549     'description' => 'The method to use to look up tax district codes.',
4550     'type'        => 'select',
4551     #'select_hash' => [ FS::Misc::Geo::get_district_methods() ],
4552     #after RT#13763, using FS::Misc::Geo here now causes a dependancy loop :/
4553     'select_hash' => [
4554                        ''         => '',
4555                        'wa_sales' => 'Washington sales tax',
4556                      ],
4557   },
4558
4559   {
4560     'key'         => 'company_latitude',
4561     'section'     => 'UI',
4562     'description' => 'Your company latitude (-90 through 90)',
4563     'type'        => 'text',
4564   },
4565
4566   {
4567     'key'         => 'company_longitude',
4568     'section'     => 'UI',
4569     'description' => 'Your company longitude (-180 thru 180)',
4570     'type'        => 'text',
4571   },
4572
4573   {
4574     'key'         => 'geocode_module',
4575     'section'     => '',
4576     'description' => 'Module to geocode (retrieve a latitude and longitude for) addresses',
4577     'type'        => 'select',
4578     'select_enum' => [ 'Geo::Coder::Googlev3' ],
4579   },
4580
4581   {
4582     'key'         => 'geocode-require_nw_coordinates',
4583     'section'     => 'UI',
4584     'description' => 'Require latitude and longitude in the North Western quadrant, e.g. for North American co-ordinates, etc.',
4585     'type'        => 'checkbox',
4586   },
4587
4588   {
4589     'key'         => 'disable_acl_changes',
4590     'section'     => '',
4591     'description' => 'Disable all ACL changes, for demos.',
4592     'type'        => 'checkbox',
4593   },
4594
4595   {
4596     'key'         => 'disable_settings_changes',
4597     'section'     => '',
4598     'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
4599     'type'        => [qw( checkbox text )],
4600   },
4601
4602   {
4603     'key'         => 'cust_main-edit_agent_custid',
4604     'section'     => 'UI',
4605     'description' => 'Enable editing of the agent_custid field.',
4606     'type'        => 'checkbox',
4607   },
4608
4609   {
4610     'key'         => 'cust_main-default_agent_custid',
4611     'section'     => 'UI',
4612     'description' => 'Display the agent_custid field when available instead of the custnum field.',
4613     'type'        => 'checkbox',
4614   },
4615
4616   {
4617     'key'         => 'cust_main-title-display_custnum',
4618     'section'     => 'UI',
4619     'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
4620     'type'        => 'checkbox',
4621   },
4622
4623   {
4624     'key'         => 'cust_bill-default_agent_invid',
4625     'section'     => 'UI',
4626     'description' => 'Display the agent_invid field when available instead of the invnum field.',
4627     'type'        => 'checkbox',
4628   },
4629
4630   {
4631     'key'         => 'cust_main-auto_agent_custid',
4632     'section'     => 'UI',
4633     'description' => 'Automatically assign an agent_custid - select format',
4634     'type'        => 'select',
4635     'select_hash' => [ '' => 'No',
4636                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
4637                      ],
4638   },
4639
4640   {
4641     'key'         => 'cust_main-custnum-display_prefix',
4642     'section'     => 'UI',
4643     'description' => 'Prefix the customer number with this string for display purposes.',
4644     'type'        => 'text',
4645     'per_agent'   => 1,
4646   },
4647
4648   {
4649     'key'         => 'cust_main-custnum-display_special',
4650     'section'     => 'UI',
4651     'description' => 'Use this customer number prefix format',
4652     'type'        => 'select',
4653     'select_hash' => [ '' => '',
4654                        'CoStAg' => 'CoStAg (country, state, agent name or display_prefix)',
4655                        'CoStCl' => 'CoStCl (country, state, class name)' ],
4656   },
4657
4658   {
4659     'key'         => 'cust_main-custnum-display_length',
4660     'section'     => 'UI',
4661     'description' => 'Zero fill the customer number to this many digits for display purposes.',
4662     'type'        => 'text',
4663   },
4664
4665   {
4666     'key'         => 'cust_main-default_areacode',
4667     'section'     => 'UI',
4668     'description' => 'Default area code for customers.',
4669     'type'        => 'text',
4670   },
4671
4672   {
4673     'key'         => 'order_pkg-no_start_date',
4674     'section'     => 'UI',
4675     'description' => 'Don\'t set a default start date for new packages.',
4676     'type'        => 'checkbox',
4677   },
4678
4679   {
4680     'key'         => 'part_pkg-delay_start',
4681     'section'     => '',
4682     'description' => 'Enabled "delayed start" option for packages.',
4683     'type'        => 'checkbox',
4684   },
4685
4686   {
4687     'key'         => 'part_pkg-delay_cancel-days',
4688     'section'     => '',
4689     'description' => 'Expire packages in this many days when using delay_cancel (default is 1)',
4690     'type'        => 'text',
4691     'validate'    => sub { (($_[0] =~ /^\d*$/) && (($_[0] eq '') || $_[0]))
4692                            ? 'Must specify an integer number of days'
4693                            : '' }
4694   },
4695
4696   {
4697     'key'         => 'mcp_svcpart',
4698     'section'     => '',
4699     'description' => 'Master Control Program svcpart.  Leave this blank.',
4700     'type'        => 'text', #select-part_svc
4701   },
4702
4703   {
4704     'key'         => 'cust_bill-max_same_services',
4705     'section'     => 'invoicing',
4706     'description' => 'Maximum number of the same service to list individually on invoices before condensing to a single line listing the number of services.  Defaults to 5.',
4707     'type'        => 'text',
4708   },
4709
4710   {
4711     'key'         => 'cust_bill-consolidate_services',
4712     'section'     => 'invoicing',
4713     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
4714     'type'        => 'checkbox',
4715   },
4716
4717   {
4718     'key'         => 'suspend_email_admin',
4719     'section'     => '',
4720     'description' => 'Destination admin email address to enable suspension notices',
4721     'type'        => 'text',
4722   },
4723
4724   {
4725     'key'         => 'unsuspend_email_admin',
4726     'section'     => '',
4727     'description' => 'Destination admin email address to enable unsuspension notices',
4728     'type'        => 'text',
4729   },
4730   
4731   {
4732     'key'         => 'email_report-subject',
4733     'section'     => '',
4734     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
4735     'type'        => 'text',
4736   },
4737
4738   {
4739     'key'         => 'selfservice-head',
4740     'section'     => 'self-service',
4741     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
4742     'type'        => 'textarea', #htmlarea?
4743     'per_agent'   => 1,
4744   },
4745
4746
4747   {
4748     'key'         => 'selfservice-body_header',
4749     'section'     => 'self-service',
4750     'description' => 'HTML header for the self-service interface',
4751     'type'        => 'textarea', #htmlarea?
4752     'per_agent'   => 1,
4753   },
4754
4755   {
4756     'key'         => 'selfservice-body_footer',
4757     'section'     => 'self-service',
4758     'description' => 'HTML footer for the self-service interface',
4759     'type'        => 'textarea', #htmlarea?
4760     'per_agent'   => 1,
4761   },
4762
4763
4764   {
4765     'key'         => 'selfservice-body_bgcolor',
4766     'section'     => 'self-service',
4767     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
4768     'type'        => 'text',
4769     'per_agent'   => 1,
4770   },
4771
4772   {
4773     'key'         => 'selfservice-box_bgcolor',
4774     'section'     => 'self-service',
4775     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
4776     'type'        => 'text',
4777     'per_agent'   => 1,
4778   },
4779
4780   {
4781     'key'         => 'selfservice-stripe1_bgcolor',
4782     'section'     => 'self-service',
4783     'description' => 'HTML color for self-service interface lists (primary stripe), for example, #FFFFFF',
4784     'type'        => 'text',
4785     'per_agent'   => 1,
4786   },
4787
4788   {
4789     'key'         => 'selfservice-stripe2_bgcolor',
4790     'section'     => 'self-service',
4791     'description' => 'HTML color for self-service interface lists (alternate stripe), for example, #DDDDDD',
4792     'type'        => 'text',
4793     'per_agent'   => 1,
4794   },
4795
4796   {
4797     'key'         => 'selfservice-text_color',
4798     'section'     => 'self-service',
4799     'description' => 'HTML text color for the self-service interface, for example, #000000',
4800     'type'        => 'text',
4801     'per_agent'   => 1,
4802   },
4803
4804   {
4805     'key'         => 'selfservice-link_color',
4806     'section'     => 'self-service',
4807     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
4808     'type'        => 'text',
4809     'per_agent'   => 1,
4810   },
4811
4812   {
4813     'key'         => 'selfservice-vlink_color',
4814     'section'     => 'self-service',
4815     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
4816     'type'        => 'text',
4817     'per_agent'   => 1,
4818   },
4819
4820   {
4821     'key'         => 'selfservice-hlink_color',
4822     'section'     => 'self-service',
4823     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
4824     'type'        => 'text',
4825     'per_agent'   => 1,
4826   },
4827
4828   {
4829     'key'         => 'selfservice-alink_color',
4830     'section'     => 'self-service',
4831     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
4832     'type'        => 'text',
4833     'per_agent'   => 1,
4834   },
4835
4836   {
4837     'key'         => 'selfservice-font',
4838     'section'     => 'self-service',
4839     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
4840     'type'        => 'text',
4841     'per_agent'   => 1,
4842   },
4843
4844   {
4845     'key'         => 'selfservice-no_logo',
4846     'section'     => 'self-service',
4847     'description' => 'Disable the logo in self-service',
4848     'type'        => 'checkbox',
4849     'per_agent'   => 1,
4850   },
4851
4852   {
4853     'key'         => 'selfservice-title_color',
4854     'section'     => 'self-service',
4855     'description' => 'HTML color for the self-service title, for example, #000000',
4856     'type'        => 'text',
4857     'per_agent'   => 1,
4858   },
4859
4860   {
4861     'key'         => 'selfservice-title_align',
4862     'section'     => 'self-service',
4863     'description' => 'HTML alignment for the self-service title, for example, center',
4864     'type'        => 'text',
4865     'per_agent'   => 1,
4866   },
4867   {
4868     'key'         => 'selfservice-title_size',
4869     'section'     => 'self-service',
4870     'description' => 'HTML font size for the self-service title, for example, 3',
4871     'type'        => 'text',
4872     'per_agent'   => 1,
4873   },
4874
4875   {
4876     'key'         => 'selfservice-title_left_image',
4877     'section'     => 'self-service',
4878     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4879     'type'        => 'image',
4880     'per_agent'   => 1,
4881   },
4882
4883   {
4884     'key'         => 'selfservice-title_right_image',
4885     'section'     => 'self-service',
4886     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4887     'type'        => 'image',
4888     'per_agent'   => 1,
4889   },
4890
4891   {
4892     'key'         => 'selfservice-menu_disable',
4893     'section'     => 'self-service',
4894     'description' => 'Disable the selected menu entries in the self-service menu',
4895     'type'        => 'selectmultiple',
4896     'select_enum' => [ #false laziness w/myaccount_menu.html
4897                        'Overview',
4898                        'Purchase',
4899                        'Purchase additional package',
4900                        'Recharge my account with a credit card',
4901                        'Recharge my account with a check',
4902                        'Recharge my account with a prepaid card',
4903                        'View my usage',
4904                        'Create a ticket',
4905                        'Setup my services',
4906                        'Change my information',
4907                        'Change billing address',
4908                        'Change service address',
4909                        'Change payment information',
4910                        'Change password(s)',
4911                        'Logout',
4912                      ],
4913     'per_agent'   => 1,
4914   },
4915
4916   {
4917     'key'         => 'selfservice-menu_skipblanks',
4918     'section'     => 'self-service',
4919     'description' => 'Skip blank (spacer) entries in the self-service menu',
4920     'type'        => 'checkbox',
4921     'per_agent'   => 1,
4922   },
4923
4924   {
4925     'key'         => 'selfservice-menu_skipheadings',
4926     'section'     => 'self-service',
4927     'description' => 'Skip the unclickable heading entries in the self-service menu',
4928     'type'        => 'checkbox',
4929     'per_agent'   => 1,
4930   },
4931
4932   {
4933     'key'         => 'selfservice-menu_bgcolor',
4934     'section'     => 'self-service',
4935     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
4936     'type'        => 'text',
4937     'per_agent'   => 1,
4938   },
4939
4940   {
4941     'key'         => 'selfservice-menu_fontsize',
4942     'section'     => 'self-service',
4943     'description' => 'HTML font size for the self-service menu, for example, -1',
4944     'type'        => 'text',
4945     'per_agent'   => 1,
4946   },
4947   {
4948     'key'         => 'selfservice-menu_nounderline',
4949     'section'     => 'self-service',
4950     'description' => 'Styles menu links in the self-service without underlining.',
4951     'type'        => 'checkbox',
4952     'per_agent'   => 1,
4953   },
4954
4955
4956   {
4957     'key'         => 'selfservice-menu_top_image',
4958     'section'     => 'self-service',
4959     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4960     'type'        => 'image',
4961     'per_agent'   => 1,
4962   },
4963
4964   {
4965     'key'         => 'selfservice-menu_body_image',
4966     'section'     => 'self-service',
4967     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
4968     'type'        => 'image',
4969     'per_agent'   => 1,
4970   },
4971
4972   {
4973     'key'         => 'selfservice-menu_bottom_image',
4974     'section'     => 'self-service',
4975     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
4976     'type'        => 'image',
4977     'per_agent'   => 1,
4978   },
4979   
4980   {
4981     'key'         => 'selfservice-view_usage_nodomain',
4982     'section'     => 'self-service',
4983     'description' => 'Show usernames without their domains in "View my usage" in the self-service interface.',
4984     'type'        => 'checkbox',
4985   },
4986
4987   {
4988     'key'         => 'selfservice-login_banner_image',
4989     'section'     => 'self-service',
4990     'description' => 'Banner image shown on the login page, in PNG format.',
4991     'type'        => 'image',
4992   },
4993
4994   {
4995     'key'         => 'selfservice-login_banner_url',
4996     'section'     => 'self-service',
4997     'description' => 'Link for the login banner.',
4998     'type'        => 'text',
4999   },
5000
5001   {
5002     'key'         => 'ng_selfservice-menu',
5003     'section'     => 'self-service',
5004     'description' => 'Custom menu for the next-generation self-service interface.  Each line is in the format "link Label", for example "main.php Home".  Sub-menu items are listed on subsequent lines.  Blank lines terminate the submenu.', #more docs/examples would be helpful
5005     'type'        => 'textarea',
5006   },
5007
5008   {
5009     'key'         => 'signup-no_company',
5010     'section'     => 'self-service',
5011     'description' => "Don't display a field for company name on signup.",
5012     'type'        => 'checkbox',
5013   },
5014
5015   {
5016     'key'         => 'signup-recommend_email',
5017     'section'     => 'self-service',
5018     'description' => 'Encourage the entry of an invoicing email address on signup.',
5019     'type'        => 'checkbox',
5020   },
5021
5022   {
5023     'key'         => 'signup-recommend_daytime',
5024     'section'     => 'self-service',
5025     'description' => 'Encourage the entry of a daytime phone number on signup.',
5026     'type'        => 'checkbox',
5027   },
5028
5029   {
5030     'key'         => 'signup-duplicate_cc-warn_hours',
5031     'section'     => 'self-service',
5032     'description' => 'Issue a warning if the same credit card is used for multiple signups within this many hours.',
5033     'type'        => 'text',
5034   },
5035
5036   {
5037     'key'         => 'svc_phone-radius-password',
5038     'section'     => 'telephony',
5039     'description' => 'Password when exporting svc_phone records to RADIUS',
5040     'type'        => 'select',
5041     'select_hash' => [
5042       '' => 'Use default from svc_phone-radius-default_password config',
5043       'countrycode_phonenum' => 'Phone number (with country code)',
5044     ],
5045   },
5046
5047   {
5048     'key'         => 'svc_phone-radius-default_password',
5049     'section'     => 'telephony',
5050     'description' => 'Default password when exporting svc_phone records to RADIUS',
5051     'type'        => 'text',
5052   },
5053
5054   {
5055     'key'         => 'svc_phone-allow_alpha_phonenum',
5056     'section'     => 'telephony',
5057     'description' => 'Allow letters in phone numbers.',
5058     'type'        => 'checkbox',
5059   },
5060
5061   {
5062     'key'         => 'svc_phone-domain',
5063     'section'     => 'telephony',
5064     'description' => 'Track an optional domain association with each phone service.',
5065     'type'        => 'checkbox',
5066   },
5067
5068   {
5069     'key'         => 'svc_phone-phone_name-max_length',
5070     'section'     => 'telephony',
5071     'description' => 'Maximum length of the phone service "Name" field (svc_phone.phone_name).  Sometimes useful to limit this (to 15?) when exporting as Caller ID data.',
5072     'type'        => 'text',
5073   },
5074
5075   {
5076     'key'         => 'svc_phone-random_pin',
5077     'section'     => 'telephony',
5078     'description' => 'Number of random digits to generate in the "PIN" field, if empty.',
5079     'type'        => 'text',
5080   },
5081
5082   {
5083     'key'         => 'svc_phone-lnp',
5084     'section'     => 'telephony',
5085     'description' => 'Enables Number Portability features for svc_phone',
5086     'type'        => 'checkbox',
5087   },
5088
5089   {
5090     'key'         => 'svc_phone-bulk_provision_simple',
5091     'section'     => 'telephony',
5092     'description' => 'Bulk provision phone numbers with a simple number range instead of from DID vendor orders',
5093     'type'        => 'checkbox',
5094   },
5095
5096   {
5097     'key'         => 'default_phone_countrycode',
5098     'section'     => 'telephony',
5099     'description' => 'Default countrycode',
5100     'type'        => 'text',
5101   },
5102
5103   {
5104     'key'         => 'cdr-charged_party-field',
5105     'section'     => 'telephony',
5106     'description' => 'Set the charged_party field of CDRs to this field.',
5107     'type'        => 'select-sub',
5108     'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
5109                            map { $_ => $fields->{$_}||$_ }
5110                            grep { $_ !~ /^(acctid|charged_party)$/ }
5111                            FS::Schema::dbdef->table('cdr')->columns;
5112                          },
5113     'option_sub'  => sub { my $f = shift;
5114                            FS::cdr->table_info->{'fields'}{$f} || $f;
5115                          },
5116   },
5117
5118   #probably deprecate in favor of cdr-charged_party-field above
5119   {
5120     'key'         => 'cdr-charged_party-accountcode',
5121     'section'     => 'telephony',
5122     'description' => 'Set the charged_party field of CDRs to the accountcode.',
5123     'type'        => 'checkbox',
5124   },
5125
5126   {
5127     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
5128     'section'     => 'telephony',
5129     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
5130     'type'        => 'checkbox',
5131   },
5132
5133 #  {
5134 #    'key'         => 'cdr-charged_party-truncate_prefix',
5135 #    'section'     => '',
5136 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
5137 #    'type'        => 'text',
5138 #  },
5139 #
5140 #  {
5141 #    'key'         => 'cdr-charged_party-truncate_length',
5142 #    'section'     => '',
5143 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
5144 #    'type'        => 'text',
5145 #  },
5146
5147   {
5148     'key'         => 'cdr-charged_party_rewrite',
5149     'section'     => 'telephony',
5150     'description' => 'Do charged party rewriting in the freeside-cdrrewrited daemon; useful if CDRs are being dropped off directly in the database and require special charged_party processing such as cdr-charged_party-accountcode or cdr-charged_party-truncate*.',
5151     'type'        => 'checkbox',
5152   },
5153
5154   {
5155     'key'         => 'cdr-taqua-da_rewrite',
5156     'section'     => 'telephony',
5157     'description' => 'For the Taqua CDR format, a comma-separated list of directory assistance 800 numbers.  Any CDRs with these numbers as "BilledNumber" will be rewritten to the "CallingPartyNumber" (and CallType "12") on import.',
5158     'type'        => 'text',
5159   },
5160
5161   {
5162     'key'         => 'cdr-taqua-accountcode_rewrite',
5163     'section'     => 'telephony',
5164     'description' => 'For the Taqua CDR format, pull accountcodes from secondary CDRs with matching sessionNumber.',
5165     'type'        => 'checkbox',
5166   },
5167
5168   {
5169     'key'         => 'cdr-taqua-callerid_rewrite',
5170     'section'     => 'telephony',
5171     'description' => 'For the Taqua CDR format, pull Caller ID blocking information from secondary CDRs.',
5172     'type'        => 'checkbox',
5173   },
5174
5175   {
5176     'key'         => 'cdr-asterisk_australia_rewrite',
5177     'section'     => 'telephony',
5178     'description' => 'For Asterisk CDRs, assign CDR type numbers based on Australian conventions.',
5179     'type'        => 'checkbox',
5180   },
5181
5182   {
5183     'key'         => 'cdr-gsm_tap3-sender',
5184     'section'     => 'telephony',
5185     'description' => 'GSM TAP3 Sender network (5 letter code)',
5186     'type'        => 'text',
5187   },
5188
5189   {
5190     'key'         => 'cust_pkg-show_autosuspend',
5191     'section'     => 'UI',
5192     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
5193     'type'        => 'checkbox',
5194   },
5195
5196   {
5197     'key'         => 'cdr-asterisk_forward_rewrite',
5198     'section'     => 'telephony',
5199     'description' => 'Enable special processing for CDRs representing forwarded calls: For CDRs that have a dcontext that starts with "Local/" but does not match dst, set charged_party to dst, parse a new dst from dstchannel, and set amaflags to "2" ("BILL"/"BILLING").',
5200     'type'        => 'checkbox',
5201   },
5202
5203   {
5204     'key'         => 'mc-outbound_packages',
5205     'section'     => '',
5206     'description' => "Don't use this.",
5207     'type'        => 'select-part_pkg',
5208     'multiple'    => 1,
5209   },
5210
5211   {
5212     'key'         => 'disable-cust-pkg_class',
5213     'section'     => 'UI',
5214     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
5215     'type'        => 'checkbox',
5216   },
5217
5218   {
5219     'key'         => 'queued-max_kids',
5220     'section'     => '',
5221     'description' => 'Maximum number of queued processes.  Defaults to 10.',
5222     'type'        => 'text',
5223   },
5224
5225   {
5226     'key'         => 'queued-sleep_time',
5227     'section'     => '',
5228     'description' => 'Time to sleep between attempts to find new jobs to process in the queue.  Defaults to 10.  Installations doing real-time CDR processing for prepaid may want to set it lower.',
5229     'type'        => 'text',
5230   },
5231
5232   {
5233     'key'         => 'queue-no_history',
5234     'section'     => '',
5235     'description' => "Don't recreate the h_queue and h_queue_arg tables on upgrades.  This can save disk space for large installs, especially when using prepaid or multi-process billing.  After turning this option on, drop the h_queue and h_queue_arg tables, run freeside-dbdef-create and restart Apache and Freeside.",
5236     'type'        => 'checkbox',
5237   },
5238
5239   {
5240     'key'         => 'cancelled_cust-noevents',
5241     'section'     => 'billing',
5242     'description' => "Don't run events for cancelled customers",
5243     'type'        => 'checkbox',
5244   },
5245
5246   {
5247     'key'         => 'agent-invoice_template',
5248     'section'     => 'invoicing',
5249     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
5250     'type'        => 'checkbox',
5251   },
5252
5253   {
5254     'key'         => 'svc_broadband-manage_link',
5255     'section'     => 'UI',
5256     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr and $mac_addr.',
5257     'type'        => 'text',
5258   },
5259
5260   {
5261     'key'         => 'svc_broadband-manage_link_text',
5262     'section'     => 'UI',
5263     'description' => 'Label for "Manage Device" link',
5264     'type'        => 'text',
5265   },
5266
5267   {
5268     'key'         => 'svc_broadband-manage_link_loc',
5269     'section'     => 'UI',
5270     'description' => 'Location for "Manage Device" link',
5271     'type'        => 'select',
5272     'select_hash' => [
5273       'bottom' => 'Near Unprovision link',
5274       'right'  => 'With export-related links',
5275     ],
5276   },
5277
5278   {
5279     'key'         => 'svc_broadband-manage_link-new_window',
5280     'section'     => 'UI',
5281     'description' => 'Open the "Manage Device" link in a new window',
5282     'type'        => 'checkbox',
5283   },
5284
5285   #more fine-grained, service def-level control could be useful eventually?
5286   {
5287     'key'         => 'svc_broadband-allow_null_ip_addr',
5288     'section'     => '',
5289     'description' => '',
5290     'type'        => 'checkbox',
5291   },
5292
5293   {
5294     'key'         => 'svc_hardware-check_mac_addr',
5295     'section'     => '', #?
5296     'description' => 'Require the "hardware address" field in hardware services to be a valid MAC address.',
5297     'type'        => 'checkbox',
5298   },
5299
5300   {
5301     'key'         => 'tax-report_groups',
5302     'section'     => '',
5303     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
5304     'type'        => 'textarea',
5305   },
5306
5307   {
5308     'key'         => 'tax-cust_exempt-groups',
5309     'section'     => 'billing',
5310     'description' => 'List of grouping possibilities for tax names, for per-customer exemption purposes, one tax name per line.  For example, "GST" would indicate the ability to exempt customers individually from taxes named "GST" (but not other taxes).',
5311     'type'        => 'textarea',
5312   },
5313
5314   {
5315     'key'         => 'tax-cust_exempt-groups-require_individual_nums',
5316     'section'     => 'deprecated',
5317     'description' => 'Deprecated: see tax-cust_exempt-groups-number_requirement',
5318     'type'        => 'checkbox',
5319   },
5320
5321   {
5322     'key'         => 'tax-cust_exempt-groups-num_req',
5323     'section'     => 'billing',
5324     'description' => 'When using tax-cust_exempt-groups, control whether individual tax exemption numbers are required for exemption from different taxes.',
5325     'type'        => 'select',
5326     'select_hash' => [ ''            => 'Not required',
5327                        'residential' => 'Required for residential customers only',
5328                        'all'         => 'Required for all customers',
5329                      ],
5330   },
5331
5332   {
5333     'key'         => 'cust_main-default_view',
5334     'section'     => 'UI',
5335     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
5336     'type'        => 'select',
5337     'select_hash' => [
5338       #false laziness w/view/cust_main.cgi and pref/pref.html
5339       'basics'          => 'Basics',
5340       'notes'           => 'Notes',
5341       'tickets'         => 'Tickets',
5342       'packages'        => 'Packages',
5343       'payment_history' => 'Payment History',
5344       'change_history'  => 'Change History',
5345       'jumbo'           => 'Jumbo',
5346     ],
5347   },
5348
5349   {
5350     'key'         => 'enable_tax_adjustments',
5351     'section'     => 'billing',
5352     'description' => 'Enable the ability to add manual tax adjustments.',
5353     'type'        => 'checkbox',
5354   },
5355
5356   {
5357     'key'         => 'rt-crontool',
5358     'section'     => '',
5359     'description' => 'Enable the RT CronTool extension.',
5360     'type'        => 'checkbox',
5361   },
5362
5363   {
5364     'key'         => 'pkg-balances',
5365     'section'     => 'billing',
5366     'description' => 'Enable per-package balances.',
5367     'type'        => 'checkbox',
5368   },
5369
5370   {
5371     'key'         => 'pkg-addon_classnum',
5372     'section'     => 'billing',
5373     'description' => 'Enable the ability to restrict additional package orders based on package class.',
5374     'type'        => 'checkbox',
5375   },
5376
5377   {
5378     'key'         => 'cust_main-edit_signupdate',
5379     'section'     => 'UI',
5380     'description' => 'Enable manual editing of the signup date.',
5381     'type'        => 'checkbox',
5382   },
5383
5384   {
5385     'key'         => 'svc_acct-disable_access_number',
5386     'section'     => 'UI',
5387     'description' => 'Disable access number selection.',
5388     'type'        => 'checkbox',
5389   },
5390
5391   {
5392     'key'         => 'cust_bill_pay_pkg-manual',
5393     'section'     => 'UI',
5394     'description' => 'Allow manual application of payments to line items.',
5395     'type'        => 'checkbox',
5396   },
5397
5398   {
5399     'key'         => 'cust_credit_bill_pkg-manual',
5400     'section'     => 'UI',
5401     'description' => 'Allow manual application of credits to line items.',
5402     'type'        => 'checkbox',
5403   },
5404
5405   {
5406     'key'         => 'breakage-days',
5407     'section'     => 'billing',
5408     'description' => 'If set to a number of days, after an account goes that long without activity, recognizes any outstanding payments and credits as "breakage" by creating a breakage charge and invoice.',
5409     'type'        => 'text',
5410     'per_agent'   => 1,
5411   },
5412
5413   {
5414     'key'         => 'breakage-pkg_class',
5415     'section'     => 'billing',
5416     'description' => 'Package class to use for breakage reconciliation.',
5417     'type'        => 'select-pkg_class',
5418   },
5419
5420   {
5421     'key'         => 'disable_cron_billing',
5422     'section'     => 'billing',
5423     'description' => 'Disable billing and collection from being run by freeside-daily and freeside-monthly, while still allowing other actions to run, such as notifications and backup.',
5424     'type'        => 'checkbox',
5425   },
5426
5427   {
5428     'key'         => 'svc_domain-edit_domain',
5429     'section'     => '',
5430     'description' => 'Enable domain renaming',
5431     'type'        => 'checkbox',
5432   },
5433
5434   {
5435     'key'         => 'enable_legacy_prepaid_income',
5436     'section'     => '',
5437     'description' => "Enable legacy prepaid income reporting.  Only useful when you have imported pre-Freeside packages with longer-than-monthly duration, and need to do prepaid income reporting on them before they've been invoiced the first time.",
5438     'type'        => 'checkbox',
5439   },
5440
5441   {
5442     'key'         => 'cust_main-exports',
5443     'section'     => '',
5444     'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
5445     'type'        => 'select-sub',
5446     'multiple'    => 1,
5447     'options_sub' => sub {
5448       require FS::Record;
5449       require FS::part_export;
5450       my @part_export =
5451         map { qsearch( 'part_export', {exporttype => $_ } ) }
5452           keys %{FS::part_export::export_info('cust_main')};
5453       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
5454     },
5455     'option_sub'  => sub {
5456       require FS::Record;
5457       require FS::part_export;
5458       my $part_export = FS::Record::qsearchs(
5459         'part_export', { 'exportnum' => shift }
5460       );
5461       $part_export
5462         ? $part_export->exporttype.' to '.$part_export->machine
5463         : '';
5464     },
5465   },
5466
5467   #false laziness w/above options_sub and option_sub
5468   {
5469     'key'         => 'cust_location-exports',
5470     'section'     => '',
5471     'description' => 'Export(s) to call on cust_location insert, modification and deletion.',
5472     'type'        => 'select-sub',
5473     'multiple'    => 1,
5474     'options_sub' => sub {
5475       require FS::Record;
5476       require FS::part_export;
5477       my @part_export =
5478         map { qsearch( 'part_export', {exporttype => $_ } ) }
5479           keys %{FS::part_export::export_info('cust_location')};
5480       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
5481     },
5482     'option_sub'  => sub {
5483       require FS::Record;
5484       require FS::part_export;
5485       my $part_export = FS::Record::qsearchs(
5486         'part_export', { 'exportnum' => shift }
5487       );
5488       $part_export
5489         ? $part_export->exporttype.' to '.$part_export->machine
5490         : '';
5491     },
5492   },
5493
5494   {
5495     'key'         => 'cust_tag-location',
5496     'section'     => 'UI',
5497     'description' => 'Location where customer tags are displayed.',
5498     'type'        => 'select',
5499     'select_enum' => [ 'misc_info', 'top' ],
5500   },
5501
5502   {
5503     'key'         => 'cust_main-custom_link',
5504     'section'     => 'UI',
5505     'description' => 'URL to use as source for the "Custom" tab in the View Customer page.  The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere.  "$agentnum" will be replaced with the agent number, "$agent_custid" with be replaced with the agent customer ID (if any), and "$usernum" will be replaced with the employee number.',
5506     'type'        => 'textarea',
5507   },
5508
5509   {
5510     'key'         => 'cust_main-custom_content',
5511     'section'     => 'UI',
5512     'description' => 'As an alternative to cust_main-custom_link (leave it blank), the contant to display on this customer page, one item per line.  Available iems are: small_custview, birthdate, spouse_birthdate, svc_acct, svc_phone and svc_external.',
5513     'type'        => 'textarea',
5514   },
5515
5516   {
5517     'key'         => 'cust_main-custom_title',
5518     'section'     => 'UI',
5519     'description' => 'Title for the "Custom" tab in the View Customer page.',
5520     'type'        => 'text',
5521   },
5522
5523   {
5524     'key'         => 'part_pkg-default_suspend_bill',
5525     'section'     => 'billing',
5526     'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
5527     'type'        => 'checkbox',
5528   },
5529   
5530   {
5531     'key'         => 'qual-alt_address_format',
5532     'section'     => 'UI',
5533     'description' => 'Enable the alternate address format (location type, number, and kind) for qualifications.',
5534     'type'        => 'checkbox',
5535   },
5536
5537   {
5538     'key'         => 'prospect_main-alt_address_format',
5539     'section'     => 'UI',
5540     'description' => 'Enable the alternate address format (location type, number, and kind) for prospects.  Recommended if qual-alt_address_format is set and the main use of propects is for qualifications.',
5541     'type'        => 'checkbox',
5542   },
5543
5544   {
5545     'key'         => 'prospect_main-location_required',
5546     'section'     => 'UI',
5547     'description' => 'Require an address for prospects.  Recommended if the main use of propects is for qualifications.',
5548     'type'        => 'checkbox',
5549   },
5550
5551   {
5552     'key'         => 'note-classes',
5553     'section'     => 'UI',
5554     'description' => 'Use customer note classes',
5555     'type'        => 'select',
5556     'select_hash' => [
5557                        0 => 'Disabled',
5558                        1 => 'Enabled',
5559                        2 => 'Enabled, with tabs',
5560                      ],
5561   },
5562
5563   {
5564     'key'         => 'svc_acct-cf_privatekey-message',
5565     'section'     => '',
5566     'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
5567     'type'        => 'textarea',
5568   },
5569
5570   {
5571     'key'         => 'menu-prepend_links',
5572     'section'     => 'UI',
5573     'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
5574     'type'        => 'textarea',
5575   },
5576
5577   {
5578     'key'         => 'cust_main-external_links',
5579     'section'     => 'UI',
5580     'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)".  The URL will have custnum appended.',
5581     'type'        => 'textarea',
5582   },
5583   
5584   {
5585     'key'         => 'svc_phone-did-summary',
5586     'section'     => 'invoicing',
5587     'description' => 'Experimental feature to enable DID activity summary on invoices, showing # DIDs activated/deactivated/ported-in/ported-out and total minutes usage, covering period since last invoice.',
5588     'type'        => 'checkbox',
5589   },
5590
5591   {
5592     'key'         => 'svc_acct-usage_seconds',
5593     'section'     => 'invoicing',
5594     'description' => 'Enable calculation of RADIUS usage time for invoices.  You must modify your template to display this information.',
5595     'type'        => 'checkbox',
5596   },
5597   
5598   {
5599     'key'         => 'opensips_gwlist',
5600     'section'     => 'telephony',
5601     'description' => 'For svc_phone OpenSIPS dr_rules export, gwlist column value, per-agent',
5602     'type'        => 'text',
5603     'per_agent'   => 1,
5604     'agentonly'   => 1,
5605   },
5606
5607   {
5608     'key'         => 'opensips_description',
5609     'section'     => 'telephony',
5610     'description' => 'For svc_phone OpenSIPS dr_rules export, description column value, per-agent',
5611     'type'        => 'text',
5612     'per_agent'   => 1,
5613     'agentonly'   => 1,
5614   },
5615   
5616   {
5617     'key'         => 'opensips_route',
5618     'section'     => 'telephony',
5619     'description' => 'For svc_phone OpenSIPS dr_rules export, routeid column value, per-agent',
5620     'type'        => 'text',
5621     'per_agent'   => 1,
5622     'agentonly'   => 1,
5623   },
5624
5625   {
5626     'key'         => 'cust_bill-no_recipients-error',
5627     'section'     => 'invoicing',
5628     'description' => 'For customers with no invoice recipients, throw a job queue error rather than the default behavior of emailing the invoice to the invoice_from address.',
5629     'type'        => 'checkbox',
5630   },
5631
5632   {
5633     'key'         => 'cust_bill-latex_lineitem_maxlength',
5634     'section'     => 'invoicing',
5635     'description' => 'Truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin.  Defaults to 50.  ',
5636     'type'        => 'text',
5637   },
5638
5639   {
5640     'key'         => 'invoice_payment_details',
5641     'section'     => 'invoicing',
5642     'description' => 'When displaying payments on an invoice, show the payment method used, including the check or credit card number.  Credit card numbers will be masked.',
5643     'type'        => 'checkbox',
5644   },
5645
5646   {
5647     'key'         => 'cust_main-status_module',
5648     'section'     => 'UI',
5649     'description' => 'Which module to use for customer status display.  The "Classic" module (the default) considers accounts with cancelled recurring packages but un-cancelled one-time charges Inactive.  The "Recurring" module considers those customers Cancelled.  Similarly for customers with suspended recurring packages but one-time charges.', #other differences?
5650     'type'        => 'select',
5651     'select_enum' => [ 'Classic', 'Recurring' ],
5652   },
5653
5654   { 
5655     'key'         => 'username-pound',
5656     'section'     => 'username',
5657     'description' => 'Allow the pound character (#) in usernames.',
5658     'type'        => 'checkbox',
5659   },
5660
5661   { 
5662     'key'         => 'username-exclamation',
5663     'section'     => 'username',
5664     'description' => 'Allow the exclamation character (!) in usernames.',
5665     'type'        => 'checkbox',
5666   },
5667
5668   {
5669     'key'         => 'ie-compatibility_mode',
5670     'section'     => 'UI',
5671     'description' => "Compatibility mode META tag for Internet Explorer, used on the customer view page.  Not necessary in normal operation unless custom content (notes, cust_main-custom_link) is included on customer view that is incompatibile with newer IE verisons.",
5672     'type'        => 'select',
5673     'select_enum' => [ '', '7', 'EmulateIE7', '8', 'EmulateIE8' ],
5674   },
5675
5676   {
5677     'key'         => 'disable_payauto_default',
5678     'section'     => 'UI',
5679     'description' => 'Disable the "Charge future payments to this (card|check) automatically" checkbox from defaulting to checked.',
5680     'type'        => 'checkbox',
5681   },
5682   
5683   {
5684     'key'         => 'payment-history-report',
5685     'section'     => 'UI',
5686     'description' => 'Show a link to the raw database payment history report in the Reports menu.  DO NOT ENABLE THIS for modern installations.',
5687     'type'        => 'checkbox',
5688   },
5689   
5690   {
5691     'key'         => 'svc_broadband-require-nw-coordinates',
5692     'section'     => 'deprecated',
5693     'description' => 'Deprecated; see geocode-require_nw_coordinates instead',
5694     'type'        => 'checkbox',
5695   },
5696   
5697   {
5698     'key'         => 'cust-email-high-visibility',
5699     'section'     => 'UI',
5700     'description' => 'Move the invoicing e-mail address field to the top of the billing address section and highlight it.',
5701     'type'        => 'checkbox',
5702   },
5703   
5704   {
5705     'key'         => 'cust-edit-alt-field-order',
5706     'section'     => 'UI',
5707     'description' => 'An alternate ordering of fields for the New Customer and Edit Customer screens.',
5708     'type'        => 'checkbox',
5709   },
5710
5711   {
5712     'key'         => 'cust_bill-enable_promised_date',
5713     'section'     => 'UI',
5714     'description' => 'Enable display/editing of the "promised payment date" field on invoices.',
5715     'type'        => 'checkbox',
5716   },
5717   
5718   {
5719     'key'         => 'available-locales',
5720     'section'     => '',
5721     'description' => 'Limit available locales (employee preferences, per-customer locale selection, etc.) to a particular set.',
5722     'type'        => 'select-sub',
5723     'multiple'    => 1,
5724     'options_sub' => sub { 
5725       map { $_ => FS::Locales->description($_) }
5726       FS::Locales->locales;
5727     },
5728     'option_sub'  => sub { FS::Locales->description(shift) },
5729   },
5730
5731   {
5732     'key'         => 'cust_main-require_locale',
5733     'section'     => 'UI',
5734     'description' => 'Require an explicit locale to be chosen for new customers.',
5735     'type'        => 'checkbox',
5736   },
5737   
5738   {
5739     'key'         => 'translate-auto-insert',
5740     'section'     => '',
5741     'description' => 'Auto-insert untranslated strings for selected non-en_US locales with their default/en_US values.  Do not turn this on unless translating the interface into a new language.',
5742     'type'        => 'select',
5743     'multiple'    => 1,
5744     'select_enum' => [ grep { $_ ne 'en_US' } FS::Locales::locales ],
5745   },
5746
5747   {
5748     'key'         => 'svc_acct-tower_sector',
5749     'section'     => '',
5750     'description' => 'Track tower and sector for svc_acct (account) services.',
5751     'type'        => 'checkbox',
5752   },
5753
5754   {
5755     'key'         => 'cdr-prerate',
5756     'section'     => 'telephony',
5757     'description' => 'Experimental feature to rate CDRs immediately, rather than waiting until invoice generation time.  Can reduce invoice generation time when processing lots of CDRs.  Currently works with "VoIP/telco CDR rating (standard)" price plans using "Phone numbers (svc_phone.phonenum)" CDR service matching, without any included minutes.',
5758     'type'        => 'checkbox',
5759   },
5760
5761   {
5762     'key'         => 'cdr-prerate-cdrtypenums',
5763     'section'     => 'telephony',
5764     'description' => 'When using cdr-prerate to rate CDRs immediately, limit processing to these CDR types.',
5765     'type'        => 'select-sub',
5766     'multiple'    => 1,
5767     'options_sub' => sub { require FS::Record;
5768                            require FS::cdr_type;
5769                            map { $_->cdrtypenum => $_->cdrtypename }
5770                                FS::Record::qsearch( 'cdr_type', 
5771                                                     {} #{ 'disabled' => '' }
5772                                                   );
5773                          },
5774     'option_sub'  => sub { require FS::Record;
5775                            require FS::cdr_type;
5776                            my $cdr_type = FS::Record::qsearchs(
5777                              'cdr_type', { 'cdrtypenum'=>shift } );
5778                            $cdr_type ? $cdr_type->cdrtypename : '';
5779                          },
5780   },
5781
5782   {
5783     'key'         => 'cdr-minutes_priority',
5784     'section'     => 'telephony',
5785     'description' => 'Priority rule for assigning included minutes to CDRs.',
5786     'type'        => 'select',
5787     'select_hash' => [
5788       ''          => 'No specific order',
5789       'time'      => 'Chronological',
5790       'rate_high' => 'Highest rate first',
5791       'rate_low'  => 'Lowest rate first',
5792     ],
5793   },
5794   
5795   {
5796     'key'         => 'brand-agent',
5797     'section'     => 'UI',
5798     'description' => 'Brand the backoffice interface (currently Help->About) using the company_name, company_url and logo.png configuration settings of the selected agent.  Typically used when selling or bundling hosted access to the backoffice interface.  NOTE: The AGPL software license has specific requirements for source code availability in this situation.',
5799     'type'        => 'select-agent',
5800   },
5801
5802   {
5803     'key'         => 'cust_class-tax_exempt',
5804     'section'     => 'billing',
5805     'description' => 'Control the tax exemption flag per customer class rather than per indivual customer.',
5806     'type'        => 'checkbox',
5807   },
5808
5809   {
5810     'key'         => 'selfservice-billing_history-line_items',
5811     'section'     => 'self-service',
5812     'description' => 'Return line item billing detail for the self-service billing_history API call.',
5813     'type'        => 'checkbox',
5814   },
5815
5816   {
5817     'key'         => 'selfservice-default_cdr_format',
5818     'section'     => 'self-service',
5819     'description' => 'Format for showing outbound CDRs in self-service.  The per-package option overrides this.',
5820     'type'        => 'select',
5821     'select_hash' => \@cdr_formats,
5822   },
5823
5824   {
5825     'key'         => 'selfservice-default_inbound_cdr_format',
5826     'section'     => 'self-service',
5827     'description' => 'Format for showing inbound CDRs in self-service.  The per-package option overrides this.  Leave blank to avoid showing these CDRs.',
5828     'type'        => 'select',
5829     'select_hash' => \@cdr_formats,
5830   },
5831
5832   {
5833     'key'         => 'selfservice-hide_cdr_price',
5834     'section'     => 'self-service',
5835     'description' => 'Don\'t show the "Price" column on CDRs in self-service.',
5836     'type'        => 'checkbox',
5837   },
5838
5839   {
5840     'key'         => 'logout-timeout',
5841     'section'     => 'UI',
5842     'description' => 'If set, automatically log users out of the backoffice after this many minutes.',
5843     'type'       => 'text',
5844   },
5845   
5846   {
5847     'key'         => 'spreadsheet_format',
5848     'section'     => 'UI',
5849     'description' => 'Default format for spreadsheet download.',
5850     'type'        => 'select',
5851     'select_hash' => [
5852       'XLS' => 'XLS (Excel 97/2000/XP)',
5853       'XLSX' => 'XLSX (Excel 2007+)',
5854     ],
5855   },
5856
5857   {
5858     'key'         => 'agent-email_day',
5859     'section'     => '',
5860     'description' => 'On this day of each month, agents with master customer records containing email addresses will be emailed a list of their customers and balances.',
5861     'type'        => 'text',
5862   },
5863
5864   {
5865     'key'         => 'report-cust_pay-select_time',
5866     'section'     => 'UI',
5867     'description' => 'Enable time selection on payment and refund reports.',
5868     'type'        => 'checkbox',
5869   },
5870
5871   {
5872     'key'         => 'authentication_module',
5873     'section'     => 'UI',
5874     'description' => '"Internal" is the default , which authenticates against the internal database.  "Legacy" is similar, but matches passwords against a legacy htpasswd file.',
5875     'type'        => 'select',
5876     'select_enum' => [qw( Internal Legacy )],
5877   },
5878
5879   {
5880     'key'         => 'external_auth-access_group-template_user',
5881     'section'     => 'UI',
5882     'description' => 'When using an external authentication module, specifies the default access groups for autocreated users, via a template user.',
5883     'type'        => 'text',
5884   },
5885
5886   {
5887     'key'         => 'allow_invalid_cards',
5888     'section'     => '',
5889     'description' => 'Accept invalid credit card numbers.  Useful for testing with fictitious customers.  There is no good reason to enable this in production.',
5890     'type'        => 'checkbox',
5891   },
5892
5893   {
5894     'key'         => 'default_credit_limit',
5895     'section'     => 'billing',
5896     'description' => 'Default customer credit limit',
5897     'type'        => 'text',
5898   },
5899
5900   {
5901     'key'         => 'api_shared_secret',
5902     'section'     => 'API',
5903     'description' => 'Shared secret for back-office API authentication',
5904     'type'        => 'text',
5905   },
5906
5907   {
5908     'key'         => 'xmlrpc_api',
5909     'section'     => 'API',
5910     'description' => 'Enable the back-office API XML-RPC server (on port 8008).',
5911     'type'        => 'checkbox',
5912   },
5913
5914 #  {
5915 #    'key'         => 'jsonrpc_api',
5916 #    'section'     => 'API',
5917 #    'description' => 'Enable the back-office API JSON-RPC server (on port 8081).',
5918 #    'type'        => 'checkbox',
5919 #  },
5920
5921   {
5922     'key'         => 'api_credit_reason',
5923     'section'     => 'API',
5924     'description' => 'Default reason for back-office API credits',
5925     'type'        => 'select-sub',
5926     #false laziness w/api_credit_reason
5927     'options_sub' => sub { require FS::Record;
5928                            require FS::reason;
5929                            my $type = qsearchs('reason_type', 
5930                              { class => 'R' }) 
5931                               or return ();
5932                            map { $_->reasonnum => $_->reason }
5933                                FS::Record::qsearch('reason', 
5934                                  { reason_type => $type->typenum } 
5935                                );
5936                          },
5937     'option_sub'  => sub { require FS::Record;
5938                            require FS::reason;
5939                            my $reason = FS::Record::qsearchs(
5940                              'reason', { 'reasonnum' => shift }
5941                            );
5942                            $reason ? $reason->reason : '';
5943                          },
5944   },
5945
5946   {
5947     'key'         => 'part_pkg-term_discounts',
5948     'section'     => 'billing',
5949     'description' => 'Enable the term discounts feature.  Recommended to keep turned off unless actually using - not well optimized for large installations.',
5950     'type'        => 'checkbox',
5951   },
5952
5953   {
5954     'key'         => 'prepaid-never_renew',
5955     'section'     => 'billing',
5956     'description' => 'Prepaid packages never renew.',
5957     'type'        => 'checkbox',
5958   },
5959
5960   {
5961     'key'         => 'agent-disable_counts',
5962     'section'     => 'UI',
5963     'description' => 'On the agent browse page, disable the customer and package counts.  Typically used for very large databases when this page takes too long to render.',
5964     'type'        => 'checkbox',
5965   },
5966
5967   {
5968     'key'         => 'tollfree-country',
5969     'section'     => 'telephony',
5970     'description' => 'Country / region for toll-free recognition',
5971     'type'        => 'select',
5972     'select_hash' => [ ''   => 'NANPA (US/Canada)',
5973                        'AU' => 'Australia',
5974                        'NZ' => 'New Zealand',
5975                      ],
5976   },
5977
5978   {
5979     'key'         => 'old_fcc_report',
5980     'section'     => '',
5981     'description' => 'Use the old (pre-2014) FCC Form 477 report format.',
5982     'type'        => 'checkbox',
5983   },
5984
5985   {
5986     'key'         => 'cust_main-default_commercial',
5987     'section'     => 'UI',
5988     'description' => 'Default for new customers is commercial rather than residential.',
5989     'type'        => 'checkbox',
5990   },
5991
5992   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5993   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5994   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5995   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5996   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5997   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5998   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5999   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6000   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6001   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6002   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6003   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6004   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6005   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6006   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6007   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6008   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6009   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6010   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6011   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6012   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6013   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6014   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6015   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6016   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6017   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6018   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6019   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6020   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6021   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6022   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6023   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6024   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6025   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6026   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6027   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6028   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6029   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6030   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6031   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6032   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6033
6034 );
6035
6036 1;
6037