3 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
10 use FS::Conf_compat17;
13 use FS::Record qw(qsearch qsearchs);
14 use FS::UID qw(dbh datasrc use_confcompat);
16 $base_dir = '%%%FREESIDE_CONF%%%';
22 FS::Conf - Freeside configuration values
30 $value = $conf->config('key');
31 @list = $conf->config('key');
32 $bool = $conf->exists('key');
35 $conf->set('key' => 'value');
38 @config_items = $conf->config_items;
42 Read and write Freeside configuration values. Keys currently map to filenames,
43 but this may change in the future.
51 Create a new configuration object.
57 my($class) = ref($proto) || $proto;
58 my($self) = { 'base_dir' => $base_dir };
59 bless ($self, $class);
64 Returns the base directory. By default this is /usr/local/etc/freeside.
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 =~ /^(.*)$/;
79 =item config KEY [ AGENTNUM ]
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.
88 my ($self, $method) = (shift, shift);
89 carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
91 my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
95 # needs a non _ name, called externally by config-view now (and elsewhere?)
97 my($self,$name,$agentnum)=@_;
98 my $hashref = { 'name' => $name };
99 $hashref->{agentnum} = $agentnum;
100 local $FS::Record::conf = undef; # XXX evil hack prevents recursion
101 my $cv = FS::Record::qsearchs('conf', $hashref);
102 if (!$cv && defined($agentnum) && $agentnum) {
103 $hashref->{agentnum} = '';
104 $cv = FS::Record::qsearchs('conf', $hashref);
111 return $self->_usecompat('config', @_) if use_confcompat;
113 my($name, $agentnum)=@_;
115 carp "FS::Conf->config($name, $agentnum) called"
118 my $cv = $self->_config($name, $agentnum) or return;
123 (split "\n", $v, -1);
125 (split("\n", $cv->value))[0];
129 =item config_binary KEY [ AGENTNUM ]
131 Returns the exact scalar value for key.
137 return $self->_usecompat('config_binary', @_) if use_confcompat;
139 my($name,$agentnum)=@_;
140 my $cv = $self->_config($name, $agentnum) or return;
141 decode_base64($cv->value);
144 =item exists KEY [ AGENTNUM ]
146 Returns true if the specified key exists, even if the corresponding value
153 return $self->_usecompat('exists', @_) if use_confcompat;
155 my($name, $agentnum)=@_;
157 carp "FS::Conf->exists($name, $agentnum) called"
160 defined($self->_config($name, $agentnum));
163 =item config_orbase KEY SUFFIX
165 Returns the configuration value or values (depending on context) for
166 KEY_SUFFIX, if it exists, otherwise for KEY
170 # outmoded as soon as we shift to agentnum based config values
171 # well, mostly. still useful for e.g. late notices, etc. in that we want
172 # these to fall back to standard values
175 return $self->_usecompat('config_orbase', @_) if use_confcompat;
177 my( $name, $suffix ) = @_;
178 if ( $self->exists("${name}_$suffix") ) {
179 $self->config("${name}_$suffix");
181 $self->config($name);
185 =item key_orbase KEY SUFFIX
187 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
188 KEY. Useful for determining which exact configuration option is returned by
195 #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
197 my( $name, $suffix ) = @_;
198 if ( $self->exists("${name}_$suffix") ) {
205 =item invoice_templatenames
207 Returns all possible invoice template names.
211 sub invoice_templatenames {
214 my %templatenames = ();
215 foreach my $item ( $self->config_items ) {
216 foreach my $base ( @base_items ) {
217 my( $main, $ext) = split(/\./, $base);
218 $ext = ".$ext" if $ext;
219 if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
220 $templatenames{$1}++;
225 sort keys %templatenames;
229 =item touch KEY [ AGENT ];
231 Creates the specified configuration key if it does not exist.
237 return $self->_usecompat('touch', @_) if use_confcompat;
239 my($name, $agentnum) = @_;
240 unless ( $self->exists($name, $agentnum) ) {
241 $self->set($name, '', $agentnum);
245 =item set KEY VALUE [ AGENTNUM ];
247 Sets the specified configuration key to the given value.
253 return $self->_usecompat('set', @_) if use_confcompat;
255 my($name, $value, $agentnum) = @_;
259 warn "[FS::Conf] SET $name\n" if $DEBUG;
261 my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
262 my $new = new FS::conf { $old ? $old->hash
263 : ('name' => $name, 'agentnum' => $agentnum)
269 $error = $new->replace($old);
271 $error = $new->insert;
274 die "error setting configuration value: $error \n"
279 =item set_binary KEY VALUE [ AGENTNUM ]
281 Sets the specified configuration key to an exact scalar value which
282 can be retrieved with config_binary.
288 return if use_confcompat;
290 my($name, $value, $agentnum)=@_;
291 $self->set($name, encode_base64($value), $agentnum);
294 =item delete KEY [ AGENTNUM ];
296 Deletes the specified configuration key.
302 return $self->_usecompat('delete', @_) if use_confcompat;
304 my($name, $agentnum) = @_;
305 if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
306 warn "[FS::Conf] DELETE $name\n";
308 my $oldAutoCommit = $FS::UID::AutoCommit;
309 local $FS::UID::AutoCommit = 0;
312 my $error = $cv->delete;
315 $dbh->rollback if $oldAutoCommit;
316 die "error setting configuration value: $error \n"
319 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
324 =item import_config_item CONFITEM DIR
326 Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
327 the database as a conf record (see L<FS::conf>). Imports from the file
328 in the directory DIR.
332 sub import_config_item {
333 my ($self,$item,$dir) = @_;
334 my $key = $item->key;
335 if ( -e "$dir/$key" && ! use_confcompat ) {
336 warn "Inserting $key\n" if $DEBUG;
338 my $value = readline(new IO::File "$dir/$key");
339 if ($item->type =~ /^(binary|image)$/ ) {
340 $self->set_binary($key, $value);
342 $self->set($key, $value);
345 warn "Not inserting $key\n" if $DEBUG;
349 =item verify_config_item CONFITEM DIR
351 Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
352 the database to the legacy file value in DIR.
356 sub verify_config_item {
357 return '' if use_confcompat;
358 my ($self,$item,$dir) = @_;
359 my $key = $item->key;
360 my $type = $item->type;
362 my $compat = new FS::Conf_compat17 $dir;
365 $error .= "$key fails existential comparison; "
366 if $self->exists($key) xor $compat->exists($key);
368 if ( $type !~ /^(binary|image)$/ ) {
372 $error .= "$key fails scalar comparison; "
373 unless scalar($self->config($key)) eq scalar($compat->config($key));
376 my (@new) = $self->config($key);
377 my (@old) = $compat->config($key);
378 unless ( scalar(@new) == scalar(@old)) {
379 $error .= "$key fails list comparison; ";
382 foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
383 $error .= "$key fails list comparison; "
389 $error .= "$key fails binary comparison; "
390 unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
394 #remove deprecated config on our own terms, not freeside-upgrade's
395 # if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
397 # for ( @config_items ) { $proto = $_; last if $proto->key eq $key; }
398 # unless ($proto->key eq $key) {
399 # warn "removed config item $error\n" if $DEBUG;
407 #item _orbase_items OPTIONS
409 #Returns all of the possible extensible config items as FS::ConfItem objects.
410 #See #L<FS::ConfItem>. OPTIONS consists of name value pairs. Possible
413 # dir - the directory to search for configuration option files instead
414 # of using the conf records in the database
420 my ($self, %opt) = @_;
422 my $listmaker = sub { my $v = shift;
424 if ( $v =~ /\.(png|eps)$/ ) {
430 FS::Record::qsearch( 'conf',
433 "WHERE name LIKE '$v' ESCAPE '!'"
437 if (exists($opt{dir}) && $opt{dir}) {
438 $listmaker = sub { my $v = shift;
439 if ( $v =~ /\.(png|eps)$/ ) {
444 map { basename $_ } glob($opt{dir}. "/$v" );
451 for ( @config_items ) { $proto = $_; last if $proto->key eq $base; }
452 die "don't know about $base items" unless $proto->key eq $base;
454 map { new FS::ConfItem {
456 'base_key' => $proto->key,
457 'section' => $proto->section,
458 '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.',
459 'type' => $proto->type,
461 } &$listmaker($base);
468 Returns all of the possible global/default configuration items as
469 FS::ConfItem objects. See L<FS::ConfItem>.
475 return $self->_usecompat('config_items', @_) if use_confcompat;
477 ( @config_items, $self->_orbase_items(@_) );
486 =item init-config DIR
488 Imports the configuration items from DIR (1.7 compatible)
489 to conf records in the database.
497 local $FS::UID::use_confcompat = 0;
498 my $conf = new FS::Conf;
499 foreach my $item ( $conf->config_items(dir => $dir) ) {
500 $conf->import_config_item($item, $dir);
501 my $error = $conf->verify_config_item($item, $dir);
502 return $error if $error;
505 my $compat = new FS::Conf_compat17 $dir;
506 foreach my $item ( $compat->config_items ) {
507 my $error = $conf->verify_config_item($item, $dir);
508 return $error if $error;
512 $FS::UID::use_confcompat = 0;
520 If this was more than just crud that will never be useful outside Freeside I'd
521 worry that config_items is freeside-specific and icky.
525 "Configuration" in the web interface (config/config.cgi).
529 #Business::CreditCard
534 "American Express card",
535 "Diner's Club/Carte Blanche",
546 invoice_latexreturnaddress
548 invoice_latexsmallfooter
552 invoice_htmlreturnaddress
559 @config_items = map { new FS::ConfItem $_ } (
563 'section' => 'deprecated',
564 'description' => 'This configuration option is no longer used. See <a href="#invoice_template">invoice_template</a> instead.',
569 'key' => 'alert_expiration',
570 'section' => 'billing',
571 'description' => 'Enable alerts about billing method expiration.',
572 'type' => 'checkbox',
577 'key' => 'alerter_template',
578 'section' => 'billing',
579 '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.',
580 'type' => 'textarea',
586 #not actually deprecated yet
587 #'section' => 'deprecated',
588 #'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',
590 'description' => 'IP address to assign to new virtual hosts',
595 'key' => 'encryption',
596 'section' => 'billing',
597 'description' => 'Enable encryption of credit cards.',
598 'type' => 'checkbox',
602 'key' => 'encryptionmodule',
603 'section' => 'billing',
604 'description' => 'Use which module for encryption?',
609 'key' => 'encryptionpublickey',
610 'section' => 'billing',
611 'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
612 'type' => 'textarea',
616 'key' => 'encryptionprivatekey',
617 'section' => 'billing',
618 '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.',
619 'type' => 'textarea',
623 'key' => 'business-onlinepayment',
624 'section' => 'billing',
625 '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.',
626 'type' => 'textarea',
630 'key' => 'business-onlinepayment-ach',
631 'section' => 'billing',
632 '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.',
633 'type' => 'textarea',
637 'key' => 'business-onlinepayment-namespace',
638 'section' => 'billing',
639 'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
642 'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
643 'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
648 'key' => 'business-onlinepayment-description',
649 'section' => 'billing',
650 '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)',
655 'key' => 'business-onlinepayment-email-override',
656 'section' => 'billing',
657 'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
662 'key' => 'business-onlinepayment-email_customer',
663 'section' => 'billing',
664 'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
665 'type' => 'checkbox',
669 'key' => 'countrydefault',
671 'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
676 'key' => 'date_format',
678 'description' => 'Format for displaying dates',
681 '%m/%d/%Y' => 'MM/DD/YYYY',
682 '%Y/%m/%d' => 'YYYY/MM/DD',
687 'key' => 'deletecustomers',
689 '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.',
690 'type' => 'checkbox',
694 'key' => 'deletepayments',
695 'section' => 'billing',
696 '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.',
697 'type' => [qw( checkbox text )],
701 'key' => 'deletecredits',
702 #not actually deprecated yet
703 #'section' => 'deprecated',
704 #'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.',
706 'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
707 'type' => [qw( checkbox text )],
711 'key' => 'deleterefunds',
712 'section' => 'billing',
713 'description' => 'Enable deletion of unclosed refunds. Be very careful! Only delete refunds that were data-entry errors, not adjustments.',
714 'type' => 'checkbox',
718 'key' => 'unapplypayments',
719 'section' => 'deprecated',
720 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable "unapplication" of unclosed payments.',
721 'type' => 'checkbox',
725 'key' => 'unapplycredits',
726 'section' => 'deprecated',
727 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to nable "unapplication" of unclosed credits.',
728 'type' => 'checkbox',
733 'section' => 'shell',
734 '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>',
739 'key' => 'disable_customer_referrals',
741 'description' => 'Disable new customer-to-customer referrals in the web interface',
742 'type' => 'checkbox',
746 'key' => 'editreferrals',
748 'description' => 'Enable advertising source modification for existing customers',
749 'type' => 'checkbox',
753 'key' => 'emailinvoiceonly',
754 'section' => 'billing',
755 'description' => 'Disables postal mail invoices',
756 'type' => 'checkbox',
760 'key' => 'disablepostalinvoicedefault',
761 'section' => 'billing',
762 '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>.',
763 'type' => 'checkbox',
767 'key' => 'emailinvoiceauto',
768 'section' => 'billing',
769 'description' => 'Automatically adds new accounts to the email invoice list',
770 'type' => 'checkbox',
774 'key' => 'emailinvoiceautoalways',
775 'section' => 'billing',
776 'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
777 'type' => 'checkbox',
781 'key' => 'exclude_ip_addr',
783 'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
784 'type' => 'textarea',
788 'key' => 'auto_router',
790 'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
791 'type' => 'checkbox',
795 'key' => 'hidecancelledpackages',
797 'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
798 'type' => 'checkbox',
802 'key' => 'hidecancelledcustomers',
804 'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
805 'type' => 'checkbox',
810 'section' => 'shell',
811 'description' => 'For new users, prefixed to username to create a directory name. Should have a leading but not a trailing slash.',
816 'key' => 'invoice_from',
817 'section' => 'required',
818 'description' => 'Return address on email invoices',
824 'key' => 'invoice_subject',
825 'section' => 'billing',
826 'description' => 'Subject: header on email invoices. Defaults to "Invoice". The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
832 'key' => 'invoice_template',
833 'section' => 'billing',
834 '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.',
835 'type' => 'textarea',
839 'key' => 'invoice_html',
840 'section' => 'billing',
841 '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.',
843 'type' => 'textarea',
847 'key' => 'invoice_htmlnotes',
848 'section' => 'billing',
849 'description' => 'Notes section for HTML invoices. Defaults to the same data in invoice_latexnotes if not specified.',
850 'type' => 'textarea',
855 'key' => 'invoice_htmlfooter',
856 'section' => 'billing',
857 'description' => 'Footer for HTML invoices. Defaults to the same data in invoice_latexfooter if not specified.',
858 'type' => 'textarea',
863 'key' => 'invoice_htmlreturnaddress',
864 'section' => 'billing',
865 'description' => 'Return address for HTML invoices. Defaults to the same data in invoice_latexreturnaddress if not specified.',
866 'type' => 'textarea',
870 'key' => 'invoice_latex',
871 'section' => 'billing',
872 '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.',
873 'type' => 'textarea',
877 'key' => 'invoice_latexnotes',
878 'section' => 'billing',
879 'description' => 'Notes section for LaTeX typeset PostScript invoices.',
880 'type' => 'textarea',
885 'key' => 'invoice_latexfooter',
886 'section' => 'billing',
887 'description' => 'Footer for LaTeX typeset PostScript invoices.',
888 'type' => 'textarea',
893 'key' => 'invoice_latexcoupon',
894 'section' => 'billing',
895 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
896 'type' => 'textarea',
901 'key' => 'invoice_latexreturnaddress',
902 'section' => 'billing',
903 'description' => 'Return address for LaTeX typeset PostScript invoices.',
904 'type' => 'textarea',
908 'key' => 'invoice_latexsmallfooter',
909 'section' => 'billing',
910 'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
911 'type' => 'textarea',
916 'key' => 'invoice_email_pdf',
917 'section' => 'billing',
918 '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.',
923 'key' => 'invoice_email_pdf_note',
924 'section' => 'billing',
925 'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
931 'key' => 'invoice_default_terms',
932 'section' => 'billing',
933 'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
935 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
939 'key' => 'invoice_sections',
940 'section' => 'billing',
941 'description' => 'Split invoice into sections and label according to package category when enabled.',
942 'type' => 'checkbox',
946 'key' => 'separate_usage',
947 'section' => 'billing',
948 'description' => 'Split the rated call usage into a separate line from the recurring charges.',
949 'type' => 'checkbox',
953 'key' => 'invoice_send_receipts',
954 'section' => 'deprecated',
955 'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits. See the payment_receipt_email and XXXX instead.',
956 'type' => 'checkbox',
960 'key' => 'payment_receipt_email',
961 'section' => 'billing',
962 '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>',
963 'type' => [qw( checkbox textarea )],
968 'section' => 'required',
969 'description' => 'Print command for paper invoices, for example `lpr -h\'',
974 'key' => 'lpr-postscript_prefix',
975 'section' => 'billing',
976 'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
981 'key' => 'lpr-postscript_suffix',
982 'section' => 'billing',
983 'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
988 'key' => 'money_char',
990 'description' => 'Currency symbol - defaults to `$\'',
995 'key' => 'defaultrecords',
997 'description' => 'DNS entries to add automatically when creating a domain',
998 'type' => 'editlist',
999 'editlist_parts' => [ { type=>'text' },
1000 { type=>'immutable', value=>'IN' },
1002 select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
1003 { type=> 'text' }, ],
1007 'key' => 'passwordmin',
1008 'section' => 'password',
1009 'description' => 'Minimum password length (default 6)',
1014 'key' => 'passwordmax',
1015 'section' => 'password',
1016 'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1021 'key' => 'password-noampersand',
1022 'section' => 'password',
1023 'description' => 'Disallow ampersands in passwords',
1024 'type' => 'checkbox',
1028 'key' => 'password-noexclamation',
1029 'section' => 'password',
1030 'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1031 'type' => 'checkbox',
1035 'key' => 'referraldefault',
1037 'description' => 'Default referral, specified by refnum',
1042 # 'key' => 'registries',
1043 # 'section' => 'required',
1044 # 'description' => 'Directory which contains domain registry information. Each registry is a directory.',
1048 'key' => 'report_template',
1049 'section' => 'deprecated',
1050 'description' => 'Deprecated template file for reports.',
1051 'type' => 'textarea',
1055 'key' => 'maxsearchrecordsperpage',
1057 'description' => 'If set, number of search records to return per page.',
1062 'key' => 'session-start',
1063 'section' => 'session',
1064 '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.',
1069 'key' => 'session-stop',
1070 'section' => 'session',
1071 '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.',
1077 'section' => 'shell',
1078 '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.',
1079 'type' => 'textarea',
1083 'key' => 'showpasswords',
1085 'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1086 'type' => 'checkbox',
1090 'key' => 'signupurl',
1092 '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',
1097 'key' => 'smtpmachine',
1098 'section' => 'required',
1099 'description' => 'SMTP relay for Freeside\'s outgoing mail',
1104 'key' => 'soadefaultttl',
1105 'section' => 'BIND',
1106 'description' => 'SOA default TTL for new domains.',
1111 'key' => 'soaemail',
1112 'section' => 'BIND',
1113 'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1118 'key' => 'soaexpire',
1119 'section' => 'BIND',
1120 'description' => 'SOA expire for new domains',
1125 'key' => 'soamachine',
1126 'section' => 'BIND',
1127 'description' => 'SOA machine for new domains, with trailing `.\'',
1132 'key' => 'soarefresh',
1133 'section' => 'BIND',
1134 'description' => 'SOA refresh for new domains',
1139 'key' => 'soaretry',
1140 'section' => 'BIND',
1141 'description' => 'SOA retry for new domains',
1146 'key' => 'statedefault',
1148 'description' => 'Default state or province (if not supplied, the default is `CA\')',
1153 'key' => 'unsuspendauto',
1154 'section' => 'billing',
1155 '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',
1156 'type' => 'checkbox',
1160 'key' => 'unsuspend-always_adjust_next_bill_date',
1161 'section' => 'billing',
1162 '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.',
1163 'type' => 'checkbox',
1167 'key' => 'usernamemin',
1168 'section' => 'username',
1169 'description' => 'Minimum username length (default 2)',
1174 'key' => 'usernamemax',
1175 'section' => 'username',
1176 'description' => 'Maximum username length',
1181 'key' => 'username-ampersand',
1182 'section' => 'username',
1183 'description' => 'Allow the ampersand character (&) 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.',
1184 'type' => 'checkbox',
1188 'key' => 'username-letter',
1189 'section' => 'username',
1190 'description' => 'Usernames must contain at least one letter',
1191 'type' => 'checkbox',
1196 'key' => 'username-letterfirst',
1197 'section' => 'username',
1198 'description' => 'Usernames must start with a letter',
1199 'type' => 'checkbox',
1203 'key' => 'username-noperiod',
1204 'section' => 'username',
1205 'description' => 'Disallow periods in usernames',
1206 'type' => 'checkbox',
1210 'key' => 'username-nounderscore',
1211 'section' => 'username',
1212 'description' => 'Disallow underscores in usernames',
1213 'type' => 'checkbox',
1217 'key' => 'username-nodash',
1218 'section' => 'username',
1219 'description' => 'Disallow dashes in usernames',
1220 'type' => 'checkbox',
1224 'key' => 'username-uppercase',
1225 'section' => 'username',
1226 'description' => 'Allow uppercase characters in usernames. Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1227 'type' => 'checkbox',
1231 'key' => 'username-percent',
1232 'section' => 'username',
1233 'description' => 'Allow the percent character (%) in usernames.',
1234 'type' => 'checkbox',
1238 'key' => 'username-colon',
1239 'section' => 'username',
1240 'description' => 'Allow the colon character (:) in usernames.',
1241 'type' => 'checkbox',
1245 'key' => 'safe-part_bill_event',
1247 'description' => 'Validates invoice event expressions against a preset list. Useful for webdemos, annoying to powerusers.',
1248 'type' => 'checkbox',
1254 'description' => 'Turns on display/collection of social security numbers in the web interface. Sometimes required by electronic check (ACH) processors.',
1255 'type' => 'checkbox',
1259 'key' => 'show_stateid',
1261 'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface. Sometimes required by electronic check (ACH) processors.",
1262 'type' => 'checkbox',
1266 'key' => 'show_bankstate',
1268 'description' => "Turns on display/collection of state for bank accounts in the web interface. Sometimes required by electronic check (ACH) processors.",
1269 'type' => 'checkbox',
1273 'key' => 'agent_defaultpkg',
1275 'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1276 'type' => 'checkbox',
1280 'key' => 'legacy_link',
1282 'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1283 'type' => 'checkbox',
1287 'key' => 'legacy_link-steal',
1289 'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1290 'type' => 'checkbox',
1294 'key' => 'queue_dangerous_controls',
1296 '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.',
1297 'type' => 'checkbox',
1301 'key' => 'security_phrase',
1302 'section' => 'password',
1303 'description' => 'Enable the tracking of a "security phrase" with each account. Not recommended, as it is vulnerable to social engineering.',
1304 'type' => 'checkbox',
1310 'description' => 'Message locale',
1312 'select_enum' => [ qw(en_US) ],
1316 'key' => 'signup_server-payby',
1318 'description' => 'Acceptable payment types for the signup server',
1319 'type' => 'selectmultiple',
1320 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1324 'key' => 'signup_server-default_agentnum',
1326 'description' => 'Default agent for the signup server',
1327 'type' => 'select-sub',
1328 'options_sub' => sub { require FS::Record;
1330 map { $_->agentnum => $_->agent }
1331 FS::Record::qsearch('agent', { disabled=>'' } );
1333 'option_sub' => sub { require FS::Record;
1335 my $agent = FS::Record::qsearchs(
1336 'agent', { 'agentnum'=>shift }
1338 $agent ? $agent->agent : '';
1343 'key' => 'signup_server-default_refnum',
1345 'description' => 'Default advertising source for the signup server',
1346 'type' => 'select-sub',
1347 'options_sub' => sub { require FS::Record;
1348 require FS::part_referral;
1349 map { $_->refnum => $_->referral }
1350 FS::Record::qsearch( 'part_referral',
1351 { 'disabled' => '' }
1354 'option_sub' => sub { require FS::Record;
1355 require FS::part_referral;
1356 my $part_referral = FS::Record::qsearchs(
1357 'part_referral', { 'refnum'=>shift } );
1358 $part_referral ? $part_referral->referral : '';
1363 'key' => 'signup_server-default_pkgpart',
1365 'description' => 'Default package for the signup server',
1366 'type' => 'select-sub',
1367 'options_sub' => sub { require FS::Record;
1368 require FS::part_pkg;
1369 map { $_->pkgpart => $_->pkg.' - '.$_->comment }
1370 FS::Record::qsearch( 'part_pkg',
1374 'option_sub' => sub { require FS::Record;
1375 require FS::part_pkg;
1376 my $part_pkg = FS::Record::qsearchs(
1377 'part_pkg', { 'pkgpart'=>shift }
1380 ? $part_pkg->pkg.' - '.$part_pkg->comment
1386 'key' => 'signup_server-default_svcpart',
1388 'description' => 'Default svcpart for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
1389 'type' => 'select-sub',
1390 'options_sub' => sub { require FS::Record;
1391 require FS::part_svc;
1392 map { $_->svcpart => $_->svc }
1393 FS::Record::qsearch( 'part_svc',
1397 'option_sub' => sub { require FS::Record;
1398 require FS::part_svc;
1399 my $part_svc = FS::Record::qsearchs(
1400 'part_svc', { 'svcpart'=>shift }
1402 $part_svc ? $part_svc->svc : '';
1407 'key' => 'signup_server-service',
1409 'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
1412 'svc_acct' => 'Account (svc_acct)',
1413 'svc_phone' => 'Phone number (svc_phone)',
1418 'key' => 'selfservice_server-base_url',
1420 'description' => 'Base URL for the self-service web interface - necessary for some widgets to find their way, including retrieval of non-US state information and phone number provisioning.',
1425 'key' => 'show-msgcat-codes',
1427 'description' => 'Show msgcat codes in error messages. Turn this option on before reporting errors to the mailing list.',
1428 'type' => 'checkbox',
1432 'key' => 'signup_server-realtime',
1434 'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1435 'type' => 'checkbox',
1438 'key' => 'signup_server-classnum2',
1440 'description' => 'Package Class for first optional purchase',
1441 'type' => 'select-sub',
1442 'options_sub' => sub { require FS::Record;
1443 require FS::pkg_class;
1444 map { $_->classnum => $_->classname }
1445 FS::Record::qsearch('pkg_class', {} );
1447 'option_sub' => sub { require FS::Record;
1448 require FS::pkg_class;
1449 my $pkg_class = FS::Record::qsearchs(
1450 'pkg_class', { 'classnum'=>shift }
1452 $pkg_class ? $pkg_class->classname : '';
1457 'key' => 'signup_server-classnum3',
1459 'description' => 'Package Class for second optional purchase',
1460 'type' => 'select-sub',
1461 'options_sub' => sub { require FS::Record;
1462 require FS::pkg_class;
1463 map { $_->classnum => $_->classname }
1464 FS::Record::qsearch('pkg_class', {} );
1466 'option_sub' => sub { require FS::Record;
1467 require FS::pkg_class;
1468 my $pkg_class = FS::Record::qsearchs(
1469 'pkg_class', { 'classnum'=>shift }
1471 $pkg_class ? $pkg_class->classname : '';
1476 'key' => 'backend-realtime',
1478 'description' => 'Run billing for backend signups immediately.',
1479 'type' => 'checkbox',
1483 'key' => 'declinetemplate',
1484 'section' => 'billing',
1485 'description' => 'Template file for credit card decline emails.',
1486 'type' => 'textarea',
1490 'key' => 'emaildecline',
1491 'section' => 'billing',
1492 'description' => 'Enable emailing of credit card decline notices.',
1493 'type' => 'checkbox',
1497 'key' => 'emaildecline-exclude',
1498 'section' => 'billing',
1499 'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1500 'type' => 'textarea',
1504 'key' => 'cancelmessage',
1505 'section' => 'billing',
1506 'description' => 'Template file for cancellation emails.',
1507 'type' => 'textarea',
1511 'key' => 'cancelsubject',
1512 'section' => 'billing',
1513 'description' => 'Subject line for cancellation emails.',
1518 'key' => 'emailcancel',
1519 'section' => 'billing',
1520 'description' => 'Enable emailing of cancellation notices. Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
1521 'type' => 'checkbox',
1525 'key' => 'bill_usage_on_cancel',
1526 'section' => 'billing',
1527 'description' => 'Enable automatic generation of an invoice for usage when a package is cancelled. Not all packages can do this. Usage data must already be available.',
1528 'type' => 'checkbox',
1532 'key' => 'require_cardname',
1533 'section' => 'billing',
1534 'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1535 'type' => 'checkbox',
1539 'key' => 'enable_taxclasses',
1540 'section' => 'billing',
1541 'description' => 'Enable per-package tax classes',
1542 'type' => 'checkbox',
1546 'key' => 'require_taxclasses',
1547 'section' => 'billing',
1548 'description' => 'Require a taxclass to be entered for every package',
1549 'type' => 'checkbox',
1553 'key' => 'enable_taxproducts',
1554 'section' => 'billing',
1555 'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
1556 'type' => 'checkbox',
1560 'key' => 'taxdatadirectdownload',
1561 'section' => 'billing', #well
1562 'description' => 'Enable downloading tax data directly from the vendor site',
1563 'type' => 'checkbox',
1567 'key' => 'ignore_incalculable_taxes',
1568 'section' => 'billing',
1569 'description' => 'Prefer to invoice without tax over not billing at all',
1570 'type' => 'checkbox',
1574 'key' => 'welcome_email',
1576 '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>',
1577 'type' => 'textarea',
1582 'key' => 'welcome_email-from',
1584 'description' => 'From: address header for welcome email',
1590 'key' => 'welcome_email-subject',
1592 'description' => 'Subject: header for welcome email',
1598 'key' => 'welcome_email-mimetype',
1600 'description' => 'MIME type for welcome email',
1602 'select_enum' => [ 'text/plain', 'text/html' ],
1607 'key' => 'welcome_letter',
1609 '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>',
1610 'type' => 'textarea',
1614 'key' => 'warning_email',
1616 '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>',
1617 'type' => 'textarea',
1621 'key' => 'warning_email-from',
1623 'description' => 'From: address header for warning email',
1628 'key' => 'warning_email-cc',
1630 'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1635 'key' => 'warning_email-subject',
1637 'description' => 'Subject: header for warning email',
1642 'key' => 'warning_email-mimetype',
1644 'description' => 'MIME type for warning email',
1646 'select_enum' => [ 'text/plain', 'text/html' ],
1651 'section' => 'billing',
1652 'description' => 'Available payment types.',
1653 'type' => 'selectmultiple',
1654 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1658 'key' => 'payby-default',
1660 'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
1662 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1666 'key' => 'paymentforcedtobatch',
1667 'section' => 'deprecated',
1668 '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.',
1669 'type' => 'checkbox',
1673 'key' => 'svc_acct-notes',
1675 'description' => 'Extra HTML to be displayed on the Account View screen.',
1676 'type' => 'textarea',
1680 'key' => 'radius-password',
1682 'description' => 'RADIUS attribute for plain-text passwords.',
1684 'select_enum' => [ 'Password', 'User-Password' ],
1688 'key' => 'radius-ip',
1690 'description' => 'RADIUS attribute for IP addresses.',
1692 'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1695 #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
1697 'key' => 'radius-chillispot-max',
1699 'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
1700 'type' => 'checkbox',
1704 'key' => 'svc_acct-alldomains',
1706 '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.',
1707 'type' => 'checkbox',
1711 'key' => 'dump-scpdest',
1713 'description' => 'destination for scp database dumps: user@host:/path',
1718 'key' => 'dump-pgpid',
1720 '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.",
1725 'key' => 'users-allow_comp',
1726 'section' => 'deprecated',
1727 'description' => '<b>DEPRECATED</b>, enable the <i>Complimentary customer</i> access right instead. Was: Usernames (Freeside users, created with <a href="../docs/man/bin/freeside-adduser.html">freeside-adduser</a>) which can create complimentary customers, one per line. If no usernames are entered, all users can create complimentary accounts.',
1728 'type' => 'textarea',
1732 'key' => 'credit_card-recurring_billing_flag',
1733 'section' => 'billing',
1734 'description' => 'This controls when the system passes the "recurring_billing" flag on credit card transactions. If supported by your processor (and the Business::OnlinePayment processor module), passing the flag indicates this is a recurring transaction and may turn off the CVV requirement. ',
1737 'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
1738 'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
1743 'key' => 'credit_card-recurring_billing_acct_code',
1744 'section' => 'billing',
1745 'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill". Useful for reporting purposes with supported gateways (PlugNPay, others?)',
1746 'type' => 'checkbox',
1750 'key' => 'cvv-save',
1751 'section' => 'billing',
1752 '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.',
1753 'type' => 'selectmultiple',
1754 'select_enum' => \@card_types,
1758 'key' => 'allow_negative_charges',
1759 'section' => 'billing',
1760 'description' => 'Allow negative charges. Normally not used unless importing data from a legacy system that requires this.',
1761 'type' => 'checkbox',
1764 'key' => 'auto_unset_catchall',
1766 '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.',
1767 'type' => 'checkbox',
1771 'key' => 'system_usernames',
1772 'section' => 'username',
1773 '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.',
1774 'type' => 'textarea',
1778 'key' => 'cust_pkg-change_svcpart',
1780 'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1781 'type' => 'checkbox',
1785 'key' => 'disable_autoreverse',
1786 'section' => 'BIND',
1787 'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1788 'type' => 'checkbox',
1792 'key' => 'svc_www-enable_subdomains',
1794 'description' => 'Enable selection of specific subdomains for virtual host creation.',
1795 'type' => 'checkbox',
1799 'key' => 'svc_www-usersvc_svcpart',
1801 'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1802 'type' => 'textarea',
1806 'key' => 'selfservice_server-primary_only',
1808 'description' => 'Only allow primary accounts to access self-service functionality.',
1809 'type' => 'checkbox',
1813 'key' => 'selfservice_server-phone_login',
1815 'description' => 'Allow login to self-service with phone number and PIN.',
1816 'type' => 'checkbox',
1820 'key' => 'selfservice_server-single_domain',
1822 'description' => 'If specified, only use this one domain for self-service access.',
1827 'key' => 'card_refund-days',
1828 'section' => 'billing',
1829 'description' => 'After a payment, the number of days a refund link will be available for that payment. Defaults to 120.',
1834 'key' => 'agent-showpasswords',
1836 'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1837 'type' => 'checkbox',
1841 'key' => 'global_unique-username',
1842 'section' => 'username',
1843 '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.',
1845 'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1849 'key' => 'global_unique-phonenum',
1851 '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.',
1853 'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
1857 'key' => 'svc_external-skip_manual',
1859 '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).',
1860 'type' => 'checkbox',
1864 'key' => 'svc_external-display_type',
1866 'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1868 'select_enum' => [ 'generic', 'artera_turbo', ],
1872 'key' => 'ticket_system',
1874 '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).',
1876 #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
1877 'select_enum' => [ '', qw(RT_Internal RT_External) ],
1881 'key' => 'ticket_system-default_queueid',
1883 'description' => 'Default queue used when creating new customer tickets.',
1884 'type' => 'select-sub',
1885 'options_sub' => sub {
1886 my $conf = new FS::Conf;
1887 if ( $conf->config('ticket_system') ) {
1888 eval "use FS::TicketSystem;";
1890 FS::TicketSystem->queues();
1895 'option_sub' => sub {
1896 my $conf = new FS::Conf;
1897 if ( $conf->config('ticket_system') ) {
1898 eval "use FS::TicketSystem;";
1900 FS::TicketSystem->queue(shift);
1908 'key' => 'ticket_system-priority_reverse',
1910 '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.',
1911 'type' => 'checkbox',
1915 'key' => 'ticket_system-custom_priority_field',
1917 'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
1922 'key' => 'ticket_system-custom_priority_field-values',
1924 'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
1925 'type' => 'textarea',
1929 'key' => 'ticket_system-custom_priority_field_queue',
1931 'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
1936 'key' => 'ticket_system-rt_external_datasrc',
1938 '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>',
1944 'key' => 'ticket_system-rt_external_url',
1946 'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
1951 'key' => 'company_name',
1952 'section' => 'required',
1953 'description' => 'Your company name',
1955 'per_agent' => 1, #XXX just FS/FS/ClientAPI/Signup.pm
1959 'key' => 'company_address',
1960 'section' => 'required',
1961 'description' => 'Your company address',
1962 'type' => 'textarea',
1967 'key' => 'echeck-void',
1968 'section' => 'deprecated',
1969 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
1970 'type' => 'checkbox',
1975 'section' => 'deprecated',
1976 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
1977 'type' => 'checkbox',
1982 'section' => 'deprecated',
1983 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable unvoiding of voided payments',
1984 'type' => 'checkbox',
1988 'key' => 'address2-search',
1990 'description' => 'Enable a "Unit" search box which searches the second address field. Useful for multi-tenant applications. See also: cust_main-require_address2',
1991 'type' => 'checkbox',
1995 'key' => 'cust_main-require_address2',
1997 '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',
1998 'type' => 'checkbox',
2002 'key' => 'agent-ship_address',
2004 '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.",
2005 'type' => 'checkbox',
2008 { 'key' => 'referral_credit',
2009 'section' => 'deprecated',
2010 '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.",
2011 'type' => 'checkbox',
2014 { 'key' => 'selfservice_server-cache_module',
2016 '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.',
2018 'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
2023 'section' => 'billing',
2024 '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).',
2025 'type' => [qw( checkbox textarea )],
2029 'key' => 'cust_bill-ftpformat',
2030 'section' => 'billing',
2031 'description' => 'Enable FTP of raw invoice data - format.',
2033 'select_enum' => [ '', 'default', 'billco', ],
2037 'key' => 'cust_bill-ftpserver',
2038 'section' => 'billing',
2039 'description' => 'Enable FTP of raw invoice data - server.',
2044 'key' => 'cust_bill-ftpusername',
2045 'section' => 'billing',
2046 'description' => 'Enable FTP of raw invoice data - server.',
2051 'key' => 'cust_bill-ftppassword',
2052 'section' => 'billing',
2053 'description' => 'Enable FTP of raw invoice data - server.',
2058 'key' => 'cust_bill-ftpdir',
2059 'section' => 'billing',
2060 'description' => 'Enable FTP of raw invoice data - server.',
2065 'key' => 'cust_bill-spoolformat',
2066 'section' => 'billing',
2067 'description' => 'Enable spooling of raw invoice data - format.',
2069 'select_enum' => [ '', 'default', 'billco', ],
2073 'key' => 'cust_bill-spoolagent',
2074 'section' => 'billing',
2075 'description' => 'Enable per-agent spooling of raw invoice data.',
2076 'type' => 'checkbox',
2080 'key' => 'svc_acct-usage_suspend',
2081 'section' => 'billing',
2082 '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.',
2083 'type' => 'checkbox',
2087 'key' => 'svc_acct-usage_unsuspend',
2088 'section' => 'billing',
2089 '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.',
2090 'type' => 'checkbox',
2094 'key' => 'svc_acct-usage_threshold',
2095 'section' => 'billing',
2096 '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.',
2101 'key' => 'cust-fields',
2103 'description' => 'Which customer fields to display on reports by default',
2105 'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
2109 'key' => 'cust_pkg-display_times',
2111 'description' => 'Display full timestamps (not just dates) for customer packages. Useful if you are doing real-time things like hourly prepaid.',
2112 'type' => 'checkbox',
2116 'key' => 'cust_pkg-always_show_location',
2118 'description' => "Always display package locations, even when they're all the default service address.",
2119 'type' => 'checkbox',
2123 'key' => 'svc_acct-edit_uid',
2124 'section' => 'shell',
2125 'description' => 'Allow UID editing.',
2126 'type' => 'checkbox',
2130 'key' => 'svc_acct-edit_gid',
2131 'section' => 'shell',
2132 'description' => 'Allow GID editing.',
2133 'type' => 'checkbox',
2137 'key' => 'zone-underscore',
2138 'section' => 'BIND',
2139 'description' => 'Allow underscores in zone names. As underscores are illegal characters in zone names, this option is not recommended.',
2140 'type' => 'checkbox',
2144 'key' => 'echeck-nonus',
2145 'section' => 'billing',
2146 'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2147 'type' => 'checkbox',
2151 'key' => 'voip-cust_cdr_spools',
2153 'description' => 'Enable the per-customer option for individual CDR spools.',
2154 'type' => 'checkbox',
2158 'key' => 'voip-cust_cdr_squelch',
2160 'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2161 'type' => 'checkbox',
2165 'key' => 'voip-cdr_email',
2167 'description' => 'Include the call details on emailed invoices even if the customer is configured for not printing them on the invoices.',
2168 'type' => 'checkbox',
2172 'key' => 'voip-cust_email_csv_cdr',
2174 'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
2175 'type' => 'checkbox',
2179 'key' => 'svc_forward-arbitrary_dst',
2181 '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.",
2182 'type' => 'checkbox',
2186 'key' => 'tax-ship_address',
2187 'section' => 'billing',
2188 'description' => 'By default, tax calculations are done based on the billing address. Enable this switch to calculate tax based on the shipping address instead.',
2189 'type' => 'checkbox',
2193 'key' => 'tax-pkg_address',
2194 'section' => 'billing',
2195 '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). Note that this option is currently incompatible with vendor data taxation enabled by enable_taxproducts.',
2196 'type' => 'checkbox',
2200 'key' => 'invoice-ship_address',
2201 'section' => 'billing',
2202 'description' => 'Enable this switch to include the ship address on the invoice.',
2203 'type' => 'checkbox',
2207 'key' => 'invoice-unitprice',
2208 'section' => 'billing',
2209 'description' => 'This switch enables unit pricing on the invoice.',
2210 'type' => 'checkbox',
2214 'key' => 'postal_invoice-fee_pkgpart',
2215 'section' => 'billing',
2216 'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2217 'type' => 'select-sub',
2218 'options_sub' => sub { require FS::Record;
2219 require FS::part_pkg;
2220 map { $_->pkgpart => $_->pkg }
2221 FS::Record::qsearch('part_pkg', { disabled=>'' } );
2223 'option_sub' => sub { require FS::Record;
2224 require FS::part_pkg;
2225 my $part_pkg = FS::Record::qsearchs(
2226 'part_pkg', { 'pkgpart'=>shift }
2228 $part_pkg ? $part_pkg->pkg : '';
2233 'key' => 'postal_invoice-recurring_only',
2234 'section' => 'billing',
2235 'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2236 'type' => 'checkbox',
2240 'key' => 'batch-enable',
2241 'section' => 'deprecated', #make sure batch-enable_payby is set for
2242 #everyone before removing
2243 'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2244 'type' => 'checkbox',
2248 'key' => 'batch-enable_payby',
2249 'section' => 'billing',
2250 'description' => 'Enable batch processing for the specified payment types.',
2251 'type' => 'selectmultiple',
2252 'select_enum' => [qw( CARD CHEK )],
2256 'key' => 'realtime-disable_payby',
2257 'section' => 'billing',
2258 'description' => 'Disable realtime processing for the specified payment types.',
2259 'type' => 'selectmultiple',
2260 'select_enum' => [qw( CARD CHEK )],
2264 'key' => 'batch-default_format',
2265 'section' => 'billing',
2266 'description' => 'Default format for batches.',
2268 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2269 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2275 'key' => 'batch-fixed_format-CARD',
2276 'section' => 'billing',
2277 'description' => 'Fixed (unchangeable) format for credit card batches.',
2279 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2280 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
2284 'key' => 'batch-fixed_format-CHEK',
2285 'section' => 'billing',
2286 'description' => 'Fixed (unchangeable) format for electronic check batches.',
2288 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2294 'key' => 'batch-increment_expiration',
2295 'section' => 'billing',
2296 'description' => 'Increment expiration date years in batches until cards are current. Make sure this is acceptable to your batching provider before enabling.',
2297 'type' => 'checkbox'
2301 'key' => 'batchconfig-BoM',
2302 'section' => 'billing',
2303 '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',
2304 'type' => 'textarea',
2308 'key' => 'batchconfig-PAP',
2309 'section' => 'billing',
2310 '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',
2311 'type' => 'textarea',
2315 'key' => 'batchconfig-csv-chase_canada-E-xactBatch',
2316 'section' => 'billing',
2317 'description' => 'Gateway ID for Chase Canada E-xact batching',
2322 'key' => 'payment_history-years',
2324 'description' => 'Number of years of payment history to show by default. Currently defaults to 2.',
2329 'key' => 'change_history-years',
2331 'description' => 'Number of years of change history to show by default. Currently defaults to 0.5.',
2336 'key' => 'cust_main-packages-years',
2338 'description' => 'Number of years to show old (cancelled and one-time charge) packages by default. Currently defaults to 2.',
2343 'key' => 'cust_main-use_comments',
2345 'description' => 'Display free form comments on the customer edit screen. Useful as a scratch pad.',
2346 'type' => 'checkbox',
2350 'key' => 'cust_main-disable_notes',
2352 'description' => 'Disable new style customer notes - timestamped and user identified customer notes. Useful in tracking who did what.',
2353 'type' => 'checkbox',
2357 'key' => 'cust_main_note-display_times',
2359 'description' => 'Display full timestamps (not just dates) for customer notes.',
2360 'type' => 'checkbox',
2364 'key' => 'cust_main-ticket_statuses',
2366 'description' => 'Show tickets with these statuses on the customer view page.',
2367 'type' => 'selectmultiple',
2368 'select_enum' => [qw( new open stalled resolved rejected deleted )],
2372 'key' => 'cust_main-max_tickets',
2374 'description' => 'Maximum number of tickets to show on the customer view page.',
2379 'key' => 'cust_main-skeleton_tables',
2381 '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.',
2382 'type' => 'textarea',
2386 'key' => 'cust_main-skeleton_custnum',
2388 'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2393 'key' => 'cust_main-enable_birthdate',
2395 'descritpion' => 'Enable tracking of a birth date with each customer record',
2396 'type' => 'checkbox',
2400 'key' => 'support-key',
2402 '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.',
2407 'key' => 'card-types',
2408 'section' => 'billing',
2409 'description' => 'Select one or more card types to enable only those card types. If no card types are selected, all card types are available.',
2410 'type' => 'selectmultiple',
2411 'select_enum' => \@card_types,
2415 'key' => 'disable-fuzzy',
2417 'description' => 'Disable fuzzy searching. Speeds up searching for large sites, but only shows exact matches.',
2418 'type' => 'checkbox',
2421 { 'key' => 'pkg_referral',
2423 'description' => 'Enable package-specific advertising sources.',
2424 'type' => 'checkbox',
2427 { 'key' => 'pkg_referral-multiple',
2429 'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
2430 'type' => 'checkbox',
2434 'key' => 'dashboard-toplist',
2436 'description' => 'List of items to display on the top of the front page',
2437 'type' => 'textarea',
2441 'key' => 'impending_recur_template',
2442 'section' => 'billing',
2443 '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>',
2444 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2445 'type' => 'textarea',
2449 'key' => 'logo.png',
2450 'section' => 'billing', #?
2451 'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format. Suggested size somewhere near 92x62.',
2453 'per_agent' => 1, #XXX just view/logo.cgi, which is for the global
2454 #old-style editor anyway...?
2458 'key' => 'logo.eps',
2459 'section' => 'billing', #?
2460 'description' => 'Company logo for printed and PDF invoices, in EPS format.',
2462 'per_agent' => 1, #XXX as above, kinda
2466 'key' => 'selfservice-ignore_quantity',
2468 'description' => 'Ignores service quantity restrictions in self-service context. Strongly not recommended - just set your quantities correctly in the first place.',
2469 'type' => 'checkbox',
2473 'key' => 'selfservice-session_timeout',
2475 'description' => 'Self-service session timeout. Defaults to 1 hour.',
2477 'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
2481 'key' => 'disable_setup_suspended_pkgs',
2482 'section' => 'billing',
2483 'description' => 'Disables charging of setup fees for suspended packages.',
2484 'type' => 'checkbox',
2488 'key' => 'password-generated-allcaps',
2489 'section' => 'password',
2490 'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2491 'type' => 'checkbox',
2495 'key' => 'datavolume-forcemegabytes',
2497 'description' => 'All data volumes are expressed in megabytes',
2498 'type' => 'checkbox',
2502 'key' => 'datavolume-significantdigits',
2504 'description' => 'number of significant digits to use to represent data volumes',
2509 'key' => 'disable_void_after',
2510 'section' => 'billing',
2511 'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2516 'key' => 'disable_line_item_date_ranges',
2517 'section' => 'billing',
2518 'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2519 'type' => 'checkbox',
2523 'key' => 'support_packages',
2525 '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...
2526 'type' => 'textarea',
2530 'key' => 'cust_main-require_phone',
2532 'description' => 'Require daytime or night phone for all customer records.',
2533 'type' => 'checkbox',
2537 'key' => 'cust_main-require_invoicing_list_email',
2539 'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
2540 'type' => 'checkbox',
2544 'key' => 'svc_acct-display_paid_time_remaining',
2546 'description' => 'Show paid time remaining in addition to time remaining.',
2547 'type' => 'checkbox',
2551 'key' => 'cancel_credit_type',
2552 'section' => 'billing',
2553 'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
2554 'type' => 'select-sub',
2555 'options_sub' => sub { require FS::Record;
2556 require FS::reason_type;
2557 map { $_->typenum => $_->type }
2558 FS::Record::qsearch('reason_type', { class=>'R' } );
2560 'option_sub' => sub { require FS::Record;
2561 require FS::reason_type;
2562 my $reason_type = FS::Record::qsearchs(
2563 'reason_type', { 'typenum' => shift }
2565 $reason_type ? $reason_type->type : '';
2570 'key' => 'referral_credit_type',
2571 'section' => 'deprecated',
2572 '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.',
2573 'type' => 'select-sub',
2574 'options_sub' => sub { require FS::Record;
2575 require FS::reason_type;
2576 map { $_->typenum => $_->type }
2577 FS::Record::qsearch('reason_type', { class=>'R' } );
2579 'option_sub' => sub { require FS::Record;
2580 require FS::reason_type;
2581 my $reason_type = FS::Record::qsearchs(
2582 'reason_type', { 'typenum' => shift }
2584 $reason_type ? $reason_type->type : '';
2589 'key' => 'signup_credit_type',
2590 'section' => 'billing',
2591 'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
2592 'type' => 'select-sub',
2593 'options_sub' => sub { require FS::Record;
2594 require FS::reason_type;
2595 map { $_->typenum => $_->type }
2596 FS::Record::qsearch('reason_type', { class=>'R' } );
2598 'option_sub' => sub { require FS::Record;
2599 require FS::reason_type;
2600 my $reason_type = FS::Record::qsearchs(
2601 'reason_type', { 'typenum' => shift }
2603 $reason_type ? $reason_type->type : '';
2608 'key' => 'cust_main-agent_custid-format',
2610 'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
2613 '' => 'Numeric only',
2614 'ww?d+' => 'Numeric with one or two letter prefix',
2619 'key' => 'card_masking_method',
2621 '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.',
2624 '' => '123456xxxxxx1234',
2625 'first6last2' => '123456xxxxxxxx12',
2626 'first4last4' => '1234xxxxxxxx1234',
2627 'first4last2' => '1234xxxxxxxxxx12',
2628 'first2last4' => '12xxxxxxxxxx1234',
2629 'first2last2' => '12xxxxxxxxxxxx12',
2630 'first0last4' => 'xxxxxxxxxxxx1234',
2631 'first0last2' => 'xxxxxxxxxxxxxx12',
2636 'key' => 'disable_previous_balance',
2637 'section' => 'billing',
2638 'description' => 'Disable inclusion of previous balancem payment, and credit lines on invoices',
2639 'type' => 'checkbox',
2643 'key' => 'previous_balance-summary_only',
2644 'section' => 'billing',
2645 'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
2646 'type' => 'checkbox',
2650 'key' => 'usps_webtools-userid',
2652 '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.',
2657 'key' => 'usps_webtools-password',
2659 '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.',
2664 'key' => 'cust_main-auto_standardize_address',
2666 'description' => 'When using USPS web tools, automatically standardize the address without asking.',
2667 'type' => 'checkbox',
2671 'key' => 'cust_main-require_censustract',
2673 'description' => 'Customer is required to have a census tract. Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
2674 'type' => 'checkbox',
2678 'key' => 'census_year',
2680 'description' => 'The year to use in census tract lookups',
2682 'select_enum' => [ qw( 2008 2007 2006 ) ],
2686 'key' => 'company_latitude',
2688 'description' => 'Your company latitude (-90 through 90)',
2693 'key' => 'company_longitude',
2695 'description' => 'Your company longitude (-180 thru 180)',
2700 'key' => 'disable_acl_changes',
2702 'description' => 'Disable all ACL changes, for demos.',
2703 'type' => 'checkbox',
2707 'key' => 'cust_main-edit_agent_custid',
2709 'description' => 'Enable editing of the agent_custid field.',
2710 'type' => 'checkbox',
2714 'key' => 'cust_main-default_agent_custid',
2716 'description' => 'Display the agent_custid field instead of the custnum field.',
2717 'type' => 'checkbox',
2721 'key' => 'cust_main-auto_agent_custid',
2723 'description' => 'Automatically assign an agent_custid - select format',
2725 'select_hash' => [ '' => 'No',
2726 '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
2731 'key' => 'cust_main-default_areacode',
2733 'description' => 'Default area code for customers.',
2738 'key' => 'mcp_svcpart',
2740 'description' => 'Master Control Program svcpart. Leave this blank.',
2745 'key' => 'cust_bill-max_same_services',
2746 'section' => 'billing',
2747 '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.',
2752 'key' => 'suspend_email_admin',
2754 'description' => 'Destination admin email address to enable suspension notices',
2759 'key' => 'email_report-subject',
2761 'description' => 'Subject for reports emailed by freeside-fetch. Defaults to "Freeside report".',
2766 'key' => 'selfservice-head',
2768 'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
2769 'type' => 'textarea', #htmlarea?
2774 'key' => 'selfservice-body_header',
2776 'description' => 'HTML header for the self-service interface',
2777 'type' => 'textarea', #htmlarea?
2781 'key' => 'selfservice-body_footer',
2783 'description' => 'HTML header for the self-service interface',
2784 'type' => 'textarea', #htmlarea?
2789 'key' => 'selfservice-body_bgcolor',
2791 'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
2796 'key' => 'selfservice-box_bgcolor',
2798 'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0"',
2803 'key' => 'selfservice-bulk_format',
2805 'description' => 'Parameter arrangement for selfservice bulk features',
2807 'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
2812 'key' => 'selfservice-bulk_ftp_dir',
2814 'description' => 'Enable bulk ftp provisioning in this folder',
2820 'key' => 'signup-no_company',
2822 'description' => "Don't display a field for company name on signup.",
2823 'type' => 'checkbox',
2827 'key' => 'signup-recommend_email',
2829 'description' => 'Encourage the entry of an invoicing email address on signup.',
2830 'type' => 'checkbox',
2834 'key' => 'signup-recommend_daytime',
2836 'description' => 'Encourage the entry of a daytime phone number invoicing email address on signup.',
2837 'type' => 'checkbox',
2841 'key' => 'svc_phone-radius-default_password',
2843 'description' => 'Default password when exporting svc_phone records to RADIUS',
2848 'key' => 'svc_phone-allow_alpha_phonenum',
2850 'description' => 'Allow letters in phone numbers.',
2851 'type' => 'checkbox',
2855 'key' => 'default_phone_countrycode',
2857 'description' => 'Default countrcode',
2862 'key' => 'cdr-charged_party-accountcode',
2864 'description' => 'Set the charged_party field of CDRs to the accountcode.',
2865 'type' => 'checkbox',
2869 'key' => 'cdr-charged_party-accountcode-trim_leading_0s',
2871 'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
2872 'type' => 'checkbox',
2876 # 'key' => 'cdr-charged_party-truncate_prefix',
2878 # 'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
2883 # 'key' => 'cdr-charged_party-truncate_length',
2885 # 'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
2890 'key' => 'cdr-charged_party_rewrite',
2892 'description' => 'Do charged party rewriting in the freeside-cdrrewrited daemon; useful if CDRs are being dropped off directly in the database and require special charged_party processing such as cdr-charged_party-accountcode or cdr-charged_party-truncate*.',
2893 'type' => 'checkbox',
2897 'key' => 'cdr-taqua-da_rewrite',
2899 '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.',
2904 'key' => 'cust_pkg-show_autosuspend',
2906 'description' => 'Show package auto-suspend dates. Use with caution for now; can slow down customer view for large insallations.',
2907 'type' => 'checkbox',
2911 'key' => 'cdr-asterisk_forward_rewrite',
2913 '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").',
2914 'type' => 'checkbox',
2918 'key' => 'sg-multicustomer_hack',
2920 'description' => "Don't use this.",
2921 'type' => 'checkbox',
2925 'key' => 'disable-cust-pkg_class',
2927 'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
2928 'type' => 'checkbox',
2932 'key' => 'queued-max_kids',
2934 'description' => 'Maximum number of queued processes. Defaults to 10.',
2939 'key' => 'cancelled_cust-noevents',
2940 'section' => 'billing',
2941 'description' => "Don't run events for cancelled customers",
2942 'type' => 'checkbox',
2946 'key' => 'agent-invoice_template',
2947 'section' => 'billing',
2948 'description' => 'Enable display/edit of old-style per-agent invoice template selection',
2949 'type' => 'checkbox',
2953 'key' => 'svc_broadband-manage_link',
2955 'description' => 'URL for svc_broadband "Manage Device" link. The following substitutions are available: $ip_addr.',
2959 #more fine-grained, service def-level control could be useful eventually?
2961 'key' => 'svc_broadband-allow_null_ip_addr',
2963 'description' => '',
2964 'type' => 'checkbox',
2968 'key' => 'tax-report_groups',
2970 'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
2971 'type' => 'textarea',
2975 'key' => 'tax-cust_exempt-groups',
2977 'description' => 'List of grouping possibilities for tax names, for per-customer exemption purposes, one tax name per line. For example, "GST" would indicate the ability to exempt customers individually from taxes named "GST" (but not other taxes).',
2978 'type' => 'textarea',
2982 'key' => 'cust_main-default_view',
2984 'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
2987 #false laziness w/view/cust_main.cgi and pref/pref.html
2988 'basics' => 'Basics',
2990 'tickets' => 'Tickets',
2991 'packages' => 'Packages',
2992 'payment_history' => 'Payment History',
2993 'change_history' => 'Change History',
2999 'key' => 'enable_tax_adjustments',
3000 'section' => 'billing',
3001 'description' => 'Enable the ability to add manual tax adjustments.',
3002 'type' => 'checkbox',
3006 'key' => 'rt-crontool',
3008 'description' => 'Enable the RT CronTool extension.',
3009 'type' => 'checkbox',
3013 'key' => 'pkg-balances',
3014 'section' => 'billing',
3015 'description' => 'Enable experimental package balances. Not recommended for general use.',
3016 'type' => 'checkbox',
3020 'key' => 'cust_main-edit_signupdate',
3022 'descritpion' => 'Enable manual editing of the signup date.',
3023 'type' => 'checkbox',
3026 { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3027 { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3028 { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3029 { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3030 { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3031 { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3032 { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3033 { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3034 { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3035 { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3036 { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3037 { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3038 { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3039 { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3040 { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3041 { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3042 { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3043 { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3044 { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3045 { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3046 { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3047 { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3048 { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3049 { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3050 { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3051 { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3052 { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3053 { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3054 { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3055 { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3056 { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3057 { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3058 { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3059 { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3060 { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3061 { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3062 { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3063 { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3064 { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3065 { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3066 { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },