agent-virt invoice_*{notes,footer,smallfooter,coupon}, RT#5025
[freeside.git] / FS / FS / Conf.pm
1 package FS::Conf;
2
3 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
4 use Carp;
5 use IO::File;
6 use File::Basename;
7 use MIME::Base64;
8 use FS::ConfItem;
9 use FS::ConfDefaults;
10 use FS::Conf_compat17;
11 use FS::payby;
12 use FS::conf;
13 use FS::Record qw(qsearch qsearchs);
14 use FS::UID qw(dbh datasrc use_confcompat);
15
16 $base_dir = '%%%FREESIDE_CONF%%%';
17
18 $DEBUG = 0;
19
20 =head1 NAME
21
22 FS::Conf - Freeside configuration values
23
24 =head1 SYNOPSIS
25
26   use FS::Conf;
27
28   $conf = new FS::Conf;
29
30   $value = $conf->config('key');
31   @list  = $conf->config('key');
32   $bool  = $conf->exists('key');
33
34   $conf->touch('key');
35   $conf->set('key' => 'value');
36   $conf->delete('key');
37
38   @config_items = $conf->config_items;
39
40 =head1 DESCRIPTION
41
42 Read and write Freeside configuration values.  Keys currently map to filenames,
43 but this may change in the future.
44
45 =head1 METHODS
46
47 =over 4
48
49 =item new
50
51 Create a new configuration object.
52
53 =cut
54
55 sub new {
56   my($proto) = @_;
57   my($class) = ref($proto) || $proto;
58   my($self) = { 'base_dir' => $base_dir };
59   bless ($self, $class);
60 }
61
62 =item base_dir
63
64 Returns the base directory.  By default this is /usr/local/etc/freeside.
65
66 =cut
67
68 sub base_dir {
69   my($self) = @_;
70   my $base_dir = $self->{base_dir};
71   -e $base_dir or die "FATAL: $base_dir doesn't exist!";
72   -d $base_dir or die "FATAL: $base_dir isn't a directory!";
73   -r $base_dir or die "FATAL: Can't read $base_dir!";
74   -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
75   $base_dir =~ /^(.*)$/;
76   $1;
77 }
78
79 =item config KEY [ AGENTNUM ]
80
81 Returns the configuration value or values (depending on context) for key.
82 The optional agent number selects an agent specific value instead of the
83 global default if one is present.
84
85 =cut
86
87 sub _usecompat {
88   my ($self, $method) = (shift, shift);
89   carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
90     if use_confcompat;
91   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
92   $compat->$method(@_);
93 }
94
95 sub _config {
96   my($self,$name,$agentnum)=@_;
97   my $hashref = { 'name' => $name };
98   $hashref->{agentnum} = $agentnum;
99   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
100   my $cv = FS::Record::qsearchs('conf', $hashref);
101   if (!$cv && defined($agentnum) && $agentnum) {
102     $hashref->{agentnum} = '';
103     $cv = FS::Record::qsearchs('conf', $hashref);
104   }
105   return $cv;
106 }
107
108 sub config {
109   my $self = shift;
110   return $self->_usecompat('config', @_) if use_confcompat;
111
112   my($name, $agentnum)=@_;
113
114   carp "FS::Conf->config($name, $agentnum) called"
115     if $DEBUG > 1;
116
117   my $cv = $self->_config($name, $agentnum) or return;
118
119   if ( wantarray ) {
120     my $v = $cv->value;
121     chomp $v;
122     (split "\n", $v, -1);
123   } else {
124     (split("\n", $cv->value))[0];
125   }
126 }
127
128 =item config_binary KEY [ AGENTNUM ]
129
130 Returns the exact scalar value for key.
131
132 =cut
133
134 sub config_binary {
135   my $self = shift;
136   return $self->_usecompat('config_binary', @_) if use_confcompat;
137
138   my($name,$agentnum)=@_;
139   my $cv = $self->_config($name, $agentnum) or return;
140   decode_base64($cv->value);
141 }
142
143 =item exists KEY [ AGENTNUM ]
144
145 Returns true if the specified key exists, even if the corresponding value
146 is undefined.
147
148 =cut
149
150 sub exists {
151   my $self = shift;
152   return $self->_usecompat('exists', @_) if use_confcompat;
153
154   my($name, $agentnum)=@_;
155
156   carp "FS::Conf->exists($name, $agentnum) called"
157     if $DEBUG > 1;
158
159   defined($self->_config($name, $agentnum));
160 }
161
162 =item config_orbase KEY SUFFIX
163
164 Returns the configuration value or values (depending on context) for 
165 KEY_SUFFIX, if it exists, otherwise for KEY
166
167 =cut
168
169 # outmoded as soon as we shift to agentnum based config values
170 # well, mostly.  still useful for e.g. late notices, etc. in that we want
171 # these to fall back to standard values
172 sub config_orbase {
173   my $self = shift;
174   return $self->_usecompat('config_orbase', @_) if use_confcompat;
175
176   my( $name, $suffix ) = @_;
177   if ( $self->exists("${name}_$suffix") ) {
178     $self->config("${name}_$suffix");
179   } else {
180     $self->config($name);
181   }
182 }
183
184 =item key_orbase KEY SUFFIX
185
186 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
187 KEY.  Useful for determining which exact configuration option is returned by
188 config_orbase.
189
190 =cut
191
192 sub key_orbase {
193   my $self = shift;
194   #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
195
196   my( $name, $suffix ) = @_;
197   if ( $self->exists("${name}_$suffix") ) {
198     "${name}_$suffix";
199   } else {
200     $name;
201   }
202 }
203
204 =item invoice_templatenames
205
206 Returns all possible invoice template names.
207
208 =cut
209
210 sub invoice_templatenames {
211   my( $self ) = @_;
212
213   my %templatenames = ();
214   foreach my $item ( $self->config_items ) {
215     foreach my $base ( @base_items ) {
216       my( $main, $ext) = split(/\./, $base);
217       $ext = ".$ext" if $ext;
218       if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
219       $templatenames{$1}++;
220       }
221     }
222   }
223   
224   sort keys %templatenames;
225
226 }
227
228 =item touch KEY [ AGENT ];
229
230 Creates the specified configuration key if it does not exist.
231
232 =cut
233
234 sub touch {
235   my $self = shift;
236   return $self->_usecompat('touch', @_) if use_confcompat;
237
238   my($name, $agentnum) = @_;
239   unless ( $self->exists($name, $agentnum) ) {
240     $self->set($name, '', $agentnum);
241   }
242 }
243
244 =item set KEY VALUE [ AGENTNUM ];
245
246 Sets the specified configuration key to the given value.
247
248 =cut
249
250 sub set {
251   my $self = shift;
252   return $self->_usecompat('set', @_) if use_confcompat;
253
254   my($name, $value, $agentnum) = @_;
255   $value =~ /^(.*)$/s;
256   $value = $1;
257
258   warn "[FS::Conf] SET $name\n" if $DEBUG;
259
260   my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
261   my $new = new FS::conf { $old ? $old->hash 
262                                 : ('name' => $name, 'agentnum' => $agentnum)
263                          };
264   $new->value($value);
265
266   my $error;
267   if ($old) {
268     $error = $new->replace($old);
269   } else {
270     $error = $new->insert;
271   }
272
273   die "error setting configuration value: $error \n"
274     if $error;
275
276 }
277
278 =item set_binary KEY VALUE [ AGENTNUM ]
279
280 Sets the specified configuration key to an exact scalar value which
281 can be retrieved with config_binary.
282
283 =cut
284
285 sub set_binary {
286   my $self  = shift;
287   return if use_confcompat;
288
289   my($name, $value, $agentnum)=@_;
290   $self->set($name, encode_base64($value), $agentnum);
291 }
292
293 =item delete KEY [ AGENTNUM ];
294
295 Deletes the specified configuration key.
296
297 =cut
298
299 sub delete {
300   my $self = shift;
301   return $self->_usecompat('delete', @_) if use_confcompat;
302
303   my($name, $agentnum) = @_;
304   if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
305     warn "[FS::Conf] DELETE $name\n";
306
307     my $oldAutoCommit = $FS::UID::AutoCommit;
308     local $FS::UID::AutoCommit = 0;
309     my $dbh = dbh;
310
311     my $error = $cv->delete;
312
313     if ( $error ) {
314       $dbh->rollback if $oldAutoCommit;
315       die "error setting configuration value: $error \n"
316     }
317
318     $dbh->commit or die $dbh->errstr if $oldAutoCommit;
319
320   }
321 }
322
323 =item import_config_item CONFITEM DIR 
324
325   Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
326 the database as a conf record (see L<FS::conf>).  Imports from the file
327 in the directory DIR.
328
329 =cut
330
331 sub import_config_item { 
332   my ($self,$item,$dir) = @_;
333   my $key = $item->key;
334   if ( -e "$dir/$key" && ! use_confcompat ) {
335     warn "Inserting $key\n" if $DEBUG;
336     local $/;
337     my $value = readline(new IO::File "$dir/$key");
338     if ($item->type =~ /^(binary|image)$/ ) {
339       $self->set_binary($key, $value);
340     }else{
341       $self->set($key, $value);
342     }
343   }else {
344     warn "Not inserting $key\n" if $DEBUG;
345   }
346 }
347
348 =item verify_config_item CONFITEM DIR 
349
350   Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
351 the database to the legacy file value in DIR.
352
353 =cut
354
355 sub verify_config_item { 
356   return '' if use_confcompat;
357   my ($self,$item,$dir) = @_;
358   my $key = $item->key;
359   my $type = $item->type;
360
361   my $compat = new FS::Conf_compat17 $dir;
362   my $error = '';
363   
364   $error .= "$key fails existential comparison; "
365     if $self->exists($key) xor $compat->exists($key);
366
367   if ( $type !~ /^(binary|image)$/ ) {
368
369     {
370       no warnings;
371       $error .= "$key fails scalar comparison; "
372         unless scalar($self->config($key)) eq scalar($compat->config($key));
373     }
374
375     my (@new) = $self->config($key);
376     my (@old) = $compat->config($key);
377     unless ( scalar(@new) == scalar(@old)) { 
378       $error .= "$key fails list comparison; ";
379     }else{
380       my $r=1;
381       foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
382       $error .= "$key fails list comparison; "
383         unless $r;
384     }
385
386   } else {
387
388     $error .= "$key fails binary comparison; "
389       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
390
391   }
392
393 #remove deprecated config on our own terms, not freeside-upgrade's
394 #  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
395 #    my $proto;
396 #    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
397 #    unless ($proto->key eq $key) { 
398 #      warn "removed config item $error\n" if $DEBUG;
399 #      $error = '';
400 #    }
401 #  }
402
403   $error;
404 }
405
406 #item _orbase_items OPTIONS
407 #
408 #Returns all of the possible extensible config items as FS::ConfItem objects.
409 #See #L<FS::ConfItem>.  OPTIONS consists of name value pairs.  Possible
410 #options include
411 #
412 # dir - the directory to search for configuration option files instead
413 #       of using the conf records in the database
414 #
415 #cut
416
417 #quelle kludge
418 sub _orbase_items {
419   my ($self, %opt) = @_; 
420
421   my $listmaker = sub { my $v = shift;
422                         $v =~ s/_/!_/g;
423                         if ( $v =~ /\.(png|eps)$/ ) {
424                           $v =~ s/\./!_%./;
425                         }else{
426                           $v .= '!_%';
427                         }
428                         map { $_->name }
429                           FS::Record::qsearch( 'conf',
430                                                {},
431                                                '',
432                                                "WHERE name LIKE '$v' ESCAPE '!'"
433                                              );
434                       };
435
436   if (exists($opt{dir}) && $opt{dir}) {
437     $listmaker = sub { my $v = shift;
438                        if ( $v =~ /\.(png|eps)$/ ) {
439                          $v =~ s/\./_*./;
440                        }else{
441                          $v .= '_*';
442                        }
443                        map { basename $_ } glob($opt{dir}. "/$v" );
444                      };
445   }
446
447   ( map { 
448           my $proto;
449           my $base = $_;
450           for ( @config_items ) { $proto = $_; last if $proto->key eq $base;  }
451           die "don't know about $base items" unless $proto->key eq $base;
452
453           map { new FS::ConfItem { 
454                                    'key' => $_,
455                                    'section' => $proto->section,
456                                    'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
457                                    'type' => $proto->type,
458                                  };
459               } &$listmaker($base);
460         } @base_items,
461   );
462 }
463
464 =item config_items
465
466 Returns all of the possible global/default configuration items as
467 FS::ConfItem objects.  See L<FS::ConfItem>.
468
469 =cut
470
471 sub config_items {
472   my $self = shift; 
473   return $self->_usecompat('config_items', @_) if use_confcompat;
474
475   ( @config_items, $self->_orbase_items(@_) );
476 }
477
478 =back
479
480 =head1 SUBROUTINES
481
482 =over 4
483
484 =item init-config DIR
485
486 Imports the configuration items from DIR (1.7 compatible)
487 to conf records in the database.
488
489 =cut
490
491 sub init_config {
492   my $dir = shift;
493
494   {
495     local $FS::UID::use_confcompat = 0;
496     my $conf = new FS::Conf;
497     foreach my $item ( $conf->config_items(dir => $dir) ) {
498       $conf->import_config_item($item, $dir);
499       my $error = $conf->verify_config_item($item, $dir);
500       return $error if $error;
501     }
502   
503     my $compat = new FS::Conf_compat17 $dir;
504     foreach my $item ( $compat->config_items ) {
505       my $error = $conf->verify_config_item($item, $dir);
506       return $error if $error;
507     }
508   }
509
510   $FS::UID::use_confcompat = 0;
511   '';  #success
512 }
513
514 =back
515
516 =head1 BUGS
517
518 If this was more than just crud that will never be useful outside Freeside I'd
519 worry that config_items is freeside-specific and icky.
520
521 =head1 SEE ALSO
522
523 "Configuration" in the web interface (config/config.cgi).
524
525 =cut
526
527 #Business::CreditCard
528 @card_types = (
529   "VISA card",
530   "MasterCard",
531   "Discover card",
532   "American Express card",
533   "Diner's Club/Carte Blanche",
534   "enRoute",
535   "JCB",
536   "BankCard",
537   "Switch",
538   "Solo",
539 );
540
541 @base_items = qw (
542                    invoice_template
543                    invoice_latex
544                    invoice_latexreturnaddress
545                    invoice_latexfooter
546                    invoice_latexsmallfooter
547                    invoice_latexnotes
548                    invoice_latexcoupon
549                    invoice_html
550                    invoice_htmlreturnaddress
551                    invoice_htmlfooter
552                    invoice_htmlnotes
553                    logo.png
554                    logo.eps
555                  );
556
557 @config_items = map { new FS::ConfItem $_ } (
558
559   {
560     'key'         => 'address',
561     'section'     => 'deprecated',
562     'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
563     'type'        => 'text',
564   },
565
566   {
567     'key'         => 'alerter_template',
568     'section'     => 'billing',
569     'description' => 'Template file for billing method expiration alerts.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
570     'type'        => 'textarea',
571     'per-agent'   => 1,
572   },
573
574   {
575     'key'         => 'apacheip',
576     'section'     => 'deprecated',
577     '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',
578     'type'        => 'text',
579   },
580
581   {
582     'key'         => 'encryption',
583     'section'     => 'billing',
584     'description' => 'Enable encryption of credit cards.',
585     'type'        => 'checkbox',
586   },
587
588   {
589     'key'         => 'encryptionmodule',
590     'section'     => 'billing',
591     'description' => 'Use which module for encryption?',
592     'type'        => 'text',
593   },
594
595   {
596     'key'         => 'encryptionpublickey',
597     'section'     => 'billing',
598     'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
599     'type'        => 'textarea',
600   },
601
602   {
603     'key'         => 'encryptionprivatekey',
604     'section'     => 'billing',
605     'description' => 'Your RSA Private Key - Including this will enable the "Bill Now" feature.  However if the system is compromised, a hacker can use this key to decode the stored credit card information.  This is generally not a good idea.',
606     'type'        => 'textarea',
607   },
608
609   {
610     'key'         => 'business-onlinepayment',
611     'section'     => 'billing',
612     '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.',
613     'type'        => 'textarea',
614   },
615
616   {
617     'key'         => 'business-onlinepayment-ach',
618     'section'     => 'billing',
619     '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.',
620     'type'        => 'textarea',
621   },
622
623   {
624     'key'         => 'business-onlinepayment-namespace',
625     'section'     => 'billing',
626     'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
627     'type'        => 'select',
628     'select_hash' => [
629                        'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
630                        'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
631                      ],
632   },
633
634   {
635     'key'         => 'business-onlinepayment-description',
636     'section'     => 'billing',
637     '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)',
638     'type'        => 'text',
639   },
640
641   {
642     'key'         => 'business-onlinepayment-email-override',
643     'section'     => 'billing',
644     'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
645     'type'        => 'text',
646   },
647
648   {
649     'key'         => 'business-onlinepayment-email_customer',
650     'section'     => 'billing',
651     'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
652     'type'        => 'checkbox',
653   },
654
655   {
656     'key'         => 'countrydefault',
657     'section'     => 'UI',
658     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
659     'type'        => 'text',
660   },
661
662   {
663     'key'         => 'date_format',
664     'section'     => 'UI',
665     'description' => 'Format for displaying dates',
666     'type'        => 'select',
667     'select_hash' => [
668                        '%m/%d/%Y' => 'MM/DD/YYYY',
669                        '%Y/%m/%d' => 'YYYY/MM/DD',
670                      ],
671   },
672
673   {
674     'key'         => 'deletecustomers',
675     'section'     => 'UI',
676     'description' => 'Enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that this customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers\' packages if they cancel service.',
677     'type'        => 'checkbox',
678   },
679
680   {
681     'key'         => 'deletepayments',
682     'section'     => 'billing',
683     'description' => 'Enable deletion of unclosed payments.  Really, with voids this is pretty much not recommended in any situation anymore.  Be very careful!  Only delete payments that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.',
684     'type'        => [qw( checkbox text )],
685   },
686
687   {
688     'key'         => 'deletecredits',
689     'section'     => 'deprecated',
690     'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable deletion of unclosed credits.  Be very careful!  Only delete credits that were data-entry errors, not adjustments.  Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.',
691     'type'        => [qw( checkbox text )],
692   },
693
694   {
695     'key'         => 'deleterefunds',
696     'section'     => 'billing',
697     'description' => 'Enable deletion of unclosed refunds.  Be very careful!  Only delete refunds that were data-entry errors, not adjustments.',
698     'type'        => 'checkbox',
699   },
700
701   {
702     'key'         => 'dirhash',
703     'section'     => 'shell',
704     '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>',
705     'type'        => 'text',
706   },
707
708   {
709     'key'         => 'disable_customer_referrals',
710     'section'     => 'UI',
711     'description' => 'Disable new customer-to-customer referrals in the web interface',
712     'type'        => 'checkbox',
713   },
714
715   {
716     'key'         => 'editreferrals',
717     'section'     => 'UI',
718     'description' => 'Enable advertising source modification for existing customers',
719     'type'       => 'checkbox',
720   },
721
722   {
723     'key'         => 'emailinvoiceonly',
724     'section'     => 'billing',
725     'description' => 'Disables postal mail invoices',
726     'type'       => 'checkbox',
727   },
728
729   {
730     'key'         => 'disablepostalinvoicedefault',
731     'section'     => 'billing',
732     '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>.',
733     'type'       => 'checkbox',
734   },
735
736   {
737     'key'         => 'emailinvoiceauto',
738     'section'     => 'billing',
739     'description' => 'Automatically adds new accounts to the email invoice list',
740     'type'       => 'checkbox',
741   },
742
743   {
744     'key'         => 'emailinvoiceautoalways',
745     'section'     => 'billing',
746     'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
747     'type'       => 'checkbox',
748   },
749
750   {
751     'key'         => 'exclude_ip_addr',
752     'section'     => '',
753     'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
754     'type'        => 'textarea',
755   },
756   
757   {
758     'key'         => 'auto_router',
759     'section'     => '',
760     'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
761     'type'        => 'checkbox',
762   },
763   
764   {
765     'key'         => 'hidecancelledpackages',
766     'section'     => 'UI',
767     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
768     'type'        => 'checkbox',
769   },
770
771   {
772     'key'         => 'hidecancelledcustomers',
773     'section'     => 'UI',
774     'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
775     'type'        => 'checkbox',
776   },
777
778   {
779     'key'         => 'home',
780     'section'     => 'shell',
781     'description' => 'For new users, prefixed to username to create a directory name.  Should have a leading but not a trailing slash.',
782     'type'        => 'text',
783   },
784
785   {
786     'key'         => 'invoice_from',
787     'section'     => 'required',
788     'description' => 'Return address on email invoices',
789     'type'        => 'text',
790     'per_agent'   => 1,
791   },
792
793   {
794     'key'         => 'invoice_subject',
795     'section'     => 'billing',
796     'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
797     'type'        => 'text',
798     'per_agent'   => 1,
799   },
800
801   {
802     'key'         => 'invoice_template',
803     'section'     => 'billing',
804     '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:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
805     'type'        => 'textarea',
806   },
807
808   {
809     'key'         => 'invoice_html',
810     'section'     => 'billing',
811     'description' => 'Optional HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
812
813     'type'        => 'textarea',
814   },
815
816   {
817     'key'         => 'invoice_htmlnotes',
818     'section'     => 'billing',
819     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
820     'type'        => 'textarea',
821     'per_agent'   => 1,
822   },
823
824   {
825     'key'         => 'invoice_htmlfooter',
826     'section'     => 'billing',
827     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
828     'type'        => 'textarea',
829     'per_agent'   => 1,
830   },
831
832   {
833     'key'         => 'invoice_htmlreturnaddress',
834     'section'     => 'billing',
835     'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
836     'type'        => 'textarea',
837   },
838
839   {
840     'key'         => 'invoice_latex',
841     'section'     => 'billing',
842     'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
843     'type'        => 'textarea',
844   },
845
846   {
847     'key'         => 'invoice_latexnotes',
848     'section'     => 'billing',
849     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
850     'type'        => 'textarea',
851     'per_agent'   => 1,
852   },
853
854   {
855     'key'         => 'invoice_latexfooter',
856     'section'     => 'billing',
857     'description' => 'Footer for LaTeX typeset PostScript invoices.',
858     'type'        => 'textarea',
859     'per_agent'   => 1,
860   },
861
862   {
863     'key'         => 'invoice_latexcoupon',
864     'section'     => 'billing',
865     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
866     'type'        => 'textarea',
867     'per_agent'   => 1,
868   },
869
870   {
871     'key'         => 'invoice_latexreturnaddress',
872     'section'     => 'billing',
873     'description' => 'Return address for LaTeX typeset PostScript invoices.',
874     'type'        => 'textarea',
875   },
876
877   {
878     'key'         => 'invoice_latexsmallfooter',
879     'section'     => 'billing',
880     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
881     'type'        => 'textarea',
882     'per_agent'   => 1,
883   },
884
885   {
886     'key'         => 'invoice_email_pdf',
887     'section'     => 'billing',
888     'description' => 'Send PDF invoice as an attachment to emailed invoices.  By default, includes the plain text invoice as the email body, unless invoice_email_pdf_note is set.',
889     'type'        => 'checkbox'
890   },
891
892   {
893     'key'         => 'invoice_email_pdf_note',
894     'section'     => 'billing',
895     'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
896     'type'        => 'textarea'
897   },
898
899
900   { 
901     'key'         => 'invoice_default_terms',
902     'section'     => 'billing',
903     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
904     'type'        => 'select',
905     'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
906   },
907
908   { 
909     'key'         => 'invoice_sections',
910     'section'     => 'billing',
911     'description' => 'Split invoice into sections and label according to package class when enabled.',
912     'type'        => 'checkbox',
913   },
914
915   { 
916     'key'         => 'separate_usage',
917     'section'     => 'billing',
918     'description' => 'Split the rated call usage into a separate line from the recurring charges.',
919     'type'        => 'checkbox',
920   },
921
922   {
923     'key'         => 'payment_receipt_email',
924     'section'     => 'billing',
925     'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <ul><li><code>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance</ul>',
926     'type'        => [qw( checkbox textarea )],
927   },
928
929   {
930     'key'         => 'lpr',
931     'section'     => 'required',
932     'description' => 'Print command for paper invoices, for example `lpr -h\'',
933     'type'        => 'text',
934   },
935
936   {
937     'key'         => 'lpr-postscript_prefix',
938     'section'     => 'billing',
939     'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
940     'type'        => 'text',
941   },
942
943   {
944     'key'         => 'lpr-postscript_suffix',
945     'section'     => 'billing',
946     'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
947     'type'        => 'text',
948   },
949
950   {
951     'key'         => 'money_char',
952     'section'     => '',
953     'description' => 'Currency symbol - defaults to `$\'',
954     'type'        => 'text',
955   },
956
957   {
958     'key'         => 'defaultrecords',
959     'section'     => 'BIND',
960     'description' => 'DNS entries to add automatically when creating a domain',
961     'type'        => 'editlist',
962     'editlist_parts' => [ { type=>'text' },
963                           { type=>'immutable', value=>'IN' },
964                           { type=>'select',
965                             select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
966                           { type=> 'text' }, ],
967   },
968
969   {
970     'key'         => 'passwordmin',
971     'section'     => 'password',
972     'description' => 'Minimum password length (default 6)',
973     'type'        => 'text',
974   },
975
976   {
977     'key'         => 'passwordmax',
978     'section'     => 'password',
979     'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
980     'type'        => 'text',
981   },
982
983   {
984     'key' => 'password-noampersand',
985     'section' => 'password',
986     'description' => 'Disallow ampersands in passwords',
987     'type' => 'checkbox',
988   },
989
990   {
991     'key' => 'password-noexclamation',
992     'section' => 'password',
993     'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
994     'type' => 'checkbox',
995   },
996
997   {
998     'key'         => 'referraldefault',
999     'section'     => 'UI',
1000     'description' => 'Default referral, specified by refnum',
1001     'type'        => 'text',
1002   },
1003
1004 #  {
1005 #    'key'         => 'registries',
1006 #    'section'     => 'required',
1007 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
1008 #  },
1009
1010   {
1011     'key'         => 'maxsearchrecordsperpage',
1012     'section'     => 'UI',
1013     'description' => 'If set, number of search records to return per page.',
1014     'type'        => 'text',
1015   },
1016
1017   {
1018     'key'         => 'session-start',
1019     'section'     => 'session',
1020     'description' => 'If defined, the command which is executed on the Freeside machine when a session begins.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
1021     'type'        => 'text',
1022   },
1023
1024   {
1025     'key'         => 'session-stop',
1026     'section'     => 'session',
1027     'description' => 'If defined, the command which is executed on the Freeside machine when a session ends.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
1028     'type'        => 'text',
1029   },
1030
1031   {
1032     'key'         => 'shells',
1033     'section'     => 'shell',
1034     '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.',
1035     'type'        => 'textarea',
1036   },
1037
1038   {
1039     'key'         => 'showpasswords',
1040     'section'     => 'UI',
1041     'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1042     'type'        => 'checkbox',
1043   },
1044
1045   {
1046     'key'         => 'signupurl',
1047     'section'     => 'UI',
1048     '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:1.7:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
1049     'type'        => 'text',
1050   },
1051
1052   {
1053     'key'         => 'smtpmachine',
1054     'section'     => 'required',
1055     'description' => 'SMTP relay for Freeside\'s outgoing mail',
1056     'type'        => 'text',
1057   },
1058
1059   {
1060     'key'         => 'soadefaultttl',
1061     'section'     => 'BIND',
1062     'description' => 'SOA default TTL for new domains.',
1063     'type'        => 'text',
1064   },
1065
1066   {
1067     'key'         => 'soaemail',
1068     'section'     => 'BIND',
1069     'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1070     'type'        => 'text',
1071   },
1072
1073   {
1074     'key'         => 'soaexpire',
1075     'section'     => 'BIND',
1076     'description' => 'SOA expire for new domains',
1077     'type'        => 'text',
1078   },
1079
1080   {
1081     'key'         => 'soamachine',
1082     'section'     => 'BIND',
1083     'description' => 'SOA machine for new domains, with trailing `.\'',
1084     'type'        => 'text',
1085   },
1086
1087   {
1088     'key'         => 'soarefresh',
1089     'section'     => 'BIND',
1090     'description' => 'SOA refresh for new domains',
1091     'type'        => 'text',
1092   },
1093
1094   {
1095     'key'         => 'soaretry',
1096     'section'     => 'BIND',
1097     'description' => 'SOA retry for new domains',
1098     'type'        => 'text',
1099   },
1100
1101   {
1102     'key'         => 'statedefault',
1103     'section'     => 'UI',
1104     'description' => 'Default state or province (if not supplied, the default is `CA\')',
1105     'type'        => 'text',
1106   },
1107
1108   {
1109     'key'         => 'unsuspendauto',
1110     'section'     => 'billing',
1111     'description' => 'Enables the automatic unsuspension of suspended packages when a customer\'s balance due changes from positive to zero or negative as the result of a payment or credit',
1112     'type'        => 'checkbox',
1113   },
1114
1115   {
1116     'key'         => 'unsuspend-always_adjust_next_bill_date',
1117     'section'     => 'billing',
1118     '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.',
1119     'type'        => 'checkbox',
1120   },
1121
1122   {
1123     'key'         => 'usernamemin',
1124     'section'     => 'username',
1125     'description' => 'Minimum username length (default 2)',
1126     'type'        => 'text',
1127   },
1128
1129   {
1130     'key'         => 'usernamemax',
1131     'section'     => 'username',
1132     'description' => 'Maximum username length',
1133     'type'        => 'text',
1134   },
1135
1136   {
1137     'key'         => 'username-ampersand',
1138     'section'     => 'username',
1139     '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.',
1140     'type'        => 'checkbox',
1141   },
1142
1143   {
1144     'key'         => 'username-letter',
1145     'section'     => 'username',
1146     'description' => 'Usernames must contain at least one letter',
1147     'type'        => 'checkbox',
1148   },
1149
1150   {
1151     'key'         => 'username-letterfirst',
1152     'section'     => 'username',
1153     'description' => 'Usernames must start with a letter',
1154     'type'        => 'checkbox',
1155   },
1156
1157   {
1158     'key'         => 'username-noperiod',
1159     'section'     => 'username',
1160     'description' => 'Disallow periods in usernames',
1161     'type'        => 'checkbox',
1162   },
1163
1164   {
1165     'key'         => 'username-nounderscore',
1166     'section'     => 'username',
1167     'description' => 'Disallow underscores in usernames',
1168     'type'        => 'checkbox',
1169   },
1170
1171   {
1172     'key'         => 'username-nodash',
1173     'section'     => 'username',
1174     'description' => 'Disallow dashes in usernames',
1175     'type'        => 'checkbox',
1176   },
1177
1178   {
1179     'key'         => 'username-uppercase',
1180     'section'     => 'username',
1181     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1182     'type'        => 'checkbox',
1183   },
1184
1185   { 
1186     'key'         => 'username-percent',
1187     'section'     => 'username',
1188     'description' => 'Allow the percent character (%) in usernames.',
1189     'type'        => 'checkbox',
1190   },
1191
1192   {
1193     'key'         => 'safe-part_bill_event',
1194     'section'     => 'UI',
1195     'description' => 'Validates invoice event expressions against a preset list.  Useful for webdemos, annoying to powerusers.',
1196     'type'        => 'checkbox',
1197   },
1198
1199   {
1200     'key'         => 'show_ss',
1201     'section'     => 'UI',
1202     'description' => 'Turns on display/collection of social security numbers in the web interface.  Sometimes required by electronic check (ACH) processors.',
1203     'type'        => 'checkbox',
1204   },
1205
1206   {
1207     'key'         => 'show_stateid',
1208     'section'     => 'UI',
1209     'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface.  Sometimes required by electronic check (ACH) processors.",
1210     'type'        => 'checkbox',
1211   },
1212
1213   {
1214     'key'         => 'show_bankstate',
1215     'section'     => 'UI',
1216     'description' => "Turns on display/collection of state for bank accounts in the web interface.  Sometimes required by electronic check (ACH) processors.",
1217     'type'        => 'checkbox',
1218   },
1219
1220   { 
1221     'key'         => 'agent_defaultpkg',
1222     'section'     => 'UI',
1223     'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1224     'type'        => 'checkbox',
1225   },
1226
1227   {
1228     'key'         => 'legacy_link',
1229     'section'     => 'UI',
1230     'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1231     'type'        => 'checkbox',
1232   },
1233
1234   {
1235     'key'         => 'legacy_link-steal',
1236     'section'     => 'UI',
1237     'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1238     'type'        => 'checkbox',
1239   },
1240
1241   {
1242     'key'         => 'queue_dangerous_controls',
1243     'section'     => 'UI',
1244     '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.',
1245     'type'        => 'checkbox',
1246   },
1247
1248   {
1249     'key'         => 'security_phrase',
1250     'section'     => 'password',
1251     'description' => 'Enable the tracking of a "security phrase" with each account.  Not recommended, as it is vulnerable to social engineering.',
1252     'type'        => 'checkbox',
1253   },
1254
1255   {
1256     'key'         => 'locale',
1257     'section'     => 'UI',
1258     'description' => 'Message locale',
1259     'type'        => 'select',
1260     'select_enum' => [ qw(en_US) ],
1261   },
1262
1263   {
1264     'key'         => 'signup_server-payby',
1265     'section'     => '',
1266     'description' => 'Acceptable payment types for the signup server',
1267     'type'        => 'selectmultiple',
1268     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1269   },
1270
1271   {
1272     'key'         => 'signup_server-default_agentnum',
1273     'section'     => '',
1274     'description' => 'Default agent for the signup server',
1275     'type'        => 'select-sub',
1276     'options_sub' => sub { require FS::Record;
1277                            require FS::agent;
1278                            map { $_->agentnum => $_->agent }
1279                                FS::Record::qsearch('agent', { disabled=>'' } );
1280                          },
1281     'option_sub'  => sub { require FS::Record;
1282                            require FS::agent;
1283                            my $agent = FS::Record::qsearchs(
1284                              'agent', { 'agentnum'=>shift }
1285                            );
1286                            $agent ? $agent->agent : '';
1287                          },
1288   },
1289
1290   {
1291     'key'         => 'signup_server-default_refnum',
1292     'section'     => '',
1293     'description' => 'Default advertising source for the signup server',
1294     'type'        => 'select-sub',
1295     'options_sub' => sub { require FS::Record;
1296                            require FS::part_referral;
1297                            map { $_->refnum => $_->referral }
1298                                FS::Record::qsearch( 'part_referral', 
1299                                                     { 'disabled' => '' }
1300                                                   );
1301                          },
1302     'option_sub'  => sub { require FS::Record;
1303                            require FS::part_referral;
1304                            my $part_referral = FS::Record::qsearchs(
1305                              'part_referral', { 'refnum'=>shift } );
1306                            $part_referral ? $part_referral->referral : '';
1307                          },
1308   },
1309
1310   {
1311     'key'         => 'signup_server-default_pkgpart',
1312     'section'     => '',
1313     'description' => 'Default package for the signup server',
1314     'type'        => 'select-sub',
1315     'options_sub' => sub { require FS::Record;
1316                            require FS::part_pkg;
1317                            map { $_->pkgpart => $_->pkg.' - '.$_->comment }
1318                                FS::Record::qsearch( 'part_pkg',
1319                                                     { 'disabled' => ''}
1320                                                   );
1321                          },
1322     'option_sub'  => sub { require FS::Record;
1323                            require FS::part_pkg;
1324                            my $part_pkg = FS::Record::qsearchs(
1325                              'part_pkg', { 'pkgpart'=>shift }
1326                            );
1327                            $part_pkg
1328                              ? $part_pkg->pkg.' - '.$part_pkg->comment
1329                              : '';
1330                          },
1331   },
1332
1333   {
1334     'key'         => 'signup_server-default_svcpart',
1335     'section'     => '',
1336     'description' => 'Default svcpart for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
1337     'type'        => 'select-sub',
1338     'options_sub' => sub { require FS::Record;
1339                            require FS::part_svc;
1340                            map { $_->svcpart => $_->svc }
1341                                FS::Record::qsearch( 'part_svc',
1342                                                     { 'disabled' => ''}
1343                                                   );
1344                          },
1345     'option_sub'  => sub { require FS::Record;
1346                            require FS::part_svc;
1347                            my $part_svc = FS::Record::qsearchs(
1348                              'part_svc', { 'svcpart'=>shift }
1349                            );
1350                            $part_svc ? $part_svc->svc : '';
1351                          },
1352   },
1353
1354   {
1355     'key'         => 'signup_server-service',
1356     'section'     => '',
1357     'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
1358     'type'        => 'select',
1359     'select_hash' => [
1360                        'svc_acct'  => 'Account (svc_acct)',
1361                        'svc_phone' => 'Phone number (svc_phone)',
1362                      ],
1363   },
1364
1365   {
1366     'key'         => 'selfservice_server-base_url',
1367     'section'     => '',
1368     'description' => 'Base URL for the self-service web interface - necessary for special provisioning widgets to find their way.',
1369     'type'        => 'text',
1370   },
1371
1372   {
1373     'key'         => 'show-msgcat-codes',
1374     'section'     => 'UI',
1375     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
1376     'type'        => 'checkbox',
1377   },
1378
1379   {
1380     'key'         => 'signup_server-realtime',
1381     'section'     => '',
1382     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1383     'type'        => 'checkbox',
1384   },
1385   {
1386     'key'         => 'signup_server-classnum2',
1387     'section'     => '',
1388     'description' => 'Package Class for first optional purchase',
1389     'type'        => 'select-sub',
1390     'options_sub' => sub { require FS::Record;
1391                            require FS::pkg_class;
1392                            map { $_->classnum => $_->classname }
1393                                FS::Record::qsearch('pkg_class', {} );
1394                          },
1395     'option_sub'  => sub { require FS::Record;
1396                            require FS::pkg_class;
1397                            my $pkg_class = FS::Record::qsearchs(
1398                              'pkg_class', { 'classnum'=>shift }
1399                            );
1400                            $pkg_class ? $pkg_class->classname : '';
1401                          },
1402   },
1403
1404   {
1405     'key'         => 'signup_server-classnum3',
1406     'section'     => '',
1407     'description' => 'Package Class for second optional purchase',
1408     'type'        => 'select-sub',
1409     'options_sub' => sub { require FS::Record;
1410                            require FS::pkg_class;
1411                            map { $_->classnum => $_->classname }
1412                                FS::Record::qsearch('pkg_class', {} );
1413                          },
1414     'option_sub'  => sub { require FS::Record;
1415                            require FS::pkg_class;
1416                            my $pkg_class = FS::Record::qsearchs(
1417                              'pkg_class', { 'classnum'=>shift }
1418                            );
1419                            $pkg_class ? $pkg_class->classname : '';
1420                          },
1421   },
1422
1423   {
1424     'key'         => 'backend-realtime',
1425     'section'     => '',
1426     'description' => 'Run billing for backend signups immediately.',
1427     'type'        => 'checkbox',
1428   },
1429
1430   {
1431     'key'         => 'declinetemplate',
1432     'section'     => 'billing',
1433     'description' => 'Template file for credit card decline emails.',
1434     'type'        => 'textarea',
1435   },
1436
1437   {
1438     'key'         => 'emaildecline',
1439     'section'     => 'billing',
1440     'description' => 'Enable emailing of credit card decline notices.',
1441     'type'        => 'checkbox',
1442   },
1443
1444   {
1445     'key'         => 'emaildecline-exclude',
1446     'section'     => 'billing',
1447     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1448     'type'        => 'textarea',
1449   },
1450
1451   {
1452     'key'         => 'cancelmessage',
1453     'section'     => 'billing',
1454     'description' => 'Template file for cancellation emails.',
1455     'type'        => 'textarea',
1456   },
1457
1458   {
1459     'key'         => 'cancelsubject',
1460     'section'     => 'billing',
1461     'description' => 'Subject line for cancellation emails.',
1462     'type'        => 'text',
1463   },
1464
1465   {
1466     'key'         => 'emailcancel',
1467     'section'     => 'billing',
1468     'description' => 'Enable emailing of cancellation notices.  Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
1469     'type'        => 'checkbox',
1470   },
1471
1472   {
1473     'key'         => 'require_cardname',
1474     'section'     => 'billing',
1475     'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1476     'type'        => 'checkbox',
1477   },
1478
1479   {
1480     'key'         => 'enable_taxclasses',
1481     'section'     => 'billing',
1482     'description' => 'Enable per-package tax classes',
1483     'type'        => 'checkbox',
1484   },
1485
1486   {
1487     'key'         => 'require_taxclasses',
1488     'section'     => 'billing',
1489     'description' => 'Require a taxclass to be entered for every package',
1490     'type'        => 'checkbox',
1491   },
1492
1493   {
1494     'key'         => 'enable_taxproducts',
1495     'section'     => 'billing',
1496     'description' => 'Enable per-package mapping to new style tax classes',
1497     'type'        => 'checkbox',
1498   },
1499
1500   {
1501     'key'         => 'ignore_incalculable_taxes',
1502     'section'     => 'billing',
1503     'description' => 'Prefer to invoice without tax over not billing at all',
1504     'type'        => 'checkbox',
1505   },
1506
1507   {
1508     'key'         => 'welcome_email',
1509     'section'     => '',
1510     'description' => 'Template file for welcome email.  Welcome emails are sent to the customer email invoice destination(s) each time a svc_acct record is created.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code></ul>',
1511     'type'        => 'textarea',
1512     'per_agent'   => 1,
1513   },
1514
1515   {
1516     'key'         => 'welcome_email-from',
1517     'section'     => '',
1518     'description' => 'From: address header for welcome email',
1519     'type'        => 'text',
1520     'per_agent'   => 1,
1521   },
1522
1523   {
1524     'key'         => 'welcome_email-subject',
1525     'section'     => '',
1526     'description' => 'Subject: header for welcome email',
1527     'type'        => 'text',
1528     'per_agent'   => 1,
1529   },
1530   
1531   {
1532     'key'         => 'welcome_email-mimetype',
1533     'section'     => '',
1534     'description' => 'MIME type for welcome email',
1535     'type'        => 'select',
1536     'select_enum' => [ 'text/plain', 'text/html' ],
1537     'per_agent'   => 1,
1538   },
1539
1540   {
1541     'key'         => 'welcome_letter',
1542     'section'     => '',
1543     '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>',
1544     'type'        => 'textarea',
1545   },
1546
1547   {
1548     'key'         => 'warning_email',
1549     'section'     => '',
1550     'description' => 'Template file for warning email.  Warning emails are sent to the customer email invoice destination(s) each time a svc_acct record has its usage drop below a threshold or 0.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code> <li><code>$column</code> <li><code>$amount</code> <li><code>$threshold</code></ul>',
1551     'type'        => 'textarea',
1552   },
1553
1554   {
1555     'key'         => 'warning_email-from',
1556     'section'     => '',
1557     'description' => 'From: address header for warning email',
1558     'type'        => 'text',
1559   },
1560
1561   {
1562     'key'         => 'warning_email-cc',
1563     'section'     => '',
1564     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1565     'type'        => 'text',
1566   },
1567
1568   {
1569     'key'         => 'warning_email-subject',
1570     'section'     => '',
1571     'description' => 'Subject: header for warning email',
1572     'type'        => 'text',
1573   },
1574   
1575   {
1576     'key'         => 'warning_email-mimetype',
1577     'section'     => '',
1578     'description' => 'MIME type for warning email',
1579     'type'        => 'select',
1580     'select_enum' => [ 'text/plain', 'text/html' ],
1581   },
1582
1583   {
1584     'key'         => 'payby',
1585     'section'     => 'billing',
1586     'description' => 'Available payment types.',
1587     'type'        => 'selectmultiple',
1588     'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1589   },
1590
1591   {
1592     'key'         => 'payby-default',
1593     'section'     => 'UI',
1594     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
1595     'type'        => 'select',
1596     'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1597   },
1598
1599   {
1600     'key'         => 'paymentforcedtobatch',
1601     'section'     => 'deprecated',
1602     'description' => 'See batch-enable_payby and realtime-disable_payby.  Used to (for CHEK): Cause per customer payment entry to be forced to a batch processor rather than performed realtime.',
1603     'type'        => 'checkbox',
1604   },
1605
1606   {
1607     'key'         => 'svc_acct-notes',
1608     'section'     => 'UI',
1609     'description' => 'Extra HTML to be displayed on the Account View screen.',
1610     'type'        => 'textarea',
1611   },
1612
1613   {
1614     'key'         => 'radius-password',
1615     'section'     => '',
1616     'description' => 'RADIUS attribute for plain-text passwords.',
1617     'type'        => 'select',
1618     'select_enum' => [ 'Password', 'User-Password' ],
1619   },
1620
1621   {
1622     'key'         => 'radius-ip',
1623     'section'     => '',
1624     'description' => 'RADIUS attribute for IP addresses.',
1625     'type'        => 'select',
1626     'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1627   },
1628
1629   {
1630     'key'         => 'svc_acct-alldomains',
1631     'section'     => '',
1632     '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.',
1633     'type'        => 'checkbox',
1634   },
1635
1636   {
1637     'key'         => 'dump-scpdest',
1638     'section'     => '',
1639     'description' => 'destination for scp database dumps: user@host:/path',
1640     'type'        => 'text',
1641   },
1642
1643   {
1644     'key'         => 'dump-pgpid',
1645     'section'     => '',
1646     '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.",
1647     'type'        => 'text',
1648   },
1649
1650   {
1651     'key'         => 'cvv-save',
1652     'section'     => 'billing',
1653     'description' => 'Save CVV2 information after the initial transaction for the selected credit card types.  Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option for any credit card types.',
1654     'type'        => 'selectmultiple',
1655     'select_enum' => \@card_types,
1656   },
1657
1658   {
1659     'key'         => 'allow_negative_charges',
1660     'section'     => 'billing',
1661     'description' => 'Allow negative charges.  Normally not used unless importing data from a legacy system that requires this.',
1662     'type'        => 'checkbox',
1663   },
1664   {
1665       'key'         => 'auto_unset_catchall',
1666       'section'     => '',
1667       '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.',
1668       'type'        => 'checkbox',
1669   },
1670
1671   {
1672     'key'         => 'system_usernames',
1673     'section'     => 'username',
1674     '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.',
1675     'type'        => 'textarea',
1676   },
1677
1678   {
1679     'key'         => 'cust_pkg-change_svcpart',
1680     'section'     => '',
1681     'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1682     'type'        => 'checkbox',
1683   },
1684
1685   {
1686     'key'         => 'disable_autoreverse',
1687     'section'     => 'BIND',
1688     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1689     'type'        => 'checkbox',
1690   },
1691
1692   {
1693     'key'         => 'svc_www-enable_subdomains',
1694     'section'     => '',
1695     'description' => 'Enable selection of specific subdomains for virtual host creation.',
1696     'type'        => 'checkbox',
1697   },
1698
1699   {
1700     'key'         => 'svc_www-usersvc_svcpart',
1701     'section'     => '',
1702     'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1703     'type'        => 'textarea',
1704   },
1705
1706   {
1707     'key'         => 'selfservice_server-primary_only',
1708     'section'     => '',
1709     'description' => 'Only allow primary accounts to access self-service functionality.',
1710     'type'        => 'checkbox',
1711   },
1712
1713   {
1714     'key'         => 'selfservice_server-phone_login',
1715     'section'     => '',
1716     'description' => 'Allow login to self-service with phone number and PIN.',
1717     'type'        => 'checkbox',
1718   },
1719
1720   {
1721     'key'         => 'selfservice_server-single_domain',
1722     'section'     => '',
1723     'description' => 'If specified, only use this one domain for self-service access.',
1724     'type'        => 'text',
1725   },
1726
1727   {
1728     'key'         => 'card_refund-days',
1729     'section'     => 'billing',
1730     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
1731     'type'        => 'text',
1732   },
1733
1734   {
1735     'key'         => 'agent-showpasswords',
1736     'section'     => '',
1737     'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1738     'type'        => 'checkbox',
1739   },
1740
1741   {
1742     'key'         => 'global_unique-username',
1743     'section'     => 'username',
1744     '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.',
1745     'type'        => 'select',
1746     'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1747   },
1748
1749   {
1750     'key'         => 'global_unique-phonenum',
1751     'section'     => '',
1752     '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.',
1753     'type'        => 'select',
1754     'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
1755   },
1756
1757   {
1758     'key'         => 'svc_external-skip_manual',
1759     'section'     => 'UI',
1760     '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).',
1761     'type'        => 'checkbox',
1762   },
1763
1764   {
1765     'key'         => 'svc_external-display_type',
1766     'section'     => 'UI',
1767     'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1768     'type'        => 'select',
1769     'select_enum' => [ 'generic', 'artera_turbo', ],
1770   },
1771
1772   {
1773     'key'         => 'ticket_system',
1774     'section'     => '',
1775     '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:1.7:Documentation:RT_Installation">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
1776     'type'        => 'select',
1777     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1778     'select_enum' => [ '', qw(RT_Internal RT_External) ],
1779   },
1780
1781   {
1782     'key'         => 'ticket_system-default_queueid',
1783     'section'     => '',
1784     'description' => 'Default queue used when creating new customer tickets.',
1785     'type'        => 'select-sub',
1786     'options_sub' => sub {
1787                            my $conf = new FS::Conf;
1788                            if ( $conf->config('ticket_system') ) {
1789                              eval "use FS::TicketSystem;";
1790                              die $@ if $@;
1791                              FS::TicketSystem->queues();
1792                            } else {
1793                              ();
1794                            }
1795                          },
1796     'option_sub'  => sub { 
1797                            my $conf = new FS::Conf;
1798                            if ( $conf->config('ticket_system') ) {
1799                              eval "use FS::TicketSystem;";
1800                              die $@ if $@;
1801                              FS::TicketSystem->queue(shift);
1802                            } else {
1803                              '';
1804                            }
1805                          },
1806   },
1807
1808   {
1809     'key'         => 'ticket_system-priority_reverse',
1810     'section'     => '',
1811     '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.',
1812     'type'        => 'checkbox',
1813   },
1814
1815   {
1816     'key'         => 'ticket_system-custom_priority_field',
1817     'section'     => '',
1818     'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1819     'type'        => 'text',
1820   },
1821
1822   {
1823     'key'         => 'ticket_system-custom_priority_field-values',
1824     'section'     => '',
1825     'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1826     'type'        => 'textarea',
1827   },
1828
1829   {
1830     'key'         => 'ticket_system-custom_priority_field_queue',
1831     'section'     => '',
1832     'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1833     'type'        => 'text',
1834   },
1835
1836   {
1837     'key'         => 'ticket_system-rt_external_datasrc',
1838     'section'     => '',
1839     '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>',
1840     'type'        => 'text',
1841
1842   },
1843
1844   {
1845     'key'         => 'ticket_system-rt_external_url',
1846     'section'     => '',
1847     'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
1848     'type'        => 'text',
1849   },
1850
1851   {
1852     'key'         => 'company_name',
1853     'section'     => 'required',
1854     'description' => 'Your company name',
1855     'type'        => 'text',
1856     'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
1857   },
1858
1859   {
1860     'key'         => 'company_address',
1861     'section'     => 'required',
1862     'description' => 'Your company address',
1863     'type'        => 'textarea',
1864     'per_agent'   => 1,
1865   },
1866
1867   {
1868     'key'         => 'address2-search',
1869     'section'     => 'UI',
1870     'description' => 'Enable a "Unit" search box which searches the second address field.  Useful for multi-tenant applications.  See also: cust_main-require_address2',
1871     'type'        => 'checkbox',
1872   },
1873
1874   {
1875     'key'         => 'cust_main-require_address2',
1876     'section'     => 'UI',
1877     'description' => 'Second address field is required (on service address only, if billing and service addresses differ).  Also enables "Unit" labeling of address2 on customer view and edit pages.  Useful for multi-tenant applications.  See also: address2-search',
1878     'type'        => 'checkbox',
1879   },
1880
1881   {
1882     'key'         => 'agent-ship_address',
1883     'section'     => '',
1884     '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.",
1885     'type'        => 'checkbox',
1886   },
1887
1888   { 'key'         => 'referral_credit',
1889     'section'     => 'deprecated',
1890     'description' => "Used to enable one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).  Replace with a billing event on appropriate packages.",
1891     'type'        => 'checkbox',
1892   },
1893
1894   { 'key'         => 'selfservice_server-cache_module',
1895     'section'     => '',
1896     '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.',
1897     'type'        => 'select',
1898     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
1899   },
1900
1901   {
1902     'key'         => 'hylafax',
1903     'section'     => 'billing',
1904     '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).',
1905     'type'        => [qw( checkbox textarea )],
1906   },
1907
1908   {
1909     'key'         => 'cust_bill-ftpformat',
1910     'section'     => 'billing',
1911     'description' => 'Enable FTP of raw invoice data - format.',
1912     'type'        => 'select',
1913     'select_enum' => [ '', 'default', 'billco', ],
1914   },
1915
1916   {
1917     'key'         => 'cust_bill-ftpserver',
1918     'section'     => 'billing',
1919     'description' => 'Enable FTP of raw invoice data - server.',
1920     'type'        => 'text',
1921   },
1922
1923   {
1924     'key'         => 'cust_bill-ftpusername',
1925     'section'     => 'billing',
1926     'description' => 'Enable FTP of raw invoice data - server.',
1927     'type'        => 'text',
1928   },
1929
1930   {
1931     'key'         => 'cust_bill-ftppassword',
1932     'section'     => 'billing',
1933     'description' => 'Enable FTP of raw invoice data - server.',
1934     'type'        => 'text',
1935   },
1936
1937   {
1938     'key'         => 'cust_bill-ftpdir',
1939     'section'     => 'billing',
1940     'description' => 'Enable FTP of raw invoice data - server.',
1941     'type'        => 'text',
1942   },
1943
1944   {
1945     'key'         => 'cust_bill-spoolformat',
1946     'section'     => 'billing',
1947     'description' => 'Enable spooling of raw invoice data - format.',
1948     'type'        => 'select',
1949     'select_enum' => [ '', 'default', 'billco', ],
1950   },
1951
1952   {
1953     'key'         => 'cust_bill-spoolagent',
1954     'section'     => 'billing',
1955     'description' => 'Enable per-agent spooling of raw invoice data.',
1956     'type'        => 'checkbox',
1957   },
1958
1959   {
1960     'key'         => 'svc_acct-usage_suspend',
1961     'section'     => 'billing',
1962     '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.',
1963     'type'        => 'checkbox',
1964   },
1965
1966   {
1967     'key'         => 'svc_acct-usage_unsuspend',
1968     'section'     => 'billing',
1969     '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.',
1970     'type'        => 'checkbox',
1971   },
1972
1973   {
1974     'key'         => 'svc_acct-usage_threshold',
1975     'section'     => 'billing',
1976     '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.  Defaults to 80.',
1977     'type'        => 'text',
1978   },
1979
1980   {
1981     'key'         => 'cust-fields',
1982     'section'     => 'UI',
1983     'description' => 'Which customer fields to display on reports by default',
1984     'type'        => 'select',
1985     'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
1986   },
1987
1988   {
1989     'key'         => 'cust_pkg-display_times',
1990     'section'     => 'UI',
1991     'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
1992     'type'        => 'checkbox',
1993   },
1994
1995   {
1996     'key'         => 'cust_pkg-always_show_location',
1997     'section'     => 'UI',
1998     'description' => "Always display package locations, even when they're all the default service address.",
1999     'type'        => 'checkbox',
2000   },
2001
2002   {
2003     'key'         => 'svc_acct-edit_uid',
2004     'section'     => 'shell',
2005     'description' => 'Allow UID editing.',
2006     'type'        => 'checkbox',
2007   },
2008
2009   {
2010     'key'         => 'svc_acct-edit_gid',
2011     'section'     => 'shell',
2012     'description' => 'Allow GID editing.',
2013     'type'        => 'checkbox',
2014   },
2015
2016   {
2017     'key'         => 'zone-underscore',
2018     'section'     => 'BIND',
2019     'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
2020     'type'        => 'checkbox',
2021   },
2022
2023   {
2024     'key'         => 'echeck-nonus',
2025     'section'     => 'billing',
2026     'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2027     'type'        => 'checkbox',
2028   },
2029
2030   {
2031     'key'         => 'voip-cust_cdr_spools',
2032     'section'     => '',
2033     'description' => 'Enable the per-customer option for individual CDR spools.',
2034     'type'        => 'checkbox',
2035   },
2036
2037   {
2038     'key'         => 'voip-cust_cdr_squelch',
2039     'section'     => '',
2040     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2041     'type'        => 'checkbox',
2042   },
2043
2044   {
2045     'key'         => 'svc_forward-arbitrary_dst',
2046     'section'     => '',
2047     '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.",
2048     'type'        => 'checkbox',
2049   },
2050
2051   {
2052     'key'         => 'tax-ship_address',
2053     'section'     => 'billing',
2054     'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
2055     'type'        => 'checkbox',
2056   }
2057 ,
2058   {
2059     'key'         => 'tax-pkg_address',
2060     'section'     => 'billing',
2061     '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).',
2062     'type'        => 'checkbox',
2063   },
2064
2065   {
2066     'key'         => 'invoice-ship_address',
2067     'section'     => 'billing',
2068     'description' => 'Enable this switch to include the ship address on the invoice.',
2069     'type'        => 'checkbox',
2070   },
2071
2072   {
2073     'key'         => 'invoice-unitprice',
2074     'section'     => 'billing',
2075     'description' => 'This switch enables unit pricing on the invoice.',
2076     'type'        => 'checkbox',
2077   },
2078
2079   {
2080     'key'         => 'postal_invoice-fee_pkgpart',
2081     'section'     => 'billing',
2082     'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2083     'type'        => 'select-sub',
2084     'options_sub' => sub { require FS::Record;
2085                            require FS::part_pkg;
2086                            map { $_->pkgpart => $_->pkg }
2087                                FS::Record::qsearch('part_pkg', { disabled=>'' } );
2088                          },
2089     'option_sub'  => sub { require FS::Record;
2090                            require FS::part_pkg;
2091                            my $part_pkg = FS::Record::qsearchs(
2092                              'part_pkg', { 'pkgpart'=>shift }
2093                            );
2094                            $part_pkg ? $part_pkg->pkg : '';
2095                          },
2096   },
2097
2098   {
2099     'key'         => 'postal_invoice-recurring_only',
2100     'section'     => 'billing',
2101     'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2102     'type'        => 'checkbox',
2103   },
2104
2105   {
2106     'key'         => 'batch-enable',
2107     'section'     => 'deprecated', #make sure batch-enable_payby is set for
2108                                    #everyone before removing
2109     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2110     'type'        => 'checkbox',
2111   },
2112
2113   {
2114     'key'         => 'batch-enable_payby',
2115     'section'     => 'billing',
2116     'description' => 'Enable batch processing for the specified payment types.',
2117     'type'        => 'selectmultiple',
2118     'select_enum' => [qw( CARD CHEK )],
2119   },
2120
2121   {
2122     'key'         => 'realtime-disable_payby',
2123     'section'     => 'billing',
2124     'description' => 'Disable realtime processing for the specified payment types.',
2125     'type'        => 'selectmultiple',
2126     'select_enum' => [qw( CARD CHEK )],
2127   },
2128
2129   {
2130     'key'         => 'batch-default_format',
2131     'section'     => 'billing',
2132     'description' => 'Default format for batches.',
2133     'type'        => 'select',
2134     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2135                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2136                        'ach-spiritone',
2137                     ]
2138   },
2139
2140   {
2141     'key'         => 'batch-fixed_format-CARD',
2142     'section'     => 'billing',
2143     'description' => 'Fixed (unchangeable) format for credit card batches.',
2144     'type'        => 'select',
2145     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2146                        'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
2147   },
2148
2149   {
2150     'key'         => 'batch-fixed_format-CHEK',
2151     'section'     => 'billing',
2152     'description' => 'Fixed (unchangeable) format for electronic check batches.',
2153     'type'        => 'select',
2154     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2155                        'ach-spiritone',
2156                      ]
2157   },
2158
2159   {
2160     'key'         => 'batch-increment_expiration',
2161     'section'     => 'billing',
2162     'description' => 'Increment expiration date years in batches until cards are current.  Make sure this is acceptable to your batching provider before enabling.',
2163     'type'        => 'checkbox'
2164   },
2165
2166   {
2167     'key'         => 'batchconfig-BoM',
2168     'section'     => 'billing',
2169     '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',
2170     'type'        => 'textarea',
2171   },
2172
2173   {
2174     'key'         => 'batchconfig-PAP',
2175     'section'     => 'billing',
2176     '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',
2177     'type'        => 'textarea',
2178   },
2179
2180   {
2181     'key'         => 'batchconfig-csv-chase_canada-E-xactBatch',
2182     'section'     => 'billing',
2183     'description' => 'Gateway ID for Chase Canada E-xact batching',
2184     'type'        => 'text',
2185   },
2186
2187   {
2188     'key'         => 'payment_history-years',
2189     'section'     => 'UI',
2190     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
2191     'type'        => 'text',
2192   },
2193
2194   {
2195     'key'         => 'cust_main-use_comments',
2196     'section'     => 'UI',
2197     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
2198     'type'        => 'checkbox',
2199   },
2200
2201   {
2202     'key'         => 'cust_main-disable_notes',
2203     'section'     => 'UI',
2204     'description' => 'Disable new style customer notes - timestamped and user identified customer notes.  Useful in tracking who did what.',
2205     'type'        => 'checkbox',
2206   },
2207
2208   {
2209     'key'         => 'cust_main_note-display_times',
2210     'section'     => 'UI',
2211     'description' => 'Display full timestamps (not just dates) for customer notes.',
2212     'type'        => 'checkbox',
2213   },
2214
2215   {
2216     'key'         => 'cust_main-ticket_statuses',
2217     'section'     => 'UI',
2218     'description' => 'Show tickets with these statuses on the customer view page.',
2219     'type'        => 'selectmultiple',
2220     'select_enum' => [qw( new open stalled resolved rejected deleted )],
2221   },
2222
2223   {
2224     'key'         => 'cust_main-max_tickets',
2225     'section'     => 'UI',
2226     'description' => 'Maximum number of tickets to show on the customer view page.',
2227     'type'        => 'text',
2228   },
2229
2230   {
2231     'key'         => 'cust_main-skeleton_tables',
2232     'section'     => '',
2233     'description' => 'Tables which will have skeleton records inserted into them for each customer.  Syntax for specifying tables is unfortunately a tricky perl data structure for now.',
2234     'type'        => 'textarea',
2235   },
2236
2237   {
2238     'key'         => 'cust_main-skeleton_custnum',
2239     'section'     => '',
2240     'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2241     'type'        => 'text',
2242   },
2243
2244   {
2245     'key'         => 'cust_main-enable_birthdate',
2246     'section'     => 'UI',
2247     'descritpion' => 'Enable tracking of a birth date with each customer record',
2248     'type'        => 'checkbox',
2249   },
2250
2251   {
2252     'key'         => 'support-key',
2253     'section'     => '',
2254     'description' => 'A support key enables access to commercial services delivered over the network, such as the payroll module, access to the internal ticket system, priority support and optional backups.',
2255     'type'        => 'text',
2256   },
2257
2258   {
2259     'key'         => 'card-types',
2260     'section'     => 'billing',
2261     'description' => 'Select one or more card types to enable only those card types.  If no card types are selected, all card types are available.',
2262     'type'        => 'selectmultiple',
2263     'select_enum' => \@card_types,
2264   },
2265
2266   {
2267     'key'         => 'disable-fuzzy',
2268     'section'     => 'UI',
2269     'description' => 'Disable fuzzy searching.  Speeds up searching for large sites, but only shows exact matches.',
2270     'type'        => 'checkbox',
2271   },
2272
2273   { 'key'         => 'pkg_referral',
2274     'section'     => '',
2275     'description' => 'Enable package-specific advertising sources.',
2276     'type'        => 'checkbox',
2277   },
2278
2279   { 'key'         => 'pkg_referral-multiple',
2280     'section'     => '',
2281     'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
2282     'type'        => 'checkbox',
2283   },
2284
2285   {
2286     'key'         => 'dashboard-toplist',
2287     'section'     => 'UI',
2288     'description' => 'List of items to display on the top of the front page',
2289     'type'        => 'textarea',
2290   },
2291
2292   {
2293     'key'         => 'impending_recur_template',
2294     'section'     => 'billing',
2295     'description' => 'Template file for alerts about looming first time recurrant billing.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitition language.  Also see packages with a <a href="../browse/part_pkg.cgi">flat price plan</a>  The following variables are available<ul><li><code>$packages</code> allowing <code>$packages->[0]</code> thru <code>$packages->[n]</code> <li><code>$package</code> the first package, same as <code>$packages->[0]</code> <li><code>$recurdates</code> allowing <code>$recurdates->[0]</code> thru <code>$recurdates->[n]</code> <li><code>$recurdate</code> the first recurdate, same as <code>$recurdate->[0]</code> <li><code>$first</code> <li><code>$last</code></ul>',
2296 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2297     'type'        => 'textarea',
2298   },
2299
2300   {
2301     'key'         => 'logo.png',
2302     'section'     => 'billing',  #? 
2303     'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
2304     'type'        => 'image',
2305     'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
2306                         #old-style editor anyway...?
2307   },
2308
2309   {
2310     'key'         => 'logo.eps',
2311     'section'     => 'billing',  #? 
2312     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
2313     'type'        => 'image',
2314     'per_agent'   => 1, #XXX as above, kinda
2315   },
2316
2317   {
2318     'key'         => 'selfservice-ignore_quantity',
2319     'section'     => '',
2320     'description' => 'Ignores service quantity restrictions in self-service context.  Strongly not recommended - just set your quantities correctly in the first place.',
2321     'type'        => 'checkbox',
2322   },
2323
2324   {
2325     'key'         => 'selfservice-session_timeout',
2326     'section'     => '',
2327     'description' => 'Self-service session timeout.  Defaults to 1 hour.',
2328     'type'        => 'select',
2329     'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
2330   },
2331
2332   {
2333     'key'         => 'disable_setup_suspended_pkgs',
2334     'section'     => 'billing',
2335     'description' => 'Disables charging of setup fees for suspended packages.',
2336     'type'       => 'checkbox',
2337   },
2338
2339   {
2340     'key' => 'password-generated-allcaps',
2341     'section' => 'password',
2342     'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2343     'type' => 'checkbox',
2344   },
2345
2346   {
2347     'key'         => 'datavolume-forcemegabytes',
2348     'section'     => 'UI',
2349     'description' => 'All data volumes are expressed in megabytes',
2350     'type'        => 'checkbox',
2351   },
2352
2353   {
2354     'key'         => 'datavolume-significantdigits',
2355     'section'     => 'UI',
2356     'description' => 'number of significant digits to use to represent data volumes',
2357     'type'        => 'text',
2358   },
2359
2360   {
2361     'key'         => 'disable_void_after',
2362     'section'     => 'billing',
2363     'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2364     'type'        => 'text',
2365   },
2366
2367   {
2368     'key'         => 'disable_line_item_date_ranges',
2369     'section'     => 'billing',
2370     'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2371     'type'        => 'checkbox',
2372   },
2373
2374   {
2375     'key'         => 'support_packages',
2376     'section'     => '',
2377     '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...
2378     'type'        => 'textarea',
2379   },
2380
2381   {
2382     'key'         => 'cust_main-require_phone',
2383     'section'     => '',
2384     'description' => 'Require daytime or night phone for all customer records.',
2385     'type'        => 'checkbox',
2386   },
2387
2388   {
2389     'key'         => 'cust_main-require_invoicing_list_email',
2390     'section'     => '',
2391     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
2392     'type'        => 'checkbox',
2393   },
2394
2395   {
2396     'key'         => 'svc_acct-display_paid_time_remaining',
2397     'section'     => '',
2398     'description' => 'Show paid time remaining in addition to time remaining.',
2399     'type'        => 'checkbox',
2400   },
2401
2402   {
2403     'key'         => 'cancel_credit_type',
2404     'section'     => 'billing',
2405     'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
2406     'type'        => 'select-sub',
2407     'options_sub' => sub { require FS::Record;
2408                            require FS::reason_type;
2409                            map { $_->typenum => $_->type }
2410                                FS::Record::qsearch('reason_type', { class=>'R' } );
2411                          },
2412     'option_sub'  => sub { require FS::Record;
2413                            require FS::reason_type;
2414                            my $reason_type = FS::Record::qsearchs(
2415                              'reason_type', { 'typenum' => shift }
2416                            );
2417                            $reason_type ? $reason_type->type : '';
2418                          },
2419   },
2420
2421   {
2422     'key'         => 'referral_credit_type',
2423     'section'     => 'deprecated',
2424     'description' => 'Used to be the group to use for new, automatically generated credit reasons resulting from referrals.  Now set in a package billing event for the referral.',
2425     'type'        => 'select-sub',
2426     'options_sub' => sub { require FS::Record;
2427                            require FS::reason_type;
2428                            map { $_->typenum => $_->type }
2429                                FS::Record::qsearch('reason_type', { class=>'R' } );
2430                          },
2431     'option_sub'  => sub { require FS::Record;
2432                            require FS::reason_type;
2433                            my $reason_type = FS::Record::qsearchs(
2434                              'reason_type', { 'typenum' => shift }
2435                            );
2436                            $reason_type ? $reason_type->type : '';
2437                          },
2438   },
2439
2440   {
2441     'key'         => 'signup_credit_type',
2442     'section'     => 'billing',
2443     'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
2444     'type'        => 'select-sub',
2445     'options_sub' => sub { require FS::Record;
2446                            require FS::reason_type;
2447                            map { $_->typenum => $_->type }
2448                                FS::Record::qsearch('reason_type', { class=>'R' } );
2449                          },
2450     'option_sub'  => sub { require FS::Record;
2451                            require FS::reason_type;
2452                            my $reason_type = FS::Record::qsearchs(
2453                              'reason_type', { 'typenum' => shift }
2454                            );
2455                            $reason_type ? $reason_type->type : '';
2456                          },
2457   },
2458
2459   {
2460     'key'         => 'cust_main-agent_custid-format',
2461     'section'     => '',
2462     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
2463     'type'        => 'select',
2464     'select_hash' => [
2465                        ''      => 'Numeric only',
2466                        'ww?d+' => 'Numeric with one or two letter prefix',
2467                      ],
2468   },
2469
2470   {
2471     'key'         => 'card_masking_method',
2472     'section'     => 'UI',
2473     '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.',
2474     'type'        => 'select',
2475     'select_hash' => [
2476                        ''            => '123456xxxxxx1234',
2477                        'first6last2' => '123456xxxxxxxx12',
2478                        'first4last4' => '1234xxxxxxxx1234',
2479                        'first4last2' => '1234xxxxxxxxxx12',
2480                        'first2last4' => '12xxxxxxxxxx1234',
2481                        'first2last2' => '12xxxxxxxxxxxx12',
2482                        'first0last4' => 'xxxxxxxxxxxx1234',
2483                        'first0last2' => 'xxxxxxxxxxxxxx12',
2484                      ],
2485   },
2486
2487   {
2488     'key'         => 'disable_previous_balance',
2489     'section'     => 'billing',
2490     'description' => 'Disable inclusion of previous balancem payment, and credit lines on invoices',
2491     'type'        => 'checkbox',
2492   },
2493
2494   {
2495     'key'         => 'previous_balance-summary_only',
2496     'section'     => 'billing',
2497     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
2498     'type'        => 'checkbox',
2499   },
2500
2501   {
2502     'key'         => 'usps_webtools-userid',
2503     'section'     => 'UI',
2504     '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.',
2505     'type'        => 'text',
2506   },
2507
2508   {
2509     'key'         => 'usps_webtools-password',
2510     'section'     => 'UI',
2511     '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.',
2512     'type'        => 'text',
2513   },
2514
2515   {
2516     'key'         => 'cust_main-auto_standardize_address',
2517     'section'     => 'UI',
2518     'description' => 'When using USPS web tools, automatically standardize the address without asking.',
2519     'type'        => 'checkbox',
2520   },
2521
2522   {
2523     'key'         => 'disable_acl_changes',
2524     'section'     => '',
2525     'description' => 'Disable all ACL changes, for demos.',
2526     'type'        => 'checkbox',
2527   },
2528
2529   {
2530     'key'         => 'cust_main-edit_agent_custid',
2531     'section'     => 'UI',
2532     'description' => 'Enable editing of the agent_custid field.',
2533     'type'        => 'checkbox',
2534   },
2535
2536   {
2537     'key'         => 'cust_main-default_agent_custid',
2538     'section'     => 'UI',
2539     'description' => 'Display the agent_custid field instead of the custnum field.',
2540     'type'        => 'checkbox',
2541   },
2542
2543   {
2544     'key'         => 'cust_main-auto_agent_custid',
2545     'section'     => 'UI',
2546     'description' => 'Automatically assign an agent_custid - select format',
2547     'type'        => 'select',
2548     'select_hash' => [ '' => 'No',
2549                        '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
2550                      ],
2551   },
2552
2553   {
2554     'key'         => 'cust_main-default_areacode',
2555     'section'     => 'UI',
2556     'description' => 'Default area code for customers.',
2557     'type'        => 'text',
2558   },
2559
2560   {
2561     'key'         => 'mcp_svcpart',
2562     'section'     => '',
2563     'description' => 'Master Control Program svcpart.  Leave this blank.',
2564     'type'        => 'text',
2565   },
2566
2567   {
2568     'key'         => 'cust_bill-max_same_services',
2569     'section'     => 'billing',
2570     '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.',
2571     'type'        => 'text',
2572   },
2573
2574   {
2575     'key'         => 'suspend_email_admin',
2576     'section'     => '',
2577     'description' => 'Destination admin email address to enable suspension notices',
2578     'type'        => 'text',
2579   },
2580
2581   {
2582     'key'         => 'email_report-subject',
2583     'section'     => '',
2584     'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
2585     'type'        => 'text',
2586   },
2587
2588   {
2589     'key'         => 'selfservice-head',
2590     'section'     => '',
2591     'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
2592     'type'        => 'textarea', #htmlarea?
2593   },
2594
2595
2596   {
2597     'key'         => 'selfservice-body_header',
2598     'section'     => '',
2599     'description' => 'HTML header for the self-service interface',
2600     'type'        => 'textarea', #htmlarea?
2601   },
2602
2603   {
2604     'key'         => 'selfservice-body_footer',
2605     'section'     => '',
2606     'description' => 'HTML header for the self-service interface',
2607     'type'        => 'textarea', #htmlarea?
2608   },
2609
2610
2611   {
2612     'key'         => 'selfservice-body_bgcolor',
2613     'section'     => '',
2614     'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
2615     'type'        => 'text',
2616   },
2617
2618   {
2619     'key'         => 'selfservice-box_bgcolor',
2620     'section'     => '',
2621     'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0"',
2622     'type'        => 'text',
2623   },
2624
2625   {
2626     'key'         => 'signup-no_company',
2627     'section'     => '',
2628     'description' => "Don't display a field for company name on signup.",
2629     'type'        => 'checkbox',
2630   },
2631
2632   {
2633     'key'         => 'signup-recommend_email',
2634     'section'     => '',
2635     'description' => 'Encourage the entry of an invoicing email address on signup.',
2636     'type'        => 'checkbox',
2637   },
2638
2639   {
2640     'key'         => 'signup-recommend_daytime',
2641     'section'     => '',
2642     'description' => 'Encourage the entry of a daytime phone number  invoicing email address on signup.',
2643     'type'        => 'checkbox',
2644   },
2645
2646   {
2647     'key'         => 'svc_phone-radius-default_password',
2648     'section'     => '',
2649     'description' => 'Default password when exporting svc_phone records to RADIUS',
2650     'type'        => 'text',
2651   },
2652
2653   {
2654     'key'         => 'svc_phone-allow_alpha_phonenum',
2655     'section'     => '',
2656     'description' => 'Allow letters in phone numbers.',
2657     'type'        => 'checkbox',
2658   },
2659
2660   {
2661     'key'         => 'default_phone_countrycode',
2662     'section'     => '',
2663     'description' => 'Default countrcode',
2664     'type'        => 'text',
2665   },
2666
2667   {
2668     'key'         => 'cdr-charged_party-accountcode',
2669     'section'     => '',
2670     'description' => 'Set the charged_party field of CDRs to the accountcode.',
2671     'type'        => 'checkbox',
2672   },
2673
2674   {
2675     'key'         => 'cdr-charged_party_rewrite',
2676     'section'     => '',
2677     '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.',
2678     'type'        => 'checkbox',
2679   },
2680
2681   {
2682     'key'         => 'cdr-taqua-da_rewrite',
2683     'section'     => '',
2684     '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.',
2685     'type'        => 'text',
2686   },
2687
2688   {
2689     'key'         => 'cust_pkg-show_autosuspend',
2690     'section'     => 'UI',
2691     'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
2692     'type'       => 'checkbox',
2693   },
2694
2695   {
2696     'key'         => 'cdr-asterisk_forward_rewrite',
2697     'section'     => '',
2698     '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").',
2699     'type'        => 'checkbox',
2700   },
2701
2702 );
2703
2704 1;