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