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