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