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