RT#34078: Payment History Report / Statement
[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'         => 'invoicehtmlwatermark',
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'         => 'invoicelatexwatermark',
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'         => 'payment_history_msgnum',
2659     'section'     => 'notification',
2660     'description' => 'Template to use for sending payment history to customer',
2661     %msg_template_options,
2662   },
2663
2664   {
2665     'key'         => 'payby',
2666     'section'     => 'billing',
2667     'description' => 'Available payment types.',
2668     'type'        => 'selectmultiple',
2669     'select_enum' => [ qw(CARD DCRD CHEK DCHK CASH WEST MCRD MCHK PPAL) ],
2670   },
2671
2672   {
2673     'key'         => 'banned_pay-pad',
2674     'section'     => 'billing',
2675     '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.',
2676     'type'        => 'text',
2677   },
2678
2679   {
2680     'key'         => 'payby-default',
2681     'section'     => 'deprecated',
2682     '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.',
2683     'type'        => 'select',
2684     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD PPAL COMP HIDE) ],
2685   },
2686
2687   {
2688     'key'         => 'require_cash_deposit_info',
2689     'section'     => 'billing',
2690     'description' => 'When recording cash payments, display bank deposit information fields.',
2691     'type'        => 'checkbox',
2692   },
2693
2694   {
2695     'key'         => 'paymentforcedtobatch',
2696     'section'     => 'deprecated',
2697     '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.',
2698     'type'        => 'checkbox',
2699   },
2700
2701   {
2702     'key'         => 'svc_acct-notes',
2703     'section'     => 'deprecated',
2704     'description' => 'Extra HTML to be displayed on the Account View screen.',
2705     'type'        => 'textarea',
2706   },
2707
2708   {
2709     'key'         => 'radius-password',
2710     'section'     => '',
2711     'description' => 'RADIUS attribute for plain-text passwords.',
2712     'type'        => 'select',
2713     'select_enum' => [ 'Password', 'User-Password', 'Cleartext-Password' ],
2714   },
2715
2716   {
2717     'key'         => 'radius-ip',
2718     'section'     => '',
2719     'description' => 'RADIUS attribute for IP addresses.',
2720     'type'        => 'select',
2721     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
2722   },
2723
2724   #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
2725   {
2726     'key'         => 'radius-chillispot-max',
2727     'section'     => '',
2728     'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
2729     'type'        => 'checkbox',
2730   },
2731
2732   {
2733     'key'         => 'svc_broadband-radius',
2734     'section'     => '',
2735     'description' => 'Enable RADIUS groups for broadband services.',
2736     'type'        => 'checkbox',
2737   },
2738
2739   {
2740     'key'         => 'svc_acct-alldomains',
2741     'section'     => '',
2742     '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.',
2743     'type'        => 'checkbox',
2744   },
2745
2746   {
2747     'key'         => 'dump-localdest',
2748     'section'     => '',
2749     'description' => 'Destination for local database dumps (full path)',
2750     'type'        => 'text',
2751   },
2752
2753   {
2754     'key'         => 'dump-scpdest',
2755     'section'     => '',
2756     'description' => 'Destination for scp database dumps: user@host:/path',
2757     'type'        => 'text',
2758   },
2759
2760   {
2761     'key'         => 'dump-pgpid',
2762     'section'     => '',
2763     '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.",
2764     'type'        => 'text',
2765   },
2766
2767   {
2768     'key'         => 'users-allow_comp',
2769     'section'     => 'deprecated',
2770     '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.',
2771     'type'        => 'textarea',
2772   },
2773
2774   {
2775     'key'         => 'credit_card-recurring_billing_flag',
2776     'section'     => 'billing',
2777     '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. ',
2778     'type'        => 'select',
2779     'select_hash' => [
2780                        'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
2781                        'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
2782                      ],
2783   },
2784
2785   {
2786     'key'         => 'credit_card-recurring_billing_acct_code',
2787     'section'     => 'billing',
2788     'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
2789     'type'        => 'checkbox',
2790   },
2791
2792   {
2793     'key'         => 'cvv-save',
2794     'section'     => 'billing',
2795     '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.',
2796     'type'        => 'selectmultiple',
2797     'select_enum' => \@card_types,
2798   },
2799
2800   {
2801     'key'         => 'signup-require_cvv',
2802     'section'     => 'self-service',
2803     'description' => 'Require CVV for credit card signup.',
2804     'type'        => 'checkbox',
2805   },
2806
2807   {
2808     'key'         => 'backoffice-require_cvv',
2809     'section'     => 'billing',
2810     'description' => 'Require CVV for manual credit card entry.',
2811     'type'        => 'checkbox',
2812   },
2813
2814   {
2815     'key'         => 'selfservice-onfile_require_cvv',
2816     'section'     => 'self-service',
2817     'description' => 'Require CVV for on-file credit card during self-service payments.',
2818     'type'        => 'checkbox',
2819   },
2820
2821   {
2822     'key'         => 'selfservice-require_cvv',
2823     'section'     => 'self-service',
2824     'description' => 'Require CVV for credit card self-service payments, except for cards on-file.',
2825     'type'        => 'checkbox',
2826   },
2827
2828   {
2829     'key'         => 'manual_process-single_invoice_amount',
2830     'section'     => 'billing',
2831     'description' => 'When entering manual credit card and ACH payments, amount will not autofill if the customer has more than one open invoice',
2832     'type'        => 'checkbox',
2833   },
2834
2835   {
2836     'key'         => 'manual_process-pkgpart',
2837     'section'     => 'billing',
2838     '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.',
2839     'type'        => 'select-part_pkg',
2840     'per_agent'   => 1,
2841   },
2842
2843   {
2844     'key'         => 'manual_process-display',
2845     'section'     => 'billing',
2846     'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2847     'type'        => 'select',
2848     'select_hash' => [
2849                        'add'      => 'Add fee to amount entered',
2850                        'subtract' => 'Subtract fee from amount entered',
2851                      ],
2852   },
2853
2854   {
2855     'key'         => 'manual_process-skip_first',
2856     'section'     => 'billing',
2857     'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
2858     'type'        => 'checkbox',
2859   },
2860
2861   {
2862     'key'         => 'selfservice_immutable-package',
2863     'section'     => 'self-service',
2864     'description' => 'Disable package changes in self-service interface.',
2865     'type'        => 'checkbox',
2866     'per_agent'   => 1,
2867   },
2868
2869   {
2870     'key'         => 'selfservice_hide-usage',
2871     'section'     => 'self-service',
2872     'description' => 'Hide usage data in self-service interface.',
2873     'type'        => 'checkbox',
2874     'per_agent'   => 1,
2875   },
2876
2877   {
2878     'key'         => 'selfservice_process-pkgpart',
2879     'section'     => 'billing',
2880     '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.',
2881     'type'        => 'select-part_pkg',
2882     'per_agent'   => 1,
2883   },
2884
2885   {
2886     'key'         => 'selfservice_process-display',
2887     'section'     => 'billing',
2888     'description' => 'When using selfservice_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2889     'type'        => 'select',
2890     'select_hash' => [
2891                        'add'      => 'Add fee to amount entered',
2892                        'subtract' => 'Subtract fee from amount entered',
2893                      ],
2894   },
2895
2896   {
2897     'key'         => 'selfservice_process-skip_first',
2898     'section'     => 'billing',
2899     'description' => "When using selfservice_process-pkgpart, omit the fee if it is the customer's first payment.",
2900     'type'        => 'checkbox',
2901   },
2902
2903 #  {
2904 #    'key'         => 'auto_process-pkgpart',
2905 #    'section'     => 'billing',
2906 #    '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.',
2907 #    'type'        => 'select-part_pkg',
2908 #  },
2909 #
2910 ##  {
2911 ##    'key'         => 'auto_process-display',
2912 ##    'section'     => 'billing',
2913 ##    'description' => 'When using auto_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2914 ##    'type'        => 'select',
2915 ##    'select_hash' => [
2916 ##                       'add'      => 'Add fee to amount entered',
2917 ##                       'subtract' => 'Subtract fee from amount entered',
2918 ##                     ],
2919 ##  },
2920 #
2921 #  {
2922 #    'key'         => 'auto_process-skip_first',
2923 #    'section'     => 'billing',
2924 #    'description' => "When using auto_process-pkgpart, omit the fee if it is the customer's first payment.",
2925 #    'type'        => 'checkbox',
2926 #  },
2927
2928   {
2929     'key'         => 'allow_negative_charges',
2930     'section'     => 'billing',
2931     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
2932     'type'        => 'checkbox',
2933   },
2934   {
2935       'key'         => 'auto_unset_catchall',
2936       'section'     => '',
2937       '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.',
2938       'type'        => 'checkbox',
2939   },
2940
2941   {
2942     'key'         => 'system_usernames',
2943     'section'     => 'username',
2944     '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.',
2945     'type'        => 'textarea',
2946   },
2947
2948   {
2949     'key'         => 'cust_pkg-change_svcpart',
2950     'section'     => '',
2951     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
2952     'type'        => 'checkbox',
2953   },
2954
2955   {
2956     'key'         => 'cust_pkg-change_pkgpart-bill_now',
2957     'section'     => '',
2958     '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.",
2959     'type'        => 'checkbox',
2960   },
2961
2962   {
2963     'key'         => 'disable_autoreverse',
2964     'section'     => 'BIND',
2965     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
2966     'type'        => 'checkbox',
2967   },
2968
2969   {
2970     'key'         => 'svc_www-enable_subdomains',
2971     'section'     => '',
2972     'description' => 'Enable selection of specific subdomains for virtual host creation.',
2973     'type'        => 'checkbox',
2974   },
2975
2976   {
2977     'key'         => 'svc_www-usersvc_svcpart',
2978     'section'     => '',
2979     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
2980     'type'        => 'select-part_svc',
2981     'multiple'    => 1,
2982   },
2983
2984   {
2985     'key'         => 'selfservice_server-primary_only',
2986     'section'     => 'self-service',
2987     'description' => 'Only allow primary accounts to access self-service functionality.',
2988     'type'        => 'checkbox',
2989   },
2990
2991   {
2992     'key'         => 'selfservice_server-phone_login',
2993     'section'     => 'self-service',
2994     'description' => 'Allow login to self-service with phone number and PIN.',
2995     'type'        => 'checkbox',
2996   },
2997
2998   {
2999     'key'         => 'selfservice_server-single_domain',
3000     'section'     => 'self-service',
3001     'description' => 'If specified, only use this one domain for self-service access.',
3002     'type'        => 'text',
3003   },
3004
3005   {
3006     'key'         => 'selfservice_server-login_svcpart',
3007     'section'     => 'self-service',
3008     'description' => 'If specified, only allow the specified svcparts to login to self-service.',
3009     'type'        => 'select-part_svc',
3010     'multiple'    => 1,
3011   },
3012
3013   {
3014     'key'         => 'selfservice-svc_forward_svcpart',
3015     'section'     => 'self-service',
3016     'description' => 'Service for self-service forward editing.',
3017     'type'        => 'select-part_svc',
3018   },
3019
3020   {
3021     'key'         => 'selfservice-password_reset_verification',
3022     'section'     => 'self-service',
3023     'description' => 'If enabled, specifies the type of verification required for self-service password resets.',
3024     'type'        => 'select',
3025     'select_hash' => [ '' => 'Password reset disabled',
3026                        'email' => 'Click on a link in email',
3027                        '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.',
3028                      ],
3029   },
3030
3031   {
3032     'key'         => 'selfservice-password_reset_msgnum',
3033     'section'     => 'self-service',
3034     'description' => 'Template to use for password reset emails.',
3035     %msg_template_options,
3036   },
3037
3038   {
3039     'key'         => 'selfservice-password_change_oldpass',
3040     'section'     => 'self-service',
3041     'description' => 'Require old password to be entered again for password changes (in addition to being logged in), at the API level.',
3042     'type'        => 'checkbox',
3043   },
3044
3045   {
3046     'key'         => 'selfservice-hide_invoices-taxclass',
3047     'section'     => 'self-service',
3048     '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.',
3049     'type'        => 'text',
3050   },
3051
3052   {
3053     'key'         => 'selfservice-recent-did-age',
3054     'section'     => 'self-service',
3055     'description' => 'If specified, defines "recent", in number of seconds, for "Download recently allocated DIDs" in self-service.',
3056     'type'        => 'text',
3057   },
3058
3059   {
3060     'key'         => 'selfservice_server-view-wholesale',
3061     'section'     => 'self-service',
3062     'description' => 'If enabled, use a wholesale package view in the self-service.',
3063     'type'        => 'checkbox',
3064   },
3065   
3066   {
3067     'key'         => 'selfservice-agent_signup',
3068     'section'     => 'self-service',
3069     'description' => 'Allow agent signup via self-service.',
3070     'type'        => 'checkbox',
3071   },
3072
3073   {
3074     'key'         => 'selfservice-agent_signup-agent_type',
3075     'section'     => 'self-service',
3076     'description' => 'Agent type when allowing agent signup via self-service.',
3077     'type'        => 'select-sub',
3078     'options_sub' => sub { require FS::Record;
3079                            require FS::agent_type;
3080                            map { $_->typenum => $_->atype }
3081                                FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
3082                          },
3083     'option_sub'  => sub { require FS::Record;
3084                            require FS::agent_type;
3085                            my $agent_type = FS::Record::qsearchs(
3086                              'agent_type', { 'typenum'=>shift }
3087                            );
3088                            $agent_type ? $agent_type->atype : '';
3089                          },
3090   },
3091
3092   {
3093     'key'         => 'selfservice-agent_login',
3094     'section'     => 'self-service',
3095     'description' => 'Allow agent login via self-service.',
3096     'type'        => 'checkbox',
3097   },
3098
3099   {
3100     'key'         => 'selfservice-self_suspend_reason',
3101     'section'     => 'self-service',
3102     'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
3103     'type'        => 'select-sub',
3104     #false laziness w/api_credit_reason
3105     'options_sub' => sub { require FS::Record;
3106                            require FS::reason;
3107                            my $type = qsearchs('reason_type', 
3108                              { class => 'S' }) 
3109                               or return ();
3110                            map { $_->reasonnum => $_->reason }
3111                                FS::Record::qsearch('reason', 
3112                                  { reason_type => $type->typenum } 
3113                                );
3114                          },
3115     'option_sub'  => sub { require FS::Record;
3116                            require FS::reason;
3117                            my $reason = FS::Record::qsearchs(
3118                              'reason', { 'reasonnum' => shift }
3119                            );
3120                            $reason ? $reason->reason : '';
3121                          },
3122
3123     'per_agent'   => 1,
3124   },
3125
3126   {
3127     'key'         => 'card_refund-days',
3128     'section'     => 'billing',
3129     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
3130     'type'        => 'text',
3131   },
3132
3133   {
3134     'key'         => 'agent-showpasswords',
3135     'section'     => '',
3136     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
3137     'type'        => 'checkbox',
3138   },
3139
3140   {
3141     'key'         => 'global_unique-username',
3142     'section'     => 'username',
3143     '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.',
3144     'type'        => 'select',
3145     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
3146   },
3147
3148   {
3149     'key'         => 'global_unique-phonenum',
3150     'section'     => '',
3151     '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.',
3152     'type'        => 'select',
3153     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
3154   },
3155
3156   {
3157     'key'         => 'global_unique-pbx_title',
3158     'section'     => '',
3159     'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
3160     'type'        => 'select',
3161     'select_enum' => [ 'enabled', 'disabled' ],
3162   },
3163
3164   {
3165     'key'         => 'global_unique-pbx_id',
3166     'section'     => '',
3167     'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
3168     'type'        => 'select',
3169     'select_enum' => [ 'enabled', 'disabled' ],
3170   },
3171
3172   {
3173     'key'         => 'svc_external-skip_manual',
3174     'section'     => 'UI',
3175     '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).',
3176     'type'        => 'checkbox',
3177   },
3178
3179   {
3180     'key'         => 'svc_external-display_type',
3181     'section'     => 'UI',
3182     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
3183     'type'        => 'select',
3184     'select_enum' => [ 'generic', 'artera_turbo', ],
3185   },
3186
3187   {
3188     'key'         => 'ticket_system',
3189     'section'     => 'ticketing',
3190     '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).',
3191     'type'        => 'select',
3192     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
3193     'select_enum' => [ '', qw(RT_Internal RT_External) ],
3194   },
3195
3196   {
3197     'key'         => 'network_monitoring_system',
3198     'section'     => 'network_monitoring',
3199     '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>).',
3200     'type'        => 'select',
3201     'select_enum' => [ '', qw(Torrus_Internal) ],
3202   },
3203
3204   {
3205     'key'         => 'nms-auto_add-svc_ips',
3206     'section'     => 'network_monitoring',
3207     'description' => 'Automatically add (and remove) IP addresses from these service tables to the network monitoring system.',
3208     'type'        => 'selectmultiple',
3209     'select_enum' => [ 'svc_acct', 'svc_broadband', 'svc_dsl' ],
3210   },
3211
3212   {
3213     'key'         => 'nms-auto_add-community',
3214     'section'     => 'network_monitoring',
3215     'description' => 'SNMP community string to use when automatically adding IP addresses from these services to the network monitoring system.',
3216     'type'        => 'text',
3217   },
3218
3219   {
3220     'key'         => 'ticket_system-default_queueid',
3221     'section'     => 'ticketing',
3222     'description' => 'Default queue used when creating new customer tickets.',
3223     'type'        => 'select-sub',
3224     'options_sub' => sub {
3225                            my $conf = new FS::Conf;
3226                            if ( $conf->config('ticket_system') ) {
3227                              eval "use FS::TicketSystem;";
3228                              die $@ if $@;
3229                              FS::TicketSystem->queues();
3230                            } else {
3231                              ();
3232                            }
3233                          },
3234     'option_sub'  => sub { 
3235                            my $conf = new FS::Conf;
3236                            if ( $conf->config('ticket_system') ) {
3237                              eval "use FS::TicketSystem;";
3238                              die $@ if $@;
3239                              FS::TicketSystem->queue(shift);
3240                            } else {
3241                              '';
3242                            }
3243                          },
3244   },
3245   {
3246     'key'         => 'ticket_system-force_default_queueid',
3247     'section'     => 'ticketing',
3248     'description' => 'Disallow queue selection when creating new tickets from customer view.',
3249     'type'        => 'checkbox',
3250   },
3251   {
3252     'key'         => 'ticket_system-selfservice_queueid',
3253     'section'     => 'ticketing',
3254     'description' => 'Queue used when creating new customer tickets from self-service.  Defautls to ticket_system-default_queueid if not specified.',
3255     #false laziness w/above
3256     'type'        => 'select-sub',
3257     'options_sub' => sub {
3258                            my $conf = new FS::Conf;
3259                            if ( $conf->config('ticket_system') ) {
3260                              eval "use FS::TicketSystem;";
3261                              die $@ if $@;
3262                              FS::TicketSystem->queues();
3263                            } else {
3264                              ();
3265                            }
3266                          },
3267     'option_sub'  => sub { 
3268                            my $conf = new FS::Conf;
3269                            if ( $conf->config('ticket_system') ) {
3270                              eval "use FS::TicketSystem;";
3271                              die $@ if $@;
3272                              FS::TicketSystem->queue(shift);
3273                            } else {
3274                              '';
3275                            }
3276                          },
3277   },
3278
3279   {
3280     'key'         => 'ticket_system-requestor',
3281     'section'     => 'ticketing',
3282     'description' => 'Email address to use as the requestor for new tickets.  If blank, the customer\'s invoicing address(es) will be used.',
3283     'type'        => 'text',
3284   },
3285
3286   {
3287     'key'         => 'ticket_system-priority_reverse',
3288     'section'     => 'ticketing',
3289     '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.',
3290     'type'        => 'checkbox',
3291   },
3292
3293   {
3294     'key'         => 'ticket_system-custom_priority_field',
3295     'section'     => 'ticketing',
3296     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
3297     'type'        => 'text',
3298   },
3299
3300   {
3301     'key'         => 'ticket_system-custom_priority_field-values',
3302     'section'     => 'ticketing',
3303     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
3304     'type'        => 'textarea',
3305   },
3306
3307   {
3308     'key'         => 'ticket_system-custom_priority_field_queue',
3309     'section'     => 'ticketing',
3310     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
3311     'type'        => 'text',
3312   },
3313
3314   {
3315     'key'         => 'ticket_system-selfservice_priority_field',
3316     'section'     => 'ticketing',
3317     'description' => 'Custom field from the ticket system to use as a customer-managed priority field.',
3318     'type'        => 'text',
3319   },
3320
3321   {
3322     'key'         => 'ticket_system-selfservice_edit_subject',
3323     'section'     => 'ticketing',
3324     'description' => 'Allow customers to edit ticket subjects through selfservice.',
3325     'type'        => 'checkbox',
3326   },
3327
3328   {
3329     'key'         => 'ticket_system-escalation',
3330     'section'     => 'ticketing',
3331     'description' => 'Enable priority escalation of tickets as part of daily batch processing.',
3332     'type'        => 'checkbox',
3333   },
3334
3335   {
3336     'key'         => 'ticket_system-rt_external_datasrc',
3337     'section'     => 'ticketing',
3338     '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>',
3339     'type'        => 'text',
3340
3341   },
3342
3343   {
3344     'key'         => 'ticket_system-rt_external_url',
3345     'section'     => 'ticketing',
3346     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
3347     'type'        => 'text',
3348   },
3349
3350   {
3351     'key'         => 'company_name',
3352     'section'     => 'required',
3353     'description' => 'Your company name',
3354     'type'        => 'text',
3355     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
3356   },
3357
3358   {
3359     'key'         => 'company_url',
3360     'section'     => 'UI',
3361     'description' => 'Your company URL',
3362     'type'        => 'text',
3363     'per_agent'   => 1,
3364   },
3365
3366   {
3367     'key'         => 'company_address',
3368     'section'     => 'required',
3369     'description' => 'Your company address',
3370     'type'        => 'textarea',
3371     'per_agent'   => 1,
3372   },
3373
3374   {
3375     'key'         => 'company_phonenum',
3376     'section'     => 'notification',
3377     'description' => 'Your company phone number',
3378     'type'        => 'text',
3379     'per_agent'   => 1,
3380   },
3381
3382   {
3383     'key'         => 'city_not_required',
3384     'section'     => 'required',
3385     'description' => 'Turn off requirement for a City to be entered for billing & shipping addresses',
3386     'type'        => 'checkbox',
3387     'per_agent'   => 1,
3388   },
3389
3390   {
3391     'key'         => 'echeck-void',
3392     'section'     => 'deprecated',
3393     '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',
3394     'type'        => 'checkbox',
3395   },
3396
3397   {
3398     'key'         => 'cc-void',
3399     'section'     => 'deprecated',
3400     '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',
3401     'type'        => 'checkbox',
3402   },
3403
3404   {
3405     'key'         => 'unvoid',
3406     'section'     => 'deprecated',
3407     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
3408     'type'        => 'checkbox',
3409   },
3410
3411   {
3412     'key'         => 'address1-search',
3413     'section'     => 'UI',
3414     '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.',
3415     'type'        => 'checkbox',
3416   },
3417
3418   {
3419     'key'         => 'address2-search',
3420     'section'     => 'UI',
3421     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
3422     'type'        => 'checkbox',
3423   },
3424
3425   {
3426     'key'         => 'cust_main-require_address2',
3427     'section'     => 'UI',
3428     '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',
3429     'type'        => 'checkbox',
3430   },
3431
3432   {
3433     'key'         => 'agent-ship_address',
3434     'section'     => '',
3435     '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.",
3436     'type'        => 'checkbox',
3437     'per_agent'   => 1,
3438   },
3439
3440   { 'key'         => 'referral_credit',
3441     'section'     => 'deprecated',
3442     '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.",
3443     'type'        => 'checkbox',
3444   },
3445
3446   { 'key'         => 'selfservice_server-cache_module',
3447     'section'     => 'self-service',
3448     '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.',
3449     'type'        => 'select',
3450     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
3451   },
3452
3453   {
3454     'key'         => 'hylafax',
3455     'section'     => 'billing',
3456     '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).',
3457     'type'        => [qw( checkbox textarea )],
3458   },
3459
3460   {
3461     'key'         => 'cust_bill-ftpformat',
3462     'section'     => 'invoicing',
3463     'description' => 'Enable FTP of raw invoice data - format.',
3464     'type'        => 'select',
3465     'options'     => [ spool_formats() ],
3466   },
3467
3468   {
3469     'key'         => 'cust_bill-ftpserver',
3470     'section'     => 'invoicing',
3471     'description' => 'Enable FTP of raw invoice data - server.',
3472     'type'        => 'text',
3473   },
3474
3475   {
3476     'key'         => 'cust_bill-ftpusername',
3477     'section'     => 'invoicing',
3478     'description' => 'Enable FTP of raw invoice data - server.',
3479     'type'        => 'text',
3480   },
3481
3482   {
3483     'key'         => 'cust_bill-ftppassword',
3484     'section'     => 'invoicing',
3485     'description' => 'Enable FTP of raw invoice data - server.',
3486     'type'        => 'text',
3487   },
3488
3489   {
3490     'key'         => 'cust_bill-ftpdir',
3491     'section'     => 'invoicing',
3492     'description' => 'Enable FTP of raw invoice data - server.',
3493     'type'        => 'text',
3494   },
3495
3496   {
3497     'key'         => 'cust_bill-spoolformat',
3498     'section'     => 'invoicing',
3499     'description' => 'Enable spooling of raw invoice data - format.',
3500     'type'        => 'select',
3501     'options'     => [ spool_formats() ],
3502   },
3503
3504   {
3505     'key'         => 'cust_bill-spoolagent',
3506     'section'     => 'invoicing',
3507     'description' => 'Enable per-agent spooling of raw invoice data.',
3508     'type'        => 'checkbox',
3509   },
3510
3511   {
3512     'key'         => 'bridgestone-batch_counter',
3513     'section'     => '',
3514     'description' => 'Batch counter for spool files.  Increments every time a spool file is uploaded.',
3515     'type'        => 'text',
3516     'per_agent'   => 1,
3517   },
3518
3519   {
3520     'key'         => 'bridgestone-prefix',
3521     'section'     => '',
3522     'description' => 'Agent identifier for uploading to BABT printing service.',
3523     'type'        => 'text',
3524     'per_agent'   => 1,
3525   },
3526
3527   {
3528     'key'         => 'bridgestone-confirm_template',
3529     'section'     => '',
3530     '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.',
3531     # this could use a true message template, but it's hard to see how that
3532     # would make the world a better place
3533     'type'        => 'textarea',
3534     'per_agent'   => 1,
3535   },
3536
3537   {
3538     'key'         => 'ics-confirm_template',
3539     'section'     => '',
3540     'description' => 'Confirmation email template for uploading to ICS invoice printing.  Text::Template format, with variables "%count" and "%sum".',
3541     'type'        => 'textarea',
3542     'per_agent'   => 1,
3543   },
3544
3545   {
3546     'key'         => 'svc_acct-usage_suspend',
3547     'section'     => 'billing',
3548     '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.',
3549     'type'        => 'checkbox',
3550   },
3551
3552   {
3553     'key'         => 'svc_acct-usage_unsuspend',
3554     'section'     => 'billing',
3555     '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.',
3556     'type'        => 'checkbox',
3557   },
3558
3559   {
3560     'key'         => 'svc_acct-usage_threshold',
3561     'section'     => 'billing',
3562     '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.',
3563     'type'        => 'text',
3564   },
3565
3566   {
3567     'key'         => 'overlimit_groups',
3568     'section'     => '',
3569     'description' => 'RADIUS group(s) to assign to svc_acct which has exceeded its bandwidth or time limit.',
3570     'type'        => 'select-sub',
3571     'per_agent'   => 1,
3572     'multiple'    => 1,
3573     'options_sub' => sub { require FS::Record;
3574                            require FS::radius_group;
3575                            map { $_->groupnum => $_->long_description }
3576                                FS::Record::qsearch('radius_group', {} );
3577                          },
3578     'option_sub'  => sub { require FS::Record;
3579                            require FS::radius_group;
3580                            my $radius_group = FS::Record::qsearchs(
3581                              'radius_group', { 'groupnum' => shift }
3582                            );
3583                $radius_group ? $radius_group->long_description : '';
3584                          },
3585   },
3586
3587   {
3588     'key'         => 'cust-fields',
3589     'section'     => 'UI',
3590     'description' => 'Which customer fields to display on reports by default',
3591     'type'        => 'select',
3592     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
3593   },
3594
3595   {
3596     'key'         => 'cust_location-label_prefix',
3597     'section'     => 'UI',
3598     'description' => 'Optional "site ID" to show in the location label',
3599     'type'        => 'select',
3600     'select_hash' => [ '' => '',
3601                        'CoStAg'    => 'CoStAgXXXXX (country, state, agent name, locationnum)',
3602                        '_location' => 'Manually defined per location',
3603                       ],
3604   },
3605
3606   {
3607     'key'         => 'cust_pkg-display_times',
3608     'section'     => 'UI',
3609     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
3610     'type'        => 'checkbox',
3611   },
3612
3613   {
3614     'key'         => 'cust_pkg-always_show_location',
3615     'section'     => 'UI',
3616     'description' => "Always display package locations, even when they're all the default service address.",
3617     'type'        => 'checkbox',
3618   },
3619
3620   {
3621     'key'         => 'cust_pkg-group_by_location',
3622     'section'     => 'UI',
3623     'description' => "Group packages by location.",
3624     'type'        => 'checkbox',
3625   },
3626
3627   {
3628     'key'         => 'cust_pkg-large_pkg_size',
3629     'section'     => 'UI',
3630     'description' => "In customer view, summarize packages with more than this many services.  Set to zero to never summarize packages.",
3631     'type'        => 'text',
3632   },
3633
3634   {
3635     'key'         => 'cust_pkg-hide_discontinued-part_svc',
3636     'section'     => 'UI',
3637     '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.",
3638     'type'        => 'checkbox',
3639   },
3640
3641   {
3642     'key'         => 'part_pkg-show_fcc_options',
3643     'section'     => 'UI',
3644     'description' => "Show fields on package definitions for FCC Form 477 classification",
3645     'type'        => 'checkbox',
3646   },
3647
3648   {
3649     'key'         => 'svc_acct-edit_uid',
3650     'section'     => 'shell',
3651     'description' => 'Allow UID editing.',
3652     'type'        => 'checkbox',
3653   },
3654
3655   {
3656     'key'         => 'svc_acct-edit_gid',
3657     'section'     => 'shell',
3658     'description' => 'Allow GID editing.',
3659     'type'        => 'checkbox',
3660   },
3661
3662   {
3663     'key'         => 'svc_acct-no_edit_username',
3664     'section'     => 'shell',
3665     'description' => 'Disallow username editing.',
3666     'type'        => 'checkbox',
3667   },
3668
3669   {
3670     'key'         => 'zone-underscore',
3671     'section'     => 'BIND',
3672     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
3673     'type'        => 'checkbox',
3674   },
3675
3676   {
3677     'key'         => 'echeck-country',
3678     'section'     => 'billing',
3679     'description' => 'Format electronic check information for the specified country.',
3680     'type'        => 'select',
3681     'select_hash' => [ 'US' => 'United States',
3682                        'CA' => 'Canada (enables branch)',
3683                        'XX' => 'Other',
3684                      ],
3685   },
3686
3687   {
3688     'key'         => 'voip-cust_accountcode_cdr',
3689     'section'     => 'telephony',
3690     'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
3691     'type'        => 'checkbox',
3692   },
3693
3694   {
3695     'key'         => 'voip-cust_cdr_spools',
3696     'section'     => 'telephony',
3697     'description' => 'Enable the per-customer option for individual CDR spools.',
3698     'type'        => 'checkbox',
3699   },
3700
3701   {
3702     'key'         => 'voip-cust_cdr_squelch',
3703     'section'     => 'telephony',
3704     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
3705     'type'        => 'checkbox',
3706   },
3707
3708   {
3709     'key'         => 'voip-cdr_email',
3710     'section'     => 'telephony',
3711     '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.',
3712     'type'        => 'checkbox',
3713   },
3714
3715   {
3716     'key'         => 'voip-cust_email_csv_cdr',
3717     'section'     => 'telephony',
3718     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
3719     'type'        => 'checkbox',
3720   },
3721
3722   {
3723     'key'         => 'cgp_rule-domain_templates',
3724     'section'     => '',
3725     'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
3726     'type'        => 'textarea',
3727   },
3728
3729   {
3730     'key'         => 'svc_forward-no_srcsvc',
3731     'section'     => '',
3732     '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.",
3733     'type'        => 'checkbox',
3734   },
3735
3736   {
3737     'key'         => 'svc_forward-arbitrary_dst',
3738     'section'     => '',
3739     '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.",
3740     'type'        => 'checkbox',
3741   },
3742
3743   {
3744     'key'         => 'tax-ship_address',
3745     'section'     => 'taxation',
3746     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
3747     'type'        => 'checkbox',
3748   }
3749 ,
3750   {
3751     'key'         => 'tax-pkg_address',
3752     'section'     => 'taxation',
3753     '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).',
3754     'type'        => 'checkbox',
3755   },
3756
3757   {
3758     'key'         => 'invoice-ship_address',
3759     'section'     => 'invoicing',
3760     'description' => 'Include the shipping address on invoices.',
3761     'type'        => 'checkbox',
3762   },
3763
3764   {
3765     'key'         => 'invoice-unitprice',
3766     'section'     => 'invoicing',
3767     'description' => 'Enable unit pricing on invoices and quantities on packages.',
3768     'type'        => 'checkbox',
3769   },
3770
3771   {
3772     'key'         => 'invoice-smallernotes',
3773     'section'     => 'invoicing',
3774     'description' => 'Display the notes section in a smaller font on invoices.',
3775     'type'        => 'checkbox',
3776   },
3777
3778   {
3779     'key'         => 'invoice-smallerfooter',
3780     'section'     => 'invoicing',
3781     'description' => 'Display footers in a smaller font on invoices.',
3782     'type'        => 'checkbox',
3783   },
3784
3785   {
3786     'key'         => 'postal_invoice-fee_pkgpart',
3787     'section'     => 'billing',
3788     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
3789     'type'        => 'select-part_pkg',
3790     'per_agent'   => 1,
3791   },
3792
3793   {
3794     'key'         => 'postal_invoice-recurring_only',
3795     'section'     => 'billing',
3796     'description' => 'The postal invoice fee is omitted on invoices without recurring charges when this is set.',
3797     'type'        => 'checkbox',
3798   },
3799
3800   {
3801     'key'         => 'batch-enable',
3802     'section'     => 'deprecated', #make sure batch-enable_payby is set for
3803                                    #everyone before removing
3804     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
3805     'type'        => 'checkbox',
3806   },
3807
3808   {
3809     'key'         => 'batch-enable_payby',
3810     'section'     => 'billing',
3811     'description' => 'Enable batch processing for the specified payment types.',
3812     'type'        => 'selectmultiple',
3813     'select_enum' => [qw( CARD CHEK )],
3814   },
3815
3816   {
3817     'key'         => 'realtime-disable_payby',
3818     'section'     => 'billing',
3819     'description' => 'Disable realtime processing for the specified payment types.',
3820     'type'        => 'selectmultiple',
3821     'select_enum' => [qw( CARD CHEK )],
3822   },
3823
3824   {
3825     'key'         => 'batch-default_format',
3826     'section'     => 'billing',
3827     'description' => 'Default format for batches.',
3828     'type'        => 'select',
3829     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch',
3830                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
3831                        'paymentech', 'ach-spiritone', 'RBC', 'CIBC',
3832                     ]
3833   },
3834
3835   { 'key'         => 'batch-gateway-CARD',
3836     'section'     => 'billing',
3837     'description' => 'Business::BatchPayment gateway for credit card batches.',
3838     %batch_gateway_options,
3839   },
3840
3841   { 'key'         => 'batch-gateway-CHEK',
3842     'section'     => 'billing', 
3843     'description' => 'Business::BatchPayment gateway for check batches.',
3844     %batch_gateway_options,
3845   },
3846
3847   {
3848     'key'         => 'batch-reconsider',
3849     'section'     => 'billing',
3850     '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.',
3851     'type'        => 'checkbox',
3852   },
3853
3854   {
3855     'key'         => 'batch-auto_resolve_days',
3856     'section'     => 'billing',
3857     'description' => 'Automatically resolve payment batches this many days after they were first downloaded.',
3858     'type'        => 'text',
3859   },
3860
3861   {
3862     'key'         => 'batch-auto_resolve_status',
3863     'section'     => 'billing',
3864     'description' => 'When automatically resolving payment batches, take this action for payments of unknown status.',
3865     'type'        => 'select',
3866     'select_enum' => [ 'approve', 'decline' ],
3867   },
3868
3869   {
3870     'key'         => 'batch-errors_to',
3871     'section'     => 'billing',
3872     'description' => 'Email errors when processing batches to this address.  If unspecified, batch processing will stop immediately on error.',
3873     'type'        => 'text',
3874   },
3875
3876   #lists could be auto-generated from pay_batch info
3877   {
3878     'key'         => 'batch-fixed_format-CARD',
3879     'section'     => 'billing',
3880     'description' => 'Fixed (unchangeable) format for credit card batches.',
3881     'type'        => 'select',
3882     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
3883                        'csv-chase_canada-E-xactBatch', 'paymentech' ]
3884   },
3885
3886   {
3887     'key'         => 'batch-fixed_format-CHEK',
3888     'section'     => 'billing',
3889     'description' => 'Fixed (unchangeable) format for electronic check batches.',
3890     'type'        => 'select',
3891     'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch', 'BoM',
3892                        'PAP', 'paymentech', 'ach-spiritone', 'RBC',
3893                        'td_eft1464', 'eft_canada', 'CIBC'
3894                      ]
3895   },
3896
3897   {
3898     'key'         => 'batch-increment_expiration',
3899     'section'     => 'billing',
3900     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
3901     'type'        => 'checkbox'
3902   },
3903
3904   {
3905     'key'         => 'batchconfig-BoM',
3906     'section'     => 'billing',
3907     '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',
3908     'type'        => 'textarea',
3909   },
3910
3911 {
3912     'key'         => 'batchconfig-CIBC',
3913     'section'     => 'billing',
3914     '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',
3915     'type'        => 'textarea',
3916   },
3917
3918   {
3919     'key'         => 'batchconfig-PAP',
3920     'section'     => 'billing',
3921     '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',
3922     'type'        => 'textarea',
3923   },
3924
3925   {
3926     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
3927     'section'     => 'billing',
3928     'description' => 'Gateway ID for Chase Canada E-xact batching',
3929     'type'        => 'text',
3930   },
3931
3932   {
3933     'key'         => 'batchconfig-paymentech',
3934     'section'     => 'billing',
3935     '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.',
3936     'type'        => 'textarea',
3937   },
3938
3939   {
3940     'key'         => 'batchconfig-RBC',
3941     'section'     => 'billing',
3942     '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.',
3943     'type'        => 'textarea',
3944   },
3945
3946   {
3947     'key'         => 'batchconfig-td_eft1464',
3948     'section'     => 'billing',
3949     '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.',
3950     'type'        => 'textarea',
3951   },
3952
3953   {
3954     'key'         => 'batchconfig-eft_canada',
3955     'section'     => 'billing',
3956     '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.',
3957     'type'        => 'textarea',
3958     'per_agent'   => 1,
3959   },
3960
3961   {
3962     'key'         => 'batchconfig-nacha-destination',
3963     'section'     => 'billing',
3964     'description' => 'Configuration for NACHA batching, Destination (9 digit transit routing number).',
3965     'type'        => 'text',
3966   },
3967
3968   {
3969     'key'         => 'batchconfig-nacha-destination_name',
3970     'section'     => 'billing',
3971     'description' => 'Configuration for NACHA batching, Destination (Bank Name, up to 23 characters).',
3972     'type'        => 'text',
3973   },
3974
3975   {
3976     'key'         => 'batchconfig-nacha-origin',
3977     'section'     => 'billing',
3978     'description' => 'Configuration for NACHA batching, Origin (your 10-digit company number, IRS tax ID recommended).',
3979     'type'        => 'text',
3980   },
3981
3982   {
3983     'key'         => 'batch-manual_approval',
3984     'section'     => 'billing',
3985     '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.',
3986     'type'        => 'checkbox',
3987   },
3988
3989   {
3990     'key'         => 'batch-spoolagent',
3991     'section'     => 'billing',
3992     'description' => 'Store payment batches per-agent.',
3993     'type'        => 'checkbox',
3994   },
3995
3996   {
3997     'key'         => 'payment_history-years',
3998     'section'     => 'UI',
3999     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
4000     'type'        => 'text',
4001   },
4002
4003   {
4004     'key'         => 'change_history-years',
4005     'section'     => 'UI',
4006     'description' => 'Number of years of change history to show by default.  Currently defaults to 0.5.',
4007     'type'        => 'text',
4008   },
4009
4010   {
4011     'key'         => 'cust_main-packages-years',
4012     'section'     => 'UI',
4013     'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
4014     'type'        => 'text',
4015   },
4016
4017   {
4018     'key'         => 'cust_main-use_comments',
4019     'section'     => 'UI',
4020     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
4021     'type'        => 'checkbox',
4022   },
4023
4024   {
4025     'key'         => 'cust_main-disable_notes',
4026     'section'     => 'UI',
4027     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
4028     'type'        => 'checkbox',
4029   },
4030
4031   {
4032     'key'         => 'cust_main_note-display_times',
4033     'section'     => 'UI',
4034     'description' => 'Display full timestamps (not just dates) for customer notes.',
4035     'type'        => 'checkbox',
4036   },
4037
4038   {
4039     'key'         => 'cust_main-ticket_statuses',
4040     'section'     => 'UI',
4041     'description' => 'Show tickets with these statuses on the customer view page.',
4042     'type'        => 'selectmultiple',
4043     'select_enum' => [qw( new open stalled resolved rejected deleted )],
4044   },
4045
4046   {
4047     'key'         => 'cust_main-max_tickets',
4048     'section'     => 'UI',
4049     'description' => 'Maximum number of tickets to show on the customer view page.',
4050     'type'        => 'text',
4051   },
4052
4053   {
4054     'key'         => 'cust_main-enable_birthdate',
4055     'section'     => 'UI',
4056     'description' => 'Enable tracking of a birth date with each customer record',
4057     'type'        => 'checkbox',
4058   },
4059
4060   {
4061     'key'         => 'cust_main-enable_spouse',
4062     'section'     => 'UI',
4063     'description' => 'Enable tracking of a spouse\'s name and date of birth with each customer record',
4064     'type'        => 'checkbox',
4065   },
4066
4067   {
4068     'key'         => 'cust_main-enable_anniversary_date',
4069     'section'     => 'UI',
4070     'description' => 'Enable tracking of an anniversary date with each customer record',
4071     'type'        => 'checkbox',
4072   },
4073
4074   {
4075     'key'         => 'cust_main-enable_order_package',
4076     'section'     => 'UI',
4077     'description' => 'Display order new package on the basic tab',
4078     'type'        => 'checkbox',
4079   },
4080
4081   {
4082     'key'         => 'cust_main-edit_calling_list_exempt',
4083     'section'     => 'UI',
4084     'description' => 'Display the "calling_list_exempt" checkbox on customer edit.',
4085     'type'        => 'checkbox',
4086   },
4087
4088   {
4089     'key'         => 'support-key',
4090     'section'     => '',
4091     '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.',
4092     'type'        => 'text',
4093   },
4094
4095   {
4096     'key'         => 'card-types',
4097     'section'     => 'billing',
4098     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
4099     'type'        => 'selectmultiple',
4100     'select_enum' => \@card_types,
4101   },
4102
4103   {
4104     'key'         => 'disable-fuzzy',
4105     'section'     => 'UI',
4106     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
4107     'type'        => 'checkbox',
4108   },
4109
4110   {
4111     'key'         => 'fuzzy-fuzziness',
4112     'section'     => 'UI',
4113     'description' => 'Set the "fuzziness" of fuzzy searching (see the String::Approx manpage for details).  Defaults to 10%',
4114     'type'        => 'text',
4115   },
4116
4117   {
4118     'key'         => 'enable_fuzzy_on_exact',
4119     'section'     => 'UI',
4120     'description' => 'Enable approximate customer searching even when an exact match is found.',
4121     'type'        => 'checkbox',
4122   },
4123
4124   { 'key'         => 'pkg_referral',
4125     'section'     => '',
4126     'description' => 'Enable package-specific advertising sources.',
4127     'type'        => 'checkbox',
4128   },
4129
4130   { 'key'         => 'pkg_referral-multiple',
4131     'section'     => '',
4132     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
4133     'type'        => 'checkbox',
4134   },
4135
4136   {
4137     'key'         => 'dashboard-install_welcome',
4138     'section'     => 'UI',
4139     'description' => 'New install welcome screen.',
4140     'type'        => 'select',
4141     'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
4142   },
4143
4144   {
4145     'key'         => 'dashboard-toplist',
4146     'section'     => 'UI',
4147     'description' => 'List of items to display on the top of the front page',
4148     'type'        => 'textarea',
4149   },
4150
4151   {
4152     'key'         => 'impending_recur_msgnum',
4153     'section'     => 'notification',
4154     'description' => 'Template to use for alerts about first-time recurring billing.',
4155     %msg_template_options,
4156   },
4157
4158   {
4159     'key'         => 'impending_recur_template',
4160     'section'     => 'deprecated',
4161     '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>',
4162 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
4163     'type'        => 'textarea',
4164   },
4165
4166   {
4167     'key'         => 'logo.png',
4168     'section'     => 'UI',  #'invoicing' ?
4169     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
4170     'type'        => 'image',
4171     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
4172                         #old-style editor anyway...?
4173     'per_locale'  => 1,
4174   },
4175
4176   {
4177     'key'         => 'logo.eps',
4178     'section'     => 'invoicing',
4179     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
4180     'type'        => 'image',
4181     'per_agent'   => 1, #XXX as above, kinda
4182     'per_locale'  => 1,
4183   },
4184
4185   {
4186     'key'         => 'selfservice-ignore_quantity',
4187     'section'     => 'self-service',
4188     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
4189     'type'        => 'checkbox',
4190   },
4191
4192   {
4193     'key'         => 'selfservice-session_timeout',
4194     'section'     => 'self-service',
4195     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
4196     'type'        => 'select',
4197     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
4198   },
4199
4200   {
4201     'key'         => 'password-generated-allcaps',
4202     'section'     => 'password',
4203     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
4204     'type'        => 'checkbox',
4205   },
4206
4207   {
4208     'key'         => 'datavolume-forcemegabytes',
4209     'section'     => 'UI',
4210     'description' => 'All data volumes are expressed in megabytes',
4211     'type'        => 'checkbox',
4212   },
4213
4214   {
4215     'key'         => 'datavolume-significantdigits',
4216     'section'     => 'UI',
4217     'description' => 'number of significant digits to use to represent data volumes',
4218     'type'        => 'text',
4219   },
4220
4221   {
4222     'key'         => 'disable_void_after',
4223     'section'     => 'billing',
4224     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
4225     'type'        => 'text',
4226   },
4227
4228   {
4229     'key'         => 'disable_line_item_date_ranges',
4230     'section'     => 'billing',
4231     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
4232     'type'        => 'checkbox',
4233   },
4234
4235   {
4236     'key'         => 'cust_bill-line_item-date_style',
4237     'section'     => 'billing',
4238     'description' => 'Display format for line item date ranges on invoice line items.',
4239     'type'        => 'select',
4240     'select_hash' => [ ''           => 'STARTDATE-ENDDATE',
4241                        'month_of'   => 'Month of MONTHNAME',
4242                        'X_month'    => 'DATE_DESC MONTHNAME',
4243                      ],
4244     'per_agent'   => 1,
4245   },
4246
4247   {
4248     'key'         => 'cust_bill-line_item-date_style-non_monthly',
4249     'section'     => 'billing',
4250     'description' => 'If set, override cust_bill-line_item-date_style for non-monthly charges.',
4251     'type'        => 'select',
4252     'select_hash' => [ ''           => 'Default',
4253                        'start_end'  => 'STARTDATE-ENDDATE',
4254                        'month_of'   => 'Month of MONTHNAME',
4255                        'X_month'    => 'DATE_DESC MONTHNAME',
4256                      ],
4257     'per_agent'   => 1,
4258   },
4259
4260   {
4261     'key'         => 'cust_bill-line_item-date_description',
4262     'section'     => 'billing',
4263     'description' => 'Text to display for "DATE_DESC" when using cust_bill-line_item-date_style DATE_DESC MONTHNAME.',
4264     'type'        => 'text',
4265     'per_agent'   => 1,
4266   },
4267
4268   {
4269     'key'         => 'support_packages',
4270     'section'     => '',
4271     '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...
4272     'type'        => 'select-part_pkg',
4273     'multiple'    => 1,
4274   },
4275
4276   {
4277     'key'         => 'cust_main-require_phone',
4278     'section'     => '',
4279     'description' => 'Require daytime or night phone for all customer records.',
4280     'type'        => 'checkbox',
4281     'per_agent'   => 1,
4282   },
4283
4284   {
4285     'key'         => 'cust_main-require_invoicing_list_email',
4286     'section'     => '',
4287     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
4288     'type'        => 'checkbox',
4289     'per_agent'   => 1,
4290   },
4291
4292   {
4293     'key'         => 'cust_main-check_unique',
4294     'section'     => '',
4295     'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
4296     'type'        => 'select',
4297     'multiple'    => 1,
4298     'select_hash' => [ 
4299       'address' => 'Billing or service address',
4300     ],
4301   },
4302
4303   {
4304     'key'         => 'svc_acct-display_paid_time_remaining',
4305     'section'     => '',
4306     'description' => 'Show paid time remaining in addition to time remaining.',
4307     'type'        => 'checkbox',
4308   },
4309
4310   {
4311     'key'         => 'cancel_credit_type',
4312     'section'     => 'billing',
4313     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
4314     reason_type_options('R'),
4315   },
4316
4317   {
4318     'key'         => 'suspend_credit_type',
4319     'section'     => 'billing',
4320     'description' => 'The group to use for new, automatically generated credit reasons resulting from package suspension.',
4321     reason_type_options('R'),
4322   },
4323
4324   {
4325     'key'         => 'referral_credit_type',
4326     'section'     => 'deprecated',
4327     '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.',
4328     reason_type_options('R'),
4329   },
4330
4331   {
4332     'key'         => 'signup_credit_type',
4333     'section'     => 'billing', #self-service?
4334     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
4335     reason_type_options('R'),
4336   },
4337
4338   {
4339     'key'         => 'prepayment_discounts-credit_type',
4340     'section'     => 'billing',
4341     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
4342     reason_type_options('R'),
4343   },
4344
4345   {
4346     'key'         => 'cust_main-agent_custid-format',
4347     'section'     => '',
4348     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
4349     'type'        => 'select',
4350     'select_hash' => [
4351                        ''       => 'Numeric only',
4352                        '\d{7}'  => 'Numeric only, exactly 7 digits',
4353                        'ww?d+'  => 'Numeric with one or two letter prefix',
4354                      ],
4355   },
4356
4357   {
4358     'key'         => 'card_masking_method',
4359     'section'     => 'UI',
4360     '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.',
4361     'type'        => 'select',
4362     'select_hash' => [
4363                        ''            => '123456xxxxxx1234',
4364                        'first6last2' => '123456xxxxxxxx12',
4365                        'first4last4' => '1234xxxxxxxx1234',
4366                        'first4last2' => '1234xxxxxxxxxx12',
4367                        'first2last4' => '12xxxxxxxxxx1234',
4368                        'first2last2' => '12xxxxxxxxxxxx12',
4369                        'first0last4' => 'xxxxxxxxxxxx1234',
4370                        'first0last2' => 'xxxxxxxxxxxxxx12',
4371                      ],
4372   },
4373
4374   {
4375     'key'         => 'disable_previous_balance',
4376     'section'     => 'invoicing',
4377     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices.',
4378     'type'        => 'checkbox',
4379     'per_agent'   => 1,
4380   },
4381
4382   {
4383     'key'         => 'previous_balance-exclude_from_total',
4384     'section'     => 'invoicing',
4385     'description' => 'Show separate totals for previous invoice balance and new charges. Only meaningful when invoice_sections is false.',
4386     'type'        => 'checkbox',
4387   },
4388
4389   {
4390     'key'         => 'previous_balance-text',
4391     'section'     => 'invoicing',
4392     'description' => 'Text for the label of the total previous balance, when it is shown separately. Defaults to "Previous Balance".',
4393     'type'        => 'text',
4394   },
4395
4396   {
4397     'key'         => 'previous_balance-text-total_new_charges',
4398     'section'     => 'invoicing',
4399     '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".',
4400     'type'        => 'text',
4401   },
4402
4403   {
4404     'key'         => 'previous_balance-section',
4405     'section'     => 'invoicing',
4406     'description' => 'Show previous invoice balances in a separate invoice section.  Does not require invoice_sections to be enabled.',
4407     'type'        => 'checkbox',
4408   },
4409
4410   {
4411     'key'         => 'previous_balance-summary_only',
4412     'section'     => 'invoicing',
4413     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
4414     'type'        => 'checkbox',
4415   },
4416
4417   {
4418     'key'         => 'previous_balance-show_credit',
4419     'section'     => 'invoicing',
4420     'description' => 'Show the customer\'s credit balance on invoices when applicable.',
4421     'type'        => 'checkbox',
4422   },
4423
4424   {
4425     'key'         => 'previous_balance-show_on_statements',
4426     'section'     => 'invoicing',
4427     'description' => 'Show previous invoices on statements, without itemized charges.',
4428     'type'        => 'checkbox',
4429   },
4430
4431   {
4432     'key'         => 'previous_balance-payments_since',
4433     'section'     => 'invoicing',
4434     'description' => 'Instead of showing payments (and credits) applied to the invoice, show those received since the previous invoice date.',
4435     'type'        => 'checkbox',
4436                        'uscensus' => 'U.S. Census Bureau',
4437   },
4438
4439   {
4440     'key'         => 'previous_invoice_history',
4441     'section'     => 'invoicing',
4442     'description' => 'Show a month-by-month history of the customer\'s '.
4443                      'billing amounts.  This requires template '.
4444                      'modification and is currently not supported on the '.
4445                      'stock template.',
4446     'type'        => 'checkbox',
4447   },
4448
4449   {
4450     'key'         => 'balance_due_below_line',
4451     'section'     => 'invoicing',
4452     'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
4453     'type'        => 'checkbox',
4454   },
4455
4456   {
4457     'key'         => 'always_show_tax',
4458     'section'     => 'invoicing',
4459     'description' => 'Show a line for tax on the invoice even when the tax is zero.  Optionally provide text for the tax name to show.',
4460     'type'        => [ qw(checkbox text) ],
4461   },
4462
4463   {
4464     'key'         => 'address_standardize_method',
4465     'section'     => 'UI', #???
4466     'description' => 'Method for standardizing customer addresses.',
4467     'type'        => 'select',
4468     'select_hash' => [ '' => '', 
4469                        'usps'     => 'U.S. Postal Service',
4470                        'tomtom'   => 'TomTom',
4471                        'melissa'  => 'Melissa WebSmart',
4472                      ],
4473   },
4474
4475   {
4476     'key'         => 'usps_webtools-userid',
4477     'section'     => 'UI',
4478     '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.',
4479     'type'        => 'text',
4480   },
4481
4482   {
4483     'key'         => 'usps_webtools-password',
4484     'section'     => 'UI',
4485     '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.',
4486     'type'        => 'text',
4487   },
4488
4489   {
4490     'key'         => 'tomtom-userid',
4491     'section'     => 'UI',
4492     '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.',
4493     'type'        => 'text',
4494   },
4495
4496   {
4497     'key'         => 'melissa-userid',
4498     'section'     => 'UI', # it's really not...
4499     'description' => 'User ID for Melissa WebSmart service.  See <a href="http://www.melissadata.com/">the Melissa website</a> for access and pricing.',
4500     'type'        => 'text',
4501   },
4502
4503   {
4504     'key'         => 'melissa-enable_geocoding',
4505     'section'     => 'UI',
4506     'description' => 'Use the Melissa service for census tract and coordinate lookups.  Enable this only if your subscription includes geocoding access.',
4507     'type'        => 'checkbox',
4508   },
4509
4510   {
4511     'key'         => 'cust_main-auto_standardize_address',
4512     'section'     => 'UI',
4513     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
4514     'type'        => 'checkbox',
4515   },
4516
4517   {
4518     'key'         => 'cust_main-require_censustract',
4519     'section'     => 'UI',
4520     'description' => 'Customer is required to have a census tract.  Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
4521     'type'        => 'checkbox',
4522   },
4523
4524   {
4525     'key'         => 'census_year',
4526     'section'     => 'UI',
4527     '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.',
4528     'type'        => 'select',
4529     'select_enum' => [ qw( 2013 2012 2011 ) ],
4530   },
4531
4532   {
4533     'key'         => 'tax_district_method',
4534     'section'     => 'taxation',
4535     'description' => 'The method to use to look up tax district codes.',
4536     'type'        => 'select',
4537     #'select_hash' => [ FS::Misc::Geo::get_district_methods() ],
4538     #after RT#13763, using FS::Misc::Geo here now causes a dependancy loop :/
4539     'select_hash' => [
4540                        ''         => '',
4541                        'wa_sales' => 'Washington sales tax',
4542                      ],
4543   },
4544
4545   {
4546     'key'         => 'company_latitude',
4547     'section'     => 'UI',
4548     'description' => 'Your company latitude (-90 through 90)',
4549     'type'        => 'text',
4550   },
4551
4552   {
4553     'key'         => 'company_longitude',
4554     'section'     => 'UI',
4555     'description' => 'Your company longitude (-180 thru 180)',
4556     'type'        => 'text',
4557   },
4558
4559   {
4560     'key'         => 'geocode_module',
4561     'section'     => '',
4562     'description' => 'Module to geocode (retrieve a latitude and longitude for) addresses',
4563     'type'        => 'select',
4564     'select_enum' => [ 'Geo::Coder::Googlev3' ],
4565   },
4566
4567   {
4568     'key'         => 'geocode-require_nw_coordinates',
4569     'section'     => 'UI',
4570     'description' => 'Require latitude and longitude in the North Western quadrant, e.g. for North American co-ordinates, etc.',
4571     'type'        => 'checkbox',
4572   },
4573
4574   {
4575     'key'         => 'disable_acl_changes',
4576     'section'     => '',
4577     'description' => 'Disable all ACL changes, for demos.',
4578     'type'        => 'checkbox',
4579   },
4580
4581   {
4582     'key'         => 'disable_settings_changes',
4583     'section'     => '',
4584     'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
4585     'type'        => [qw( checkbox text )],
4586   },
4587
4588   {
4589     'key'         => 'cust_main-edit_agent_custid',
4590     'section'     => 'UI',
4591     'description' => 'Enable editing of the agent_custid field.',
4592     'type'        => 'checkbox',
4593   },
4594
4595   {
4596     'key'         => 'cust_main-default_agent_custid',
4597     'section'     => 'UI',
4598     'description' => 'Display the agent_custid field when available instead of the custnum field.',
4599     'type'        => 'checkbox',
4600   },
4601
4602   {
4603     'key'         => 'cust_main-title-display_custnum',
4604     'section'     => 'UI',
4605     'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
4606     'type'        => 'checkbox',
4607   },
4608
4609   {
4610     'key'         => 'cust_bill-default_agent_invid',
4611     'section'     => 'UI',
4612     'description' => 'Display the agent_invid field when available instead of the invnum field.',
4613     'type'        => 'checkbox',
4614   },
4615
4616   {
4617     'key'         => 'cust_main-auto_agent_custid',
4618     'section'     => 'UI',
4619     'description' => 'Automatically assign an agent_custid - select format',
4620     'type'        => 'select',
4621     'select_hash' => [ '' => 'No',
4622                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
4623                      ],
4624   },
4625
4626   {
4627     'key'         => 'cust_main-custnum-display_prefix',
4628     'section'     => 'UI',
4629     'description' => 'Prefix the customer number with this string for display purposes.',
4630     'type'        => 'text',
4631     'per_agent'   => 1,
4632   },
4633
4634   {
4635     'key'         => 'cust_main-custnum-display_special',
4636     'section'     => 'UI',
4637     'description' => 'Use this customer number prefix format',
4638     'type'        => 'select',
4639     'select_hash' => [ '' => '',
4640                        'CoStAg' => 'CoStAg (country, state, agent name or display_prefix)',
4641                        'CoStCl' => 'CoStCl (country, state, class name)' ],
4642   },
4643
4644   {
4645     'key'         => 'cust_main-custnum-display_length',
4646     'section'     => 'UI',
4647     'description' => 'Zero fill the customer number to this many digits for display purposes.',
4648     'type'        => 'text',
4649   },
4650
4651   {
4652     'key'         => 'cust_main-default_areacode',
4653     'section'     => 'UI',
4654     'description' => 'Default area code for customers.',
4655     'type'        => 'text',
4656   },
4657
4658   {
4659     'key'         => 'order_pkg-no_start_date',
4660     'section'     => 'UI',
4661     'description' => 'Don\'t set a default start date for new packages.',
4662     'type'        => 'checkbox',
4663   },
4664
4665   {
4666     'key'         => 'part_pkg-delay_start',
4667     'section'     => '',
4668     'description' => 'Enabled "delayed start" option for packages.',
4669     'type'        => 'checkbox',
4670   },
4671
4672   {
4673     'key'         => 'part_pkg-delay_cancel-days',
4674     'section'     => '',
4675     'description' => 'Expire packages in this many days when using delay_cancel (default is 1)',
4676     'type'        => 'text',
4677     'validate'    => sub { (($_[0] =~ /^\d*$/) && (($_[0] eq '') || $_[0]))
4678                            ? 'Must specify an integer number of days'
4679                            : '' }
4680   },
4681
4682   {
4683     'key'         => 'mcp_svcpart',
4684     'section'     => '',
4685     'description' => 'Master Control Program svcpart.  Leave this blank.',
4686     'type'        => 'text', #select-part_svc
4687   },
4688
4689   {
4690     'key'         => 'cust_bill-max_same_services',
4691     'section'     => 'invoicing',
4692     '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.',
4693     'type'        => 'text',
4694   },
4695
4696   {
4697     'key'         => 'cust_bill-consolidate_services',
4698     'section'     => 'invoicing',
4699     'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
4700     'type'        => 'checkbox',
4701   },
4702
4703   {
4704     'key'         => 'suspend_email_admin',
4705     'section'     => '',
4706     'description' => 'Destination admin email address to enable suspension notices',
4707     'type'        => 'text',
4708   },
4709
4710   {
4711     'key'         => 'unsuspend_email_admin',
4712     'section'     => '',
4713     'description' => 'Destination admin email address to enable unsuspension notices',
4714     'type'        => 'text',
4715   },
4716   
4717   {
4718     'key'         => 'email_report-subject',
4719     'section'     => '',
4720     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
4721     'type'        => 'text',
4722   },
4723
4724   {
4725     'key'         => 'selfservice-head',
4726     'section'     => 'self-service',
4727     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
4728     'type'        => 'textarea', #htmlarea?
4729     'per_agent'   => 1,
4730   },
4731
4732
4733   {
4734     'key'         => 'selfservice-body_header',
4735     'section'     => 'self-service',
4736     'description' => 'HTML header for the self-service interface',
4737     'type'        => 'textarea', #htmlarea?
4738     'per_agent'   => 1,
4739   },
4740
4741   {
4742     'key'         => 'selfservice-body_footer',
4743     'section'     => 'self-service',
4744     'description' => 'HTML footer for the self-service interface',
4745     'type'        => 'textarea', #htmlarea?
4746     'per_agent'   => 1,
4747   },
4748
4749
4750   {
4751     'key'         => 'selfservice-body_bgcolor',
4752     'section'     => 'self-service',
4753     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
4754     'type'        => 'text',
4755     'per_agent'   => 1,
4756   },
4757
4758   {
4759     'key'         => 'selfservice-box_bgcolor',
4760     'section'     => 'self-service',
4761     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
4762     'type'        => 'text',
4763     'per_agent'   => 1,
4764   },
4765
4766   {
4767     'key'         => 'selfservice-stripe1_bgcolor',
4768     'section'     => 'self-service',
4769     'description' => 'HTML color for self-service interface lists (primary stripe), for example, #FFFFFF',
4770     'type'        => 'text',
4771     'per_agent'   => 1,
4772   },
4773
4774   {
4775     'key'         => 'selfservice-stripe2_bgcolor',
4776     'section'     => 'self-service',
4777     'description' => 'HTML color for self-service interface lists (alternate stripe), for example, #DDDDDD',
4778     'type'        => 'text',
4779     'per_agent'   => 1,
4780   },
4781
4782   {
4783     'key'         => 'selfservice-text_color',
4784     'section'     => 'self-service',
4785     'description' => 'HTML text color for the self-service interface, for example, #000000',
4786     'type'        => 'text',
4787     'per_agent'   => 1,
4788   },
4789
4790   {
4791     'key'         => 'selfservice-link_color',
4792     'section'     => 'self-service',
4793     'description' => 'HTML link color for the self-service interface, for example, #0000FF',
4794     'type'        => 'text',
4795     'per_agent'   => 1,
4796   },
4797
4798   {
4799     'key'         => 'selfservice-vlink_color',
4800     'section'     => 'self-service',
4801     'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
4802     'type'        => 'text',
4803     'per_agent'   => 1,
4804   },
4805
4806   {
4807     'key'         => 'selfservice-hlink_color',
4808     'section'     => 'self-service',
4809     'description' => 'HTML hover link color for the self-service interface, for example, #808080',
4810     'type'        => 'text',
4811     'per_agent'   => 1,
4812   },
4813
4814   {
4815     'key'         => 'selfservice-alink_color',
4816     'section'     => 'self-service',
4817     'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
4818     'type'        => 'text',
4819     'per_agent'   => 1,
4820   },
4821
4822   {
4823     'key'         => 'selfservice-font',
4824     'section'     => 'self-service',
4825     'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
4826     'type'        => 'text',
4827     'per_agent'   => 1,
4828   },
4829
4830   {
4831     'key'         => 'selfservice-no_logo',
4832     'section'     => 'self-service',
4833     'description' => 'Disable the logo in self-service',
4834     'type'        => 'checkbox',
4835     'per_agent'   => 1,
4836   },
4837
4838   {
4839     'key'         => 'selfservice-title_color',
4840     'section'     => 'self-service',
4841     'description' => 'HTML color for the self-service title, for example, #000000',
4842     'type'        => 'text',
4843     'per_agent'   => 1,
4844   },
4845
4846   {
4847     'key'         => 'selfservice-title_align',
4848     'section'     => 'self-service',
4849     'description' => 'HTML alignment for the self-service title, for example, center',
4850     'type'        => 'text',
4851     'per_agent'   => 1,
4852   },
4853   {
4854     'key'         => 'selfservice-title_size',
4855     'section'     => 'self-service',
4856     'description' => 'HTML font size for the self-service title, for example, 3',
4857     'type'        => 'text',
4858     'per_agent'   => 1,
4859   },
4860
4861   {
4862     'key'         => 'selfservice-title_left_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-title_right_image',
4871     'section'     => 'self-service',
4872     'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4873     'type'        => 'image',
4874     'per_agent'   => 1,
4875   },
4876
4877   {
4878     'key'         => 'selfservice-menu_disable',
4879     'section'     => 'self-service',
4880     'description' => 'Disable the selected menu entries in the self-service menu',
4881     'type'        => 'selectmultiple',
4882     'select_enum' => [ #false laziness w/myaccount_menu.html
4883                        'Overview',
4884                        'Purchase',
4885                        'Purchase additional package',
4886                        'Recharge my account with a credit card',
4887                        'Recharge my account with a check',
4888                        'Recharge my account with a prepaid card',
4889                        'View my usage',
4890                        'Create a ticket',
4891                        'Setup my services',
4892                        'Change my information',
4893                        'Change billing address',
4894                        'Change service address',
4895                        'Change payment information',
4896                        'Change password(s)',
4897                        'Logout',
4898                      ],
4899     'per_agent'   => 1,
4900   },
4901
4902   {
4903     'key'         => 'selfservice-menu_skipblanks',
4904     'section'     => 'self-service',
4905     'description' => 'Skip blank (spacer) entries in the self-service menu',
4906     'type'        => 'checkbox',
4907     'per_agent'   => 1,
4908   },
4909
4910   {
4911     'key'         => 'selfservice-menu_skipheadings',
4912     'section'     => 'self-service',
4913     'description' => 'Skip the unclickable heading entries in the self-service menu',
4914     'type'        => 'checkbox',
4915     'per_agent'   => 1,
4916   },
4917
4918   {
4919     'key'         => 'selfservice-menu_bgcolor',
4920     'section'     => 'self-service',
4921     'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
4922     'type'        => 'text',
4923     'per_agent'   => 1,
4924   },
4925
4926   {
4927     'key'         => 'selfservice-menu_fontsize',
4928     'section'     => 'self-service',
4929     'description' => 'HTML font size for the self-service menu, for example, -1',
4930     'type'        => 'text',
4931     'per_agent'   => 1,
4932   },
4933   {
4934     'key'         => 'selfservice-menu_nounderline',
4935     'section'     => 'self-service',
4936     'description' => 'Styles menu links in the self-service without underlining.',
4937     'type'        => 'checkbox',
4938     'per_agent'   => 1,
4939   },
4940
4941
4942   {
4943     'key'         => 'selfservice-menu_top_image',
4944     'section'     => 'self-service',
4945     'description' => 'Image used for the top 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_body_image',
4952     'section'     => 'self-service',
4953     'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
4954     'type'        => 'image',
4955     'per_agent'   => 1,
4956   },
4957
4958   {
4959     'key'         => 'selfservice-menu_bottom_image',
4960     'section'     => 'self-service',
4961     'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
4962     'type'        => 'image',
4963     'per_agent'   => 1,
4964   },
4965   
4966   {
4967     'key'         => 'selfservice-view_usage_nodomain',
4968     'section'     => 'self-service',
4969     'description' => 'Show usernames without their domains in "View my usage" in the self-service interface.',
4970     'type'        => 'checkbox',
4971   },
4972
4973   {
4974     'key'         => 'selfservice-login_banner_image',
4975     'section'     => 'self-service',
4976     'description' => 'Banner image shown on the login page, in PNG format.',
4977     'type'        => 'image',
4978   },
4979
4980   {
4981     'key'         => 'selfservice-login_banner_url',
4982     'section'     => 'self-service',
4983     'description' => 'Link for the login banner.',
4984     'type'        => 'text',
4985   },
4986
4987   {
4988     'key'         => 'ng_selfservice-menu',
4989     'section'     => 'self-service',
4990     '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
4991     'type'        => 'textarea',
4992   },
4993
4994   {
4995     'key'         => 'signup-no_company',
4996     'section'     => 'self-service',
4997     'description' => "Don't display a field for company name on signup.",
4998     'type'        => 'checkbox',
4999   },
5000
5001   {
5002     'key'         => 'signup-recommend_email',
5003     'section'     => 'self-service',
5004     'description' => 'Encourage the entry of an invoicing email address on signup.',
5005     'type'        => 'checkbox',
5006   },
5007
5008   {
5009     'key'         => 'signup-recommend_daytime',
5010     'section'     => 'self-service',
5011     'description' => 'Encourage the entry of a daytime phone number on signup.',
5012     'type'        => 'checkbox',
5013   },
5014
5015   {
5016     'key'         => 'signup-duplicate_cc-warn_hours',
5017     'section'     => 'self-service',
5018     'description' => 'Issue a warning if the same credit card is used for multiple signups within this many hours.',
5019     'type'        => 'text',
5020   },
5021
5022   {
5023     'key'         => 'svc_phone-radius-password',
5024     'section'     => 'telephony',
5025     'description' => 'Password when exporting svc_phone records to RADIUS',
5026     'type'        => 'select',
5027     'select_hash' => [
5028       '' => 'Use default from svc_phone-radius-default_password config',
5029       'countrycode_phonenum' => 'Phone number (with country code)',
5030     ],
5031   },
5032
5033   {
5034     'key'         => 'svc_phone-radius-default_password',
5035     'section'     => 'telephony',
5036     'description' => 'Default password when exporting svc_phone records to RADIUS',
5037     'type'        => 'text',
5038   },
5039
5040   {
5041     'key'         => 'svc_phone-allow_alpha_phonenum',
5042     'section'     => 'telephony',
5043     'description' => 'Allow letters in phone numbers.',
5044     'type'        => 'checkbox',
5045   },
5046
5047   {
5048     'key'         => 'svc_phone-domain',
5049     'section'     => 'telephony',
5050     'description' => 'Track an optional domain association with each phone service.',
5051     'type'        => 'checkbox',
5052   },
5053
5054   {
5055     'key'         => 'svc_phone-phone_name-max_length',
5056     'section'     => 'telephony',
5057     '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.',
5058     'type'        => 'text',
5059   },
5060
5061   {
5062     'key'         => 'svc_phone-random_pin',
5063     'section'     => 'telephony',
5064     'description' => 'Number of random digits to generate in the "PIN" field, if empty.',
5065     'type'        => 'text',
5066   },
5067
5068   {
5069     'key'         => 'svc_phone-lnp',
5070     'section'     => 'telephony',
5071     'description' => 'Enables Number Portability features for svc_phone',
5072     'type'        => 'checkbox',
5073   },
5074
5075   {
5076     'key'         => 'svc_phone-bulk_provision_simple',
5077     'section'     => 'telephony',
5078     'description' => 'Bulk provision phone numbers with a simple number range instead of from DID vendor orders',
5079     'type'        => 'checkbox',
5080   },
5081
5082   {
5083     'key'         => 'default_phone_countrycode',
5084     'section'     => 'telephony',
5085     'description' => 'Default countrycode',
5086     'type'        => 'text',
5087   },
5088
5089   {
5090     'key'         => 'cdr-charged_party-field',
5091     'section'     => 'telephony',
5092     'description' => 'Set the charged_party field of CDRs to this field.',
5093     'type'        => 'select-sub',
5094     'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
5095                            map { $_ => $fields->{$_}||$_ }
5096                            grep { $_ !~ /^(acctid|charged_party)$/ }
5097                            FS::Schema::dbdef->table('cdr')->columns;
5098                          },
5099     'option_sub'  => sub { my $f = shift;
5100                            FS::cdr->table_info->{'fields'}{$f} || $f;
5101                          },
5102   },
5103
5104   #probably deprecate in favor of cdr-charged_party-field above
5105   {
5106     'key'         => 'cdr-charged_party-accountcode',
5107     'section'     => 'telephony',
5108     'description' => 'Set the charged_party field of CDRs to the accountcode.',
5109     'type'        => 'checkbox',
5110   },
5111
5112   {
5113     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
5114     'section'     => 'telephony',
5115     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
5116     'type'        => 'checkbox',
5117   },
5118
5119 #  {
5120 #    'key'         => 'cdr-charged_party-truncate_prefix',
5121 #    'section'     => '',
5122 #    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
5123 #    'type'        => 'text',
5124 #  },
5125 #
5126 #  {
5127 #    'key'         => 'cdr-charged_party-truncate_length',
5128 #    'section'     => '',
5129 #    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
5130 #    'type'        => 'text',
5131 #  },
5132
5133   {
5134     'key'         => 'cdr-charged_party_rewrite',
5135     'section'     => 'telephony',
5136     '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*.',
5137     'type'        => 'checkbox',
5138   },
5139
5140   {
5141     'key'         => 'cdr-taqua-da_rewrite',
5142     'section'     => 'telephony',
5143     '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.',
5144     'type'        => 'text',
5145   },
5146
5147   {
5148     'key'         => 'cdr-taqua-accountcode_rewrite',
5149     'section'     => 'telephony',
5150     'description' => 'For the Taqua CDR format, pull accountcodes from secondary CDRs with matching sessionNumber.',
5151     'type'        => 'checkbox',
5152   },
5153
5154   {
5155     'key'         => 'cdr-taqua-callerid_rewrite',
5156     'section'     => 'telephony',
5157     'description' => 'For the Taqua CDR format, pull Caller ID blocking information from secondary CDRs.',
5158     'type'        => 'checkbox',
5159   },
5160
5161   {
5162     'key'         => 'cdr-asterisk_australia_rewrite',
5163     'section'     => 'telephony',
5164     'description' => 'For Asterisk CDRs, assign CDR type numbers based on Australian conventions.',
5165     'type'        => 'checkbox',
5166   },
5167
5168   {
5169     'key'         => 'cdr-gsm_tap3-sender',
5170     'section'     => 'telephony',
5171     'description' => 'GSM TAP3 Sender network (5 letter code)',
5172     'type'        => 'text',
5173   },
5174
5175   {
5176     'key'         => 'cust_pkg-show_autosuspend',
5177     'section'     => 'UI',
5178     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
5179     'type'        => 'checkbox',
5180   },
5181
5182   {
5183     'key'         => 'cdr-asterisk_forward_rewrite',
5184     'section'     => 'telephony',
5185     '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").',
5186     'type'        => 'checkbox',
5187   },
5188
5189   {
5190     'key'         => 'mc-outbound_packages',
5191     'section'     => '',
5192     'description' => "Don't use this.",
5193     'type'        => 'select-part_pkg',
5194     'multiple'    => 1,
5195   },
5196
5197   {
5198     'key'         => 'disable-cust-pkg_class',
5199     'section'     => 'UI',
5200     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
5201     'type'        => 'checkbox',
5202   },
5203
5204   {
5205     'key'         => 'queued-max_kids',
5206     'section'     => '',
5207     'description' => 'Maximum number of queued processes.  Defaults to 10.',
5208     'type'        => 'text',
5209   },
5210
5211   {
5212     'key'         => 'queued-sleep_time',
5213     'section'     => '',
5214     '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.',
5215     'type'        => 'text',
5216   },
5217
5218   {
5219     'key'         => 'queue-no_history',
5220     'section'     => '',
5221     '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.",
5222     'type'        => 'checkbox',
5223   },
5224
5225   {
5226     'key'         => 'cancelled_cust-noevents',
5227     'section'     => 'billing',
5228     'description' => "Don't run events for cancelled customers",
5229     'type'        => 'checkbox',
5230   },
5231
5232   {
5233     'key'         => 'agent-invoice_template',
5234     'section'     => 'invoicing',
5235     'description' => 'Enable display/edit of old-style per-agent invoice template selection',
5236     'type'        => 'checkbox',
5237   },
5238
5239   {
5240     'key'         => 'svc_broadband-manage_link',
5241     'section'     => 'UI',
5242     'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr and $mac_addr.',
5243     'type'        => 'text',
5244   },
5245
5246   {
5247     'key'         => 'svc_broadband-manage_link_text',
5248     'section'     => 'UI',
5249     'description' => 'Label for "Manage Device" link',
5250     'type'        => 'text',
5251   },
5252
5253   {
5254     'key'         => 'svc_broadband-manage_link_loc',
5255     'section'     => 'UI',
5256     'description' => 'Location for "Manage Device" link',
5257     'type'        => 'select',
5258     'select_hash' => [
5259       'bottom' => 'Near Unprovision link',
5260       'right'  => 'With export-related links',
5261     ],
5262   },
5263
5264   {
5265     'key'         => 'svc_broadband-manage_link-new_window',
5266     'section'     => 'UI',
5267     'description' => 'Open the "Manage Device" link in a new window',
5268     'type'        => 'checkbox',
5269   },
5270
5271   #more fine-grained, service def-level control could be useful eventually?
5272   {
5273     'key'         => 'svc_broadband-allow_null_ip_addr',
5274     'section'     => '',
5275     'description' => '',
5276     'type'        => 'checkbox',
5277   },
5278
5279   {
5280     'key'         => 'svc_hardware-check_mac_addr',
5281     'section'     => '', #?
5282     'description' => 'Require the "hardware address" field in hardware services to be a valid MAC address.',
5283     'type'        => 'checkbox',
5284   },
5285
5286   {
5287     'key'         => 'tax-report_groups',
5288     'section'     => '',
5289     'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
5290     'type'        => 'textarea',
5291   },
5292
5293   {
5294     'key'         => 'tax-cust_exempt-groups',
5295     'section'     => 'taxation',
5296     '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).',
5297     'type'        => 'textarea',
5298   },
5299
5300   {
5301     'key'         => 'tax-cust_exempt-groups-require_individual_nums',
5302     'section'     => 'deprecated',
5303     'description' => 'Deprecated: see tax-cust_exempt-groups-number_requirement',
5304     'type'        => 'checkbox',
5305   },
5306
5307   {
5308     'key'         => 'tax-cust_exempt-groups-num_req',
5309     'section'     => 'taxation',
5310     'description' => 'When using tax-cust_exempt-groups, control whether individual tax exemption numbers are required for exemption from different taxes.',
5311     'type'        => 'select',
5312     'select_hash' => [ ''            => 'Not required',
5313                        'residential' => 'Required for residential customers only',
5314                        'all'         => 'Required for all customers',
5315                      ],
5316   },
5317
5318   {
5319     'key'         => 'cust_main-default_view',
5320     'section'     => 'UI',
5321     'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
5322     'type'        => 'select',
5323     'select_hash' => [
5324       #false laziness w/view/cust_main.cgi and pref/pref.html
5325       'basics'          => 'Basics',
5326       'notes'           => 'Notes',
5327       'tickets'         => 'Tickets',
5328       'packages'        => 'Packages',
5329       'payment_history' => 'Payment History',
5330       'change_history'  => 'Change History',
5331       'jumbo'           => 'Jumbo',
5332     ],
5333   },
5334
5335   {
5336     'key'         => 'enable_tax_adjustments',
5337     'section'     => 'taxation',
5338     'description' => 'Enable the ability to add manual tax adjustments.',
5339     'type'        => 'checkbox',
5340   },
5341
5342   {
5343     'key'         => 'rt-crontool',
5344     'section'     => '',
5345     'description' => 'Enable the RT CronTool extension.',
5346     'type'        => 'checkbox',
5347   },
5348
5349   {
5350     'key'         => 'pkg-balances',
5351     'section'     => 'billing',
5352     'description' => 'Enable per-package balances.',
5353     'type'        => 'checkbox',
5354   },
5355
5356   {
5357     'key'         => 'pkg-addon_classnum',
5358     'section'     => 'billing',
5359     'description' => 'Enable the ability to restrict additional package orders based on package class.',
5360     'type'        => 'checkbox',
5361   },
5362
5363   {
5364     'key'         => 'cust_main-edit_signupdate',
5365     'section'     => 'UI',
5366     'description' => 'Enable manual editing of the signup date.',
5367     'type'        => 'checkbox',
5368   },
5369
5370   {
5371     'key'         => 'svc_acct-disable_access_number',
5372     'section'     => 'UI',
5373     'description' => 'Disable access number selection.',
5374     'type'        => 'checkbox',
5375   },
5376
5377   {
5378     'key'         => 'cust_bill_pay_pkg-manual',
5379     'section'     => 'UI',
5380     'description' => 'Allow manual application of payments to line items.',
5381     'type'        => 'checkbox',
5382   },
5383
5384   {
5385     'key'         => 'cust_credit_bill_pkg-manual',
5386     'section'     => 'UI',
5387     'description' => 'Allow manual application of credits to line items.',
5388     'type'        => 'checkbox',
5389   },
5390
5391   {
5392     'key'         => 'breakage-days',
5393     'section'     => 'billing',
5394     '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.',
5395     'type'        => 'text',
5396     'per_agent'   => 1,
5397   },
5398
5399   {
5400     'key'         => 'breakage-pkg_class',
5401     'section'     => 'billing',
5402     'description' => 'Package class to use for breakage reconciliation.',
5403     'type'        => 'select-pkg_class',
5404   },
5405
5406   {
5407     'key'         => 'disable_cron_billing',
5408     'section'     => 'billing',
5409     '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.',
5410     'type'        => 'checkbox',
5411   },
5412
5413   {
5414     'key'         => 'svc_domain-edit_domain',
5415     'section'     => '',
5416     'description' => 'Enable domain renaming',
5417     'type'        => 'checkbox',
5418   },
5419
5420   {
5421     'key'         => 'enable_legacy_prepaid_income',
5422     'section'     => '',
5423     '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.",
5424     'type'        => 'checkbox',
5425   },
5426
5427   {
5428     'key'         => 'cust_main-exports',
5429     'section'     => '',
5430     'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
5431     'type'        => 'select-sub',
5432     'multiple'    => 1,
5433     'options_sub' => sub {
5434       require FS::Record;
5435       require FS::part_export;
5436       my @part_export =
5437         map { qsearch( 'part_export', {exporttype => $_ } ) }
5438           keys %{FS::part_export::export_info('cust_main')};
5439       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
5440     },
5441     'option_sub'  => sub {
5442       require FS::Record;
5443       require FS::part_export;
5444       my $part_export = FS::Record::qsearchs(
5445         'part_export', { 'exportnum' => shift }
5446       );
5447       $part_export
5448         ? $part_export->exporttype.' to '.$part_export->machine
5449         : '';
5450     },
5451   },
5452
5453   #false laziness w/above options_sub and option_sub
5454   {
5455     'key'         => 'cust_location-exports',
5456     'section'     => '',
5457     'description' => 'Export(s) to call on cust_location insert, modification and deletion.',
5458     'type'        => 'select-sub',
5459     'multiple'    => 1,
5460     'options_sub' => sub {
5461       require FS::Record;
5462       require FS::part_export;
5463       my @part_export =
5464         map { qsearch( 'part_export', {exporttype => $_ } ) }
5465           keys %{FS::part_export::export_info('cust_location')};
5466       map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
5467     },
5468     'option_sub'  => sub {
5469       require FS::Record;
5470       require FS::part_export;
5471       my $part_export = FS::Record::qsearchs(
5472         'part_export', { 'exportnum' => shift }
5473       );
5474       $part_export
5475         ? $part_export->exporttype.' to '.$part_export->machine
5476         : '';
5477     },
5478   },
5479
5480   {
5481     'key'         => 'cust_tag-location',
5482     'section'     => 'UI',
5483     'description' => 'Location where customer tags are displayed.',
5484     'type'        => 'select',
5485     'select_enum' => [ 'misc_info', 'top' ],
5486   },
5487
5488   {
5489     'key'         => 'cust_main-custom_link',
5490     'section'     => 'UI',
5491     '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.',
5492     'type'        => 'textarea',
5493   },
5494
5495   {
5496     'key'         => 'cust_main-custom_content',
5497     'section'     => 'UI',
5498     '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.',
5499     'type'        => 'textarea',
5500   },
5501
5502   {
5503     'key'         => 'cust_main-custom_title',
5504     'section'     => 'UI',
5505     'description' => 'Title for the "Custom" tab in the View Customer page.',
5506     'type'        => 'text',
5507   },
5508
5509   {
5510     'key'         => 'part_pkg-default_suspend_bill',
5511     'section'     => 'billing',
5512     'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
5513     'type'        => 'checkbox',
5514   },
5515   
5516   {
5517     'key'         => 'qual-alt_address_format',
5518     'section'     => 'UI',
5519     'description' => 'Enable the alternate address format (location type, number, and kind) for qualifications.',
5520     'type'        => 'checkbox',
5521   },
5522
5523   {
5524     'key'         => 'prospect_main-alt_address_format',
5525     'section'     => 'UI',
5526     '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.',
5527     'type'        => 'checkbox',
5528   },
5529
5530   {
5531     'key'         => 'prospect_main-location_required',
5532     'section'     => 'UI',
5533     'description' => 'Require an address for prospects.  Recommended if the main use of propects is for qualifications.',
5534     'type'        => 'checkbox',
5535   },
5536
5537   {
5538     'key'         => 'note-classes',
5539     'section'     => 'UI',
5540     'description' => 'Use customer note classes',
5541     'type'        => 'select',
5542     'select_hash' => [
5543                        0 => 'Disabled',
5544                        1 => 'Enabled',
5545                        2 => 'Enabled, with tabs',
5546                      ],
5547   },
5548
5549   {
5550     'key'         => 'svc_acct-cf_privatekey-message',
5551     'section'     => '',
5552     'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
5553     'type'        => 'textarea',
5554   },
5555
5556   {
5557     'key'         => 'menu-prepend_links',
5558     'section'     => 'UI',
5559     'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
5560     'type'        => 'textarea',
5561   },
5562
5563   {
5564     'key'         => 'cust_main-external_links',
5565     'section'     => 'UI',
5566     'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)".  The URL will have custnum appended.',
5567     'type'        => 'textarea',
5568   },
5569   
5570   {
5571     'key'         => 'svc_phone-did-summary',
5572     'section'     => 'invoicing',
5573     '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.',
5574     'type'        => 'checkbox',
5575   },
5576
5577   {
5578     'key'         => 'svc_acct-usage_seconds',
5579     'section'     => 'invoicing',
5580     'description' => 'Enable calculation of RADIUS usage time for invoices.  You must modify your template to display this information.',
5581     'type'        => 'checkbox',
5582   },
5583   
5584   {
5585     'key'         => 'opensips_gwlist',
5586     'section'     => 'telephony',
5587     'description' => 'For svc_phone OpenSIPS dr_rules export, gwlist column value, per-agent',
5588     'type'        => 'text',
5589     'per_agent'   => 1,
5590     'agentonly'   => 1,
5591   },
5592
5593   {
5594     'key'         => 'opensips_description',
5595     'section'     => 'telephony',
5596     'description' => 'For svc_phone OpenSIPS dr_rules export, description column value, per-agent',
5597     'type'        => 'text',
5598     'per_agent'   => 1,
5599     'agentonly'   => 1,
5600   },
5601   
5602   {
5603     'key'         => 'opensips_route',
5604     'section'     => 'telephony',
5605     'description' => 'For svc_phone OpenSIPS dr_rules export, routeid column value, per-agent',
5606     'type'        => 'text',
5607     'per_agent'   => 1,
5608     'agentonly'   => 1,
5609   },
5610
5611   {
5612     'key'         => 'cust_bill-no_recipients-error',
5613     'section'     => 'invoicing',
5614     '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.',
5615     'type'        => 'checkbox',
5616   },
5617
5618   {
5619     'key'         => 'cust_bill-latex_lineitem_maxlength',
5620     'section'     => 'invoicing',
5621     'description' => 'Truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin.  Defaults to 50.  ',
5622     'type'        => 'text',
5623   },
5624
5625   {
5626     'key'         => 'invoice_payment_details',
5627     'section'     => 'invoicing',
5628     '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.',
5629     'type'        => 'checkbox',
5630   },
5631
5632   {
5633     'key'         => 'cust_main-status_module',
5634     'section'     => 'UI',
5635     '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?
5636     'type'        => 'select',
5637     'select_enum' => [ 'Classic', 'Recurring' ],
5638   },
5639
5640   { 
5641     'key'         => 'username-pound',
5642     'section'     => 'username',
5643     'description' => 'Allow the pound character (#) in usernames.',
5644     'type'        => 'checkbox',
5645   },
5646
5647   { 
5648     'key'         => 'username-exclamation',
5649     'section'     => 'username',
5650     'description' => 'Allow the exclamation character (!) in usernames.',
5651     'type'        => 'checkbox',
5652   },
5653
5654   {
5655     'key'         => 'ie-compatibility_mode',
5656     'section'     => 'UI',
5657     '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.",
5658     'type'        => 'select',
5659     'select_enum' => [ '', '7', 'EmulateIE7', '8', 'EmulateIE8' ],
5660   },
5661
5662   {
5663     'key'         => 'disable_payauto_default',
5664     'section'     => 'UI',
5665     'description' => 'Disable the "Charge future payments to this (card|check) automatically" checkbox from defaulting to checked.',
5666     'type'        => 'checkbox',
5667   },
5668   
5669   {
5670     'key'         => 'payment-history-report',
5671     'section'     => 'UI',
5672     'description' => 'Show a link to the raw database payment history report in the Reports menu.  DO NOT ENABLE THIS for modern installations.',
5673     'type'        => 'checkbox',
5674   },
5675   
5676   {
5677     'key'         => 'svc_broadband-require-nw-coordinates',
5678     'section'     => 'deprecated',
5679     'description' => 'Deprecated; see geocode-require_nw_coordinates instead',
5680     'type'        => 'checkbox',
5681   },
5682   
5683   {
5684     'key'         => 'cust-email-high-visibility',
5685     'section'     => 'UI',
5686     'description' => 'Move the invoicing e-mail address field to the top of the billing address section and highlight it.',
5687     'type'        => 'checkbox',
5688   },
5689   
5690   {
5691     'key'         => 'cust-edit-alt-field-order',
5692     'section'     => 'UI',
5693     'description' => 'An alternate ordering of fields for the New Customer and Edit Customer screens.',
5694     'type'        => 'checkbox',
5695   },
5696
5697   {
5698     'key'         => 'cust_bill-enable_promised_date',
5699     'section'     => 'UI',
5700     'description' => 'Enable display/editing of the "promised payment date" field on invoices.',
5701     'type'        => 'checkbox',
5702   },
5703   
5704   {
5705     'key'         => 'available-locales',
5706     'section'     => '',
5707     'description' => 'Limit available locales (employee preferences, per-customer locale selection, etc.) to a particular set.',
5708     'type'        => 'select-sub',
5709     'multiple'    => 1,
5710     'options_sub' => sub { 
5711       map { $_ => FS::Locales->description($_) }
5712       FS::Locales->locales;
5713     },
5714     'option_sub'  => sub { FS::Locales->description(shift) },
5715   },
5716
5717   {
5718     'key'         => 'cust_main-require_locale',
5719     'section'     => 'UI',
5720     'description' => 'Require an explicit locale to be chosen for new customers.',
5721     'type'        => 'checkbox',
5722   },
5723   
5724   {
5725     'key'         => 'translate-auto-insert',
5726     'section'     => '',
5727     '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.',
5728     'type'        => 'select',
5729     'multiple'    => 1,
5730     'select_enum' => [ grep { $_ ne 'en_US' } FS::Locales::locales ],
5731   },
5732
5733   {
5734     'key'         => 'svc_acct-tower_sector',
5735     'section'     => '',
5736     'description' => 'Track tower and sector for svc_acct (account) services.',
5737     'type'        => 'checkbox',
5738   },
5739
5740   {
5741     'key'         => 'cdr-prerate',
5742     'section'     => 'telephony',
5743     '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.',
5744     'type'        => 'checkbox',
5745   },
5746
5747   {
5748     'key'         => 'cdr-prerate-cdrtypenums',
5749     'section'     => 'telephony',
5750     'description' => 'When using cdr-prerate to rate CDRs immediately, limit processing to these CDR types.',
5751     'type'        => 'select-sub',
5752     'multiple'    => 1,
5753     'options_sub' => sub { require FS::Record;
5754                            require FS::cdr_type;
5755                            map { $_->cdrtypenum => $_->cdrtypename }
5756                                FS::Record::qsearch( 'cdr_type', 
5757                                                     {} #{ 'disabled' => '' }
5758                                                   );
5759                          },
5760     'option_sub'  => sub { require FS::Record;
5761                            require FS::cdr_type;
5762                            my $cdr_type = FS::Record::qsearchs(
5763                              'cdr_type', { 'cdrtypenum'=>shift } );
5764                            $cdr_type ? $cdr_type->cdrtypename : '';
5765                          },
5766   },
5767
5768   {
5769     'key'         => 'cdr-minutes_priority',
5770     'section'     => 'telephony',
5771     'description' => 'Priority rule for assigning included minutes to CDRs.',
5772     'type'        => 'select',
5773     'select_hash' => [
5774       ''          => 'No specific order',
5775       'time'      => 'Chronological',
5776       'rate_high' => 'Highest rate first',
5777       'rate_low'  => 'Lowest rate first',
5778     ],
5779   },
5780   
5781   {
5782     'key'         => 'brand-agent',
5783     'section'     => 'UI',
5784     '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.',
5785     'type'        => 'select-agent',
5786   },
5787
5788   {
5789     'key'         => 'cust_class-tax_exempt',
5790     'section'     => 'taxation',
5791     'description' => 'Control the tax exemption flag per customer class rather than per indivual customer.',
5792     'type'        => 'checkbox',
5793   },
5794
5795   {
5796     'key'         => 'selfservice-billing_history-line_items',
5797     'section'     => 'self-service',
5798     'description' => 'Return line item billing detail for the self-service billing_history API call.',
5799     'type'        => 'checkbox',
5800   },
5801
5802   {
5803     'key'         => 'selfservice-default_cdr_format',
5804     'section'     => 'self-service',
5805     'description' => 'Format for showing outbound CDRs in self-service.  The per-package option overrides this.',
5806     'type'        => 'select',
5807     'select_hash' => \@cdr_formats,
5808   },
5809
5810   {
5811     'key'         => 'selfservice-default_inbound_cdr_format',
5812     'section'     => 'self-service',
5813     'description' => 'Format for showing inbound CDRs in self-service.  The per-package option overrides this.  Leave blank to avoid showing these CDRs.',
5814     'type'        => 'select',
5815     'select_hash' => \@cdr_formats,
5816   },
5817
5818   {
5819     'key'         => 'selfservice-hide_cdr_price',
5820     'section'     => 'self-service',
5821     'description' => 'Don\'t show the "Price" column on CDRs in self-service.',
5822     'type'        => 'checkbox',
5823   },
5824
5825   {
5826     'key'         => 'logout-timeout',
5827     'section'     => 'UI',
5828     'description' => 'If set, automatically log users out of the backoffice after this many minutes.',
5829     'type'       => 'text',
5830   },
5831   
5832   {
5833     'key'         => 'spreadsheet_format',
5834     'section'     => 'UI',
5835     'description' => 'Default format for spreadsheet download.',
5836     'type'        => 'select',
5837     'select_hash' => [
5838       'XLS' => 'XLS (Excel 97/2000/XP)',
5839       'XLSX' => 'XLSX (Excel 2007+)',
5840     ],
5841   },
5842
5843   {
5844     'key'         => 'agent-email_day',
5845     'section'     => '',
5846     '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.',
5847     'type'        => 'text',
5848   },
5849
5850   {
5851     'key'         => 'report-cust_pay-select_time',
5852     'section'     => 'UI',
5853     'description' => 'Enable time selection on payment and refund reports.',
5854     'type'        => 'checkbox',
5855   },
5856
5857   {
5858     'key'         => 'authentication_module',
5859     'section'     => 'UI',
5860     'description' => '"Internal" is the default , which authenticates against the internal database.  "Legacy" is similar, but matches passwords against a legacy htpasswd file.',
5861     'type'        => 'select',
5862     'select_enum' => [qw( Internal Legacy )],
5863   },
5864
5865   {
5866     'key'         => 'external_auth-access_group-template_user',
5867     'section'     => 'UI',
5868     'description' => 'When using an external authentication module, specifies the default access groups for autocreated users, via a template user.',
5869     'type'        => 'text',
5870   },
5871
5872   {
5873     'key'         => 'allow_invalid_cards',
5874     'section'     => '',
5875     'description' => 'Accept invalid credit card numbers.  Useful for testing with fictitious customers.  There is no good reason to enable this in production.',
5876     'type'        => 'checkbox',
5877   },
5878
5879   {
5880     'key'         => 'default_credit_limit',
5881     'section'     => 'billing',
5882     'description' => 'Default customer credit limit',
5883     'type'        => 'text',
5884   },
5885
5886   {
5887     'key'         => 'api_shared_secret',
5888     'section'     => 'API',
5889     'description' => 'Shared secret for back-office API authentication',
5890     'type'        => 'text',
5891   },
5892
5893   {
5894     'key'         => 'xmlrpc_api',
5895     'section'     => 'API',
5896     'description' => 'Enable the back-office API XML-RPC server (on port 8008).',
5897     'type'        => 'checkbox',
5898   },
5899
5900 #  {
5901 #    'key'         => 'jsonrpc_api',
5902 #    'section'     => 'API',
5903 #    'description' => 'Enable the back-office API JSON-RPC server (on port 8081).',
5904 #    'type'        => 'checkbox',
5905 #  },
5906
5907   {
5908     'key'         => 'api_credit_reason',
5909     'section'     => 'API',
5910     'description' => 'Default reason for back-office API credits',
5911     'type'        => 'select-sub',
5912     #false laziness w/api_credit_reason
5913     'options_sub' => sub { require FS::Record;
5914                            require FS::reason;
5915                            my $type = qsearchs('reason_type', 
5916                              { class => 'R' }) 
5917                               or return ();
5918                            map { $_->reasonnum => $_->reason }
5919                                FS::Record::qsearch('reason', 
5920                                  { reason_type => $type->typenum } 
5921                                );
5922                          },
5923     'option_sub'  => sub { require FS::Record;
5924                            require FS::reason;
5925                            my $reason = FS::Record::qsearchs(
5926                              'reason', { 'reasonnum' => shift }
5927                            );
5928                            $reason ? $reason->reason : '';
5929                          },
5930   },
5931
5932   {
5933     'key'         => 'part_pkg-term_discounts',
5934     'section'     => 'billing',
5935     'description' => 'Enable the term discounts feature.  Recommended to keep turned off unless actually using - not well optimized for large installations.',
5936     'type'        => 'checkbox',
5937   },
5938
5939   {
5940     'key'         => 'prepaid-never_renew',
5941     'section'     => 'billing',
5942     'description' => 'Prepaid packages never renew.',
5943     'type'        => 'checkbox',
5944   },
5945
5946   {
5947     'key'         => 'agent-disable_counts',
5948     'section'     => 'UI',
5949     '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.',
5950     'type'        => 'checkbox',
5951   },
5952
5953   {
5954     'key'         => 'tollfree-country',
5955     'section'     => 'telephony',
5956     'description' => 'Country / region for toll-free recognition',
5957     'type'        => 'select',
5958     'select_hash' => [ ''   => 'NANPA (US/Canada)',
5959                        'AU' => 'Australia',
5960                        'NZ' => 'New Zealand',
5961                      ],
5962   },
5963
5964   {
5965     'key'         => 'old_fcc_report',
5966     'section'     => '',
5967     'description' => 'Use the old (pre-2014) FCC Form 477 report format.',
5968     'type'        => 'checkbox',
5969   },
5970
5971   {
5972     'key'         => 'cust_main-default_commercial',
5973     'section'     => 'UI',
5974     'description' => 'Default for new customers is commercial rather than residential.',
5975     'type'        => 'checkbox',
5976   },
5977
5978   {
5979     'key'         => 'default_appointment_length',
5980     'section'     => 'UI',
5981     'description' => 'Default appointment length, in minutes (30 minute granularity).',
5982     'type'        => 'text',
5983   },
5984
5985   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5986   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5987   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5988   { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5989   { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5990   { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5991   { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5992   { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5993   { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5994   { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5995   { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5996   { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5997   { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5998   { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5999   { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6000   { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6001   { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6002   { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6003   { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6004   { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6005   { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6006   { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6007   { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6008   { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6009   { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6010   { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6011   { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6012   { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6013   { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6014   { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6015   { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6016   { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6017   { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6018   { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6019   { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6020   { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6021   { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6022   { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6023   { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6024   { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6025   { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
6026
6027 );
6028
6029 1;
6030