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