3 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
11 use FS::Conf_compat17;
15 use FS::Record qw(qsearch qsearchs);
16 use FS::UID qw(dbh datasrc use_confcompat);
17 use FS::Misc::Invoicing qw( spool_formats );
19 $base_dir = '%%%FREESIDE_CONF%%%';
25 FS::Conf - Freeside configuration values
33 $value = $conf->config('key');
34 @list = $conf->config('key');
35 $bool = $conf->exists('key');
38 $conf->set('key' => 'value');
41 @config_items = $conf->config_items;
45 Read and write Freeside configuration values. Keys currently map to filenames,
46 but this may change in the future.
54 Create a new configuration object.
56 HASHREF may contain options to set the configuration context. Currently
57 accepts C<locale>, and C<localeonly> to disable fallback to the null locale.
63 my $opts = shift || {};
64 my($class) = ref($proto) || $proto;
66 'base_dir' => $base_dir,
67 'locale' => $opts->{locale},
68 'localeonly' => $opts->{localeonly}, # for config-view.cgi ONLY
70 warn "FS::Conf created with no locale fallback.\n" if $self->{localeonly};
71 bless ($self, $class);
76 Returns the base directory. By default this is /usr/local/etc/freeside.
82 my $base_dir = $self->{base_dir};
83 -e $base_dir or die "FATAL: $base_dir doesn't exist!";
84 -d $base_dir or die "FATAL: $base_dir isn't a directory!";
85 -r $base_dir or die "FATAL: Can't read $base_dir!";
86 -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
87 $base_dir =~ /^(.*)$/;
91 =item conf KEY [ AGENTNUM [ NODEFAULT ] ]
93 Returns the L<FS::conf> record for the key and agent.
102 =item config KEY [ AGENTNUM [ NODEFAULT ] ]
104 Returns the configuration value or values (depending on context) for key.
105 The optional agent number selects an agent specific value instead of the
106 global default if one is present. If NODEFAULT is true only the agent
107 specific value(s) is returned.
112 my ($self, $method) = (shift, shift);
113 carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
115 my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
116 $compat->$method(@_);
120 my($self,$name,$agentnum,$agentonly)=@_;
121 my $hashref = { 'name' => $name };
122 local $FS::Record::conf = undef; # XXX evil hack prevents recursion
126 ($agentonly && $agentnum ? () : '')
129 ($self->{locale} || ()),
130 ($self->{localeonly} && $self->{locale} ? () : '')
132 # try with the agentnum first, then fall back to no agentnum if allowed
134 $hashref->{agentnum} = $a;
136 $hashref->{locale} = $l;
137 $cv = FS::Record::qsearchs('conf', $hashref);
146 return $self->_usecompat('config', @_) if use_confcompat;
148 carp "FS::Conf->config(". join(', ', @_). ") called"
151 my $cv = $self->_config(@_) or return;
156 (split "\n", $v, -1);
158 (split("\n", $cv->value))[0];
162 =item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
164 Returns the exact scalar value for key.
170 return $self->_usecompat('config_binary', @_) if use_confcompat;
172 my $cv = $self->_config(@_) or return;
173 length($cv->value) ? decode_base64($cv->value) : '';
176 =item exists KEY [ AGENTNUM [ NODEFAULT ] ]
178 Returns true if the specified key exists, even if the corresponding value
185 return $self->_usecompat('exists', @_) if use_confcompat;
187 #my($name, $agentnum)=@_;
189 carp "FS::Conf->exists(". join(', ', @_). ") called"
192 defined($self->_config(@_));
195 #maybe this should just be the new exists instead of getting a method of its
196 #own, but i wanted to avoid possible fallout
200 return $self->_usecompat('exists', @_) if use_confcompat;
202 my($name,$agentnum,$agentonly) = @_;
204 carp "FS::Conf->config_bool(". join(', ', @_). ") called"
207 #defined($self->_config(@_));
209 #false laziness w/_config
210 my $hashref = { 'name' => $name };
211 local $FS::Record::conf = undef; # XXX evil hack prevents recursion
215 ($agentonly && $agentnum ? () : '')
218 ($self->{locale} || ()),
219 ($self->{localeonly} && $self->{locale} ? () : '')
221 # try with the agentnum first, then fall back to no agentnum if allowed
223 $hashref->{agentnum} = $a;
225 $hashref->{locale} = $l;
226 $cv = FS::Record::qsearchs('conf', $hashref);
228 if ( $cv->value eq '0'
229 && ($hashref->{agentnum} || $hashref->{locale} )
232 return 0; #an explicit false override, don't continue looking
243 =item config_orbase KEY SUFFIX
245 Returns the configuration value or values (depending on context) for
246 KEY_SUFFIX, if it exists, otherwise for KEY
250 # outmoded as soon as we shift to agentnum based config values
251 # well, mostly. still useful for e.g. late notices, etc. in that we want
252 # these to fall back to standard values
255 return $self->_usecompat('config_orbase', @_) if use_confcompat;
257 my( $name, $suffix ) = @_;
258 if ( $self->exists("${name}_$suffix") ) {
259 $self->config("${name}_$suffix");
261 $self->config($name);
265 =item key_orbase KEY SUFFIX
267 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
268 KEY. Useful for determining which exact configuration option is returned by
275 #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
277 my( $name, $suffix ) = @_;
278 if ( $self->exists("${name}_$suffix") ) {
285 =item invoice_templatenames
287 Returns all possible invoice template names.
291 sub invoice_templatenames {
294 my %templatenames = ();
295 foreach my $item ( $self->config_items ) {
296 foreach my $base ( @base_items ) {
297 my( $main, $ext) = split(/\./, $base);
298 $ext = ".$ext" if $ext;
299 if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
300 $templatenames{$1}++;
305 map { $_ } #handle scalar context
306 sort keys %templatenames;
310 =item touch KEY [ AGENT ];
312 Creates the specified configuration key if it does not exist.
318 return $self->_usecompat('touch', @_) if use_confcompat;
320 my($name, $agentnum) = @_;
321 #unless ( $self->exists($name, $agentnum) ) {
322 unless ( $self->config_bool($name, $agentnum) ) {
323 if ( $agentnum && $self->exists($name) && $self->config($name,$agentnum) eq '0' ) {
324 $self->delete($name, $agentnum);
326 $self->set($name, '', $agentnum);
331 =item set KEY VALUE [ AGENTNUM ];
333 Sets the specified configuration key to the given value.
339 return $self->_usecompat('set', @_) if use_confcompat;
341 my($name, $value, $agentnum) = @_;
345 warn "[FS::Conf] SET $name\n" if $DEBUG;
349 agentnum => $agentnum,
350 locale => $self->{locale}
353 my $old = FS::Record::qsearchs('conf', $hashref);
354 my $new = new FS::conf { $old ? $old->hash : %$hashref };
359 $error = $new->replace($old);
361 $error = $new->insert;
364 die "error setting configuration value: $error \n"
369 =item set_binary KEY VALUE [ AGENTNUM ]
371 Sets the specified configuration key to an exact scalar value which
372 can be retrieved with config_binary.
378 return if use_confcompat;
380 my($name, $value, $agentnum)=@_;
381 $self->set($name, encode_base64($value), $agentnum);
384 =item delete KEY [ AGENTNUM ];
386 Deletes the specified configuration key.
392 return $self->_usecompat('delete', @_) if use_confcompat;
394 my($name, $agentnum) = @_;
395 if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum, locale => $self->{locale}}) ) {
396 warn "[FS::Conf] DELETE $name\n" if $DEBUG;
398 my $oldAutoCommit = $FS::UID::AutoCommit;
399 local $FS::UID::AutoCommit = 0;
402 my $error = $cv->delete;
405 $dbh->rollback if $oldAutoCommit;
406 die "error setting configuration value: $error \n"
409 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
414 #maybe this should just be the new delete instead of getting a method of its
415 #own, but i wanted to avoid possible fallout
419 return $self->_usecompat('delete', @_) if use_confcompat;
421 my($name, $agentnum) = @_;
423 warn "[FS::Conf] DELETE $name\n" if $DEBUG;
425 my $cv = FS::Record::qsearchs('conf', { name => $name,
426 agentnum => $agentnum,
427 locale => $self->{locale},
431 my $error = $cv->delete;
432 die $error if $error;
433 } elsif ( $agentnum ) {
434 $self->set($name, '0', $agentnum);
439 =item import_config_item CONFITEM DIR
441 Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
442 the database as a conf record (see L<FS::conf>). Imports from the file
443 in the directory DIR.
447 sub import_config_item {
448 my ($self,$item,$dir) = @_;
449 my $key = $item->key;
450 if ( -e "$dir/$key" && ! use_confcompat ) {
451 warn "Inserting $key\n" if $DEBUG;
453 my $value = readline(new IO::File "$dir/$key");
454 if ($item->type =~ /^(binary|image)$/ ) {
455 $self->set_binary($key, $value);
457 $self->set($key, $value);
460 warn "Not inserting $key\n" if $DEBUG;
464 =item verify_config_item CONFITEM DIR
466 Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
467 the database to the legacy file value in DIR.
471 sub verify_config_item {
472 return '' if use_confcompat;
473 my ($self,$item,$dir) = @_;
474 my $key = $item->key;
475 my $type = $item->type;
477 my $compat = new FS::Conf_compat17 $dir;
480 $error .= "$key fails existential comparison; "
481 if $self->exists($key) xor $compat->exists($key);
483 if ( $type !~ /^(binary|image)$/ ) {
487 $error .= "$key fails scalar comparison; "
488 unless scalar($self->config($key)) eq scalar($compat->config($key));
491 my (@new) = $self->config($key);
492 my (@old) = $compat->config($key);
493 unless ( scalar(@new) == scalar(@old)) {
494 $error .= "$key fails list comparison; ";
497 foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
498 $error .= "$key fails list comparison; "
504 no warnings 'uninitialized';
505 $error .= "$key fails binary comparison; "
506 unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
510 #remove deprecated config on our own terms, not freeside-upgrade's
511 # if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
513 # for ( @config_items ) { $proto = $_; last if $proto->key eq $key; }
514 # unless ($proto->key eq $key) {
515 # warn "removed config item $error\n" if $DEBUG;
523 #item _orbase_items OPTIONS
525 #Returns all of the possible extensible config items as FS::ConfItem objects.
526 #See #L<FS::ConfItem>. OPTIONS consists of name value pairs. Possible
529 # dir - the directory to search for configuration option files instead
530 # of using the conf records in the database
536 my ($self, %opt) = @_;
538 my $listmaker = sub { my $v = shift;
540 if ( $v =~ /\.(png|eps)$/ ) {
546 FS::Record::qsearch( 'conf',
549 "WHERE name LIKE '$v' ESCAPE '!'"
553 if (exists($opt{dir}) && $opt{dir}) {
554 $listmaker = sub { my $v = shift;
555 if ( $v =~ /\.(png|eps)$/ ) {
560 map { basename $_ } glob($opt{dir}. "/$v" );
567 for ( @config_items ) { $proto = $_; last if $proto->key eq $base; }
568 die "don't know about $base items" unless $proto->key eq $base;
570 map { new FS::ConfItem {
572 'base_key' => $proto->key,
573 'section' => $proto->section,
574 'description' => 'Alternate ' . $proto->description . ' See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
575 'type' => $proto->type,
577 } &$listmaker($base);
584 Returns all of the possible global/default configuration items as
585 FS::ConfItem objects. See L<FS::ConfItem>.
591 return $self->_usecompat('config_items', @_) if use_confcompat;
593 ( @config_items, $self->_orbase_items(@_) );
602 =item init-config DIR
604 Imports the configuration items from DIR (1.7 compatible)
605 to conf records in the database.
613 local $FS::UID::use_confcompat = 0;
614 my $conf = new FS::Conf;
615 foreach my $item ( $conf->config_items(dir => $dir) ) {
616 $conf->import_config_item($item, $dir);
617 my $error = $conf->verify_config_item($item, $dir);
618 return $error if $error;
621 my $compat = new FS::Conf_compat17 $dir;
622 foreach my $item ( $compat->config_items ) {
623 my $error = $conf->verify_config_item($item, $dir);
624 return $error if $error;
628 $FS::UID::use_confcompat = 0;
636 If this was more than just crud that will never be useful outside Freeside I'd
637 worry that config_items is freeside-specific and icky.
641 "Configuration" in the web interface (config/config.cgi).
645 #Business::CreditCard
650 "American Express card",
651 "Diner's Club/Carte Blanche",
662 invoice_latexreturnaddress
664 invoice_latexsmallfooter
668 invoice_htmlreturnaddress
675 my %msg_template_options = (
676 'type' => 'select-sub',
677 'options_sub' => sub {
678 my @templates = qsearch({
679 'table' => 'msg_template',
680 'hashref' => { 'disabled' => '' },
681 'extra_sql' => ' AND '.
682 $FS::CurrentUser::CurrentUser->agentnums_sql(null => 1),
684 map { $_->msgnum, $_->msgname } @templates;
686 'option_sub' => sub {
687 my $msg_template = FS::msg_template->by_key(shift);
688 $msg_template ? $msg_template->msgname : ''
693 my %payment_gateway_options = (
694 'type' => 'select-sub',
695 'options_sub' => sub {
696 my @gateways = qsearch({
697 'table' => 'payment_gateway',
698 'hashref' => { 'disabled' => '' },
700 map { $_->gatewaynum, $_->label } @gateways;
702 'option_sub' => sub {
703 my $gateway = FS::payment_gateway->by_key(shift);
704 $gateway ? $gateway->label : ''
708 my %batch_gateway_options = (
709 %payment_gateway_options,
710 'options_sub' => sub {
711 my @gateways = qsearch('payment_gateway',
714 'gateway_namespace' => 'Business::BatchPayment',
717 map { $_->gatewaynum, $_->label } @gateways;
723 'default' => 'Default',
724 'source_default' => 'Default with source',
725 'accountcode_default' => 'Default plus accountcode',
726 'description_default' => 'Default with description field as destination',
728 'simple' => 'Simple',
729 'simple2' => 'Simple with source',
730 'accountcode_simple' => 'Simple with accountcode',
733 # takes the reason class (C, R, S) as an argument
734 sub reason_type_options {
735 my $reason_class = shift;
737 'type' => 'select-sub',
738 'options_sub' => sub {
739 map { $_->typenum => $_->type }
740 qsearch('reason_type', { class => $reason_class });
742 'option_sub' => sub {
743 my $type = FS::reason_type->by_key(shift);
744 $type ? $type->type : '';
749 #Invoicing (50 items)
751 #Self-service (29 items)
753 #Unclassified (77 items)
755 @config_items = map { new FS::ConfItem $_ } (
759 'section' => 'deprecated',
760 'description' => 'This configuration option is no longer used. See <a href="#invoice_template">invoice_template</a> instead.',
765 'key' => 'event_log_level',
766 'section' => 'notification',
767 'description' => 'Store events in the internal log if they are at least this severe. "info" is the default, "debug" is very detailed and noisy.',
769 'select_enum' => [ '', 'debug', 'info', 'notice', 'warning', 'error', ],
770 # don't bother with higher levels
774 'key' => 'log_sent_mail',
775 'section' => 'notification',
776 'description' => 'Enable logging of template-generated email.',
777 'type' => 'checkbox',
781 'key' => 'alert_expiration',
782 'section' => 'deprecated',
783 'description' => 'Enable alerts about credit card expiration. This is obsolete and no longer works.',
784 'type' => 'checkbox',
789 'key' => 'alerter_template',
790 'section' => 'deprecated',
791 'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).',
792 'type' => 'textarea',
797 'key' => 'alerter_msgnum',
798 'section' => 'deprecated',
799 'description' => 'Template to use for credit card expiration alerts.',
800 %msg_template_options,
804 'key' => 'part_pkg-lineage',
806 'description' => 'When editing a package definition, if setup or recur fees are changed, create a new package rather than changing the existing package.',
807 'type' => 'checkbox',
812 #not actually deprecated yet
813 #'section' => 'deprecated',
814 #'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',
816 'description' => 'IP address to assign to new virtual hosts',
821 'key' => 'credits-auto-apply-disable',
822 'section' => 'billing',
823 'description' => 'Disable the "Auto-Apply to invoices" UI option for new credits',
824 'type' => 'checkbox',
828 'key' => 'credit-card-surcharge-percentage',
829 'section' => 'billing',
830 'description' => 'Add a credit card surcharge to invoices, as a % of the invoice total. WARNING: this is usually prohibited by merchant account / other agreements and/or law, but is currently lawful in AU and UK.',
835 'key' => 'discount-show-always',
836 'section' => 'billing',
837 'description' => 'Generate a line item on an invoice even when a package is discounted 100%',
838 'type' => 'checkbox',
842 'key' => 'discount-show_available',
843 'section' => 'billing',
844 'description' => 'Show available prepayment discounts on invoices.',
845 'type' => 'checkbox',
849 'key' => 'invoice-barcode',
850 'section' => 'billing',
851 'description' => 'Display a barcode on HTML and PDF invoices',
852 'type' => 'checkbox',
856 'key' => 'cust_main-select-billday',
857 'section' => 'billing',
858 'description' => 'When used with a specific billing event, allows the selection of the day of month on which to charge credit card / bank account automatically, on a per-customer basis',
859 'type' => 'checkbox',
863 'key' => 'cust_main-select-prorate_day',
864 'section' => 'billing',
865 'description' => 'When used with prorate or anniversary packages, allows the selection of the prorate day of month, on a per-customer basis',
866 'type' => 'checkbox',
870 'key' => 'anniversary-rollback',
871 'section' => 'billing',
872 'description' => 'When billing an anniversary package ordered after the 28th, roll the anniversary date back to the 28th instead of forward into the following month.',
873 'type' => 'checkbox',
877 'key' => 'encryption',
878 'section' => 'billing',
879 'description' => 'Enable encryption of credit cards and echeck numbers',
880 'type' => 'checkbox',
884 'key' => 'encryptionmodule',
885 'section' => 'billing',
886 'description' => 'Use which module for encryption?',
888 'select_enum' => [ '', 'Crypt::OpenSSL::RSA', ],
892 'key' => 'encryptionpublickey',
893 'section' => 'billing',
894 'description' => 'Encryption public key',
895 'type' => 'textarea',
899 'key' => 'encryptionprivatekey',
900 'section' => 'billing',
901 'description' => 'Encryption private key',
902 'type' => 'textarea',
906 'key' => 'billco-url',
907 'section' => 'billing',
908 'description' => 'The url to use for performing uploads to the invoice mailing service.',
914 'key' => 'billco-username',
915 'section' => 'billing',
916 'description' => 'The login name to use for uploads to the invoice mailing service.',
923 'key' => 'billco-password',
924 'section' => 'billing',
925 'description' => 'The password to use for uploads to the invoice mailing service.',
932 'key' => 'billco-clicode',
933 'section' => 'billing',
934 'description' => 'The clicode to use for uploads to the invoice mailing service.',
940 'key' => 'billco-account_num',
941 'section' => 'billing',
942 'description' => 'The data to place in the "Transaction Account No" / "TRACCTNUM" field.',
945 'invnum-date' => 'Invoice number - Date (default)',
946 'display_custnum' => 'Customer number',
952 'key' => 'next-bill-ignore-time',
953 'section' => 'billing',
954 'description' => 'Ignore the time portion of next bill dates when billing, matching anything from 00:00:00 to 23:59:59 on the billing day.',
955 'type' => 'checkbox',
959 'key' => 'business-onlinepayment',
960 'section' => 'billing',
961 '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.',
962 'type' => 'textarea',
966 'key' => 'business-onlinepayment-ach',
967 'section' => 'billing',
968 '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.',
969 'type' => 'textarea',
973 'key' => 'business-onlinepayment-namespace',
974 'section' => 'billing',
975 'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
978 'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
979 'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
984 'key' => 'business-onlinepayment-description',
985 'section' => 'billing',
986 'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>. Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply - not available in all situations)',
991 'key' => 'business-onlinepayment-email-override',
992 'section' => 'billing',
993 'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
998 'key' => 'business-onlinepayment-email_customer',
999 'section' => 'billing',
1000 'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
1001 'type' => 'checkbox',
1005 'key' => 'business-onlinepayment-test_transaction',
1006 'section' => 'billing',
1007 'description' => 'Turns on the Business::OnlinePayment test_transaction flag. Note that not all gateway modules support this flag; if yours does not, transactions will still be sent live.',
1008 'type' => 'checkbox',
1012 'key' => 'business-onlinepayment-currency',
1013 'section' => 'billing',
1014 'description' => 'Currency parameter for Business::OnlinePayment transactions.',
1016 'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD ) ],
1020 'key' => 'currency',
1021 'section' => 'billing',
1022 'description' => 'Main accounting currency',
1024 'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD XAF ) ],
1028 'key' => 'currencies',
1029 'section' => 'billing',
1030 'description' => 'Additional accepted currencies',
1031 'type' => 'select-sub',
1033 'options_sub' => sub {
1034 map { $_ => code2currency($_) } all_currency_codes();
1036 'sort_sub' => sub ($$) { $_[0] cmp $_[1]; },
1037 'option_sub' => sub { code2currency(shift); },
1041 'key' => 'business-batchpayment-test_transaction',
1042 'section' => 'billing',
1043 'description' => 'Turns on the Business::BatchPayment test_mode flag. Note that not all gateway modules support this flag; if yours does not, using the batch gateway will fail.',
1044 'type' => 'checkbox',
1048 'key' => 'countrydefault',
1050 'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
1055 'key' => 'date_format',
1057 'description' => 'Format for displaying dates',
1060 '%m/%d/%Y' => 'MM/DD/YYYY',
1061 '%d/%m/%Y' => 'DD/MM/YYYY',
1062 '%Y/%m/%d' => 'YYYY/MM/DD',
1067 'key' => 'date_format_long',
1069 'description' => 'Verbose format for displaying dates',
1072 '%b %o, %Y' => 'Mon DDth, YYYY',
1073 '%e %b %Y' => 'DD Mon YYYY',
1074 '%m/%d/%Y' => 'MM/DD/YYYY',
1075 '%d/%m/%Y' => 'DD/MM/YYYY',
1076 '%Y/%m/%d' => 'YYYY/MM/DD',
1081 'key' => 'deleteinvoices',
1083 'description' => 'Enable invoices deletions. Be very careful! Deleting an invoice will remove all traces that the invoice ever existed! Normally, you would void or apply a credit against the invoice instead.',
1084 'type' => 'checkbox',
1088 'key' => 'deletecredits',
1089 #not actually deprecated yet
1090 #'section' => 'deprecated',
1091 #'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.',
1093 'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
1094 'type' => [qw( checkbox text )],
1098 'key' => 'deleterefunds',
1099 'section' => 'billing',
1100 'description' => 'Enable deletion of unclosed refunds. Be very careful! Only delete refunds that were data-entry errors, not adjustments.',
1101 'type' => 'checkbox',
1105 'key' => 'unapplypayments',
1106 'section' => 'deprecated',
1107 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable "unapplication" of unclosed payments.',
1108 'type' => 'checkbox',
1112 'key' => 'unapplycredits',
1113 'section' => 'deprecated',
1114 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to nable "unapplication" of unclosed credits.',
1115 'type' => 'checkbox',
1120 'section' => 'shell',
1121 '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>',
1126 'key' => 'disable_cust_attachment',
1128 'description' => 'Disable customer file attachments',
1129 'type' => 'checkbox',
1133 'key' => 'max_attachment_size',
1135 'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
1140 'key' => 'disable_customer_referrals',
1142 'description' => 'Disable new customer-to-customer referrals in the web interface',
1143 'type' => 'checkbox',
1147 'key' => 'editreferrals',
1149 'description' => 'Enable advertising source modification for existing customers',
1150 'type' => 'checkbox',
1154 'key' => 'emailinvoiceonly',
1155 'section' => 'invoicing',
1156 'description' => 'Disables postal mail invoices',
1157 'type' => 'checkbox',
1161 'key' => 'disablepostalinvoicedefault',
1162 'section' => 'invoicing',
1163 '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>.',
1164 'type' => 'checkbox',
1168 'key' => 'emailinvoiceauto',
1169 'section' => 'invoicing',
1170 'description' => 'Automatically adds new accounts to the email invoice list',
1171 'type' => 'checkbox',
1175 'key' => 'emailinvoiceautoalways',
1176 'section' => 'invoicing',
1177 'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
1178 'type' => 'checkbox',
1182 'key' => 'emailinvoice-apostrophe',
1183 'section' => 'invoicing',
1184 'description' => 'Allows the apostrophe (single quote) character in the email addresses in the email invoice list.',
1185 'type' => 'checkbox',
1189 'key' => 'svc_acct-ip_addr',
1191 'description' => 'Enable IP address management on login services like for broadband services.',
1192 'type' => 'checkbox',
1196 'key' => 'exclude_ip_addr',
1198 'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
1199 'type' => 'textarea',
1203 'key' => 'auto_router',
1205 'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
1206 'type' => 'checkbox',
1210 'key' => 'hidecancelledpackages',
1212 'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
1213 'type' => 'checkbox',
1217 'key' => 'hidecancelledcustomers',
1219 'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
1220 'type' => 'checkbox',
1225 'section' => 'shell',
1226 'description' => 'For new users, prefixed to username to create a directory name. Should have a leading but not a trailing slash.',
1231 'key' => 'invoice_from',
1232 'section' => 'required',
1233 'description' => 'Return address on email invoices',
1239 'key' => 'invoice_subject',
1240 'section' => 'invoicing',
1241 'description' => 'Subject: header on email invoices. Defaults to "Invoice". The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
1248 'key' => 'invoice_usesummary',
1249 'section' => 'invoicing',
1250 'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
1251 'type' => 'checkbox',
1255 'key' => 'invoice_template',
1256 'section' => 'invoicing',
1257 'description' => 'Text template file for invoices. Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients. See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
1258 'type' => 'textarea',
1262 'key' => 'invoice_html',
1263 'section' => 'invoicing',
1264 'description' => 'HTML template for invoices. See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
1266 'type' => 'textarea',
1270 'key' => 'quotation_html',
1272 'description' => 'HTML template for quotations.',
1274 'type' => 'textarea',
1278 'key' => 'invoice_htmlnotes',
1279 'section' => 'invoicing',
1280 'description' => 'Notes section for HTML invoices. Defaults to the same data in invoice_latexnotes if not specified.',
1281 'type' => 'textarea',
1287 'key' => 'invoice_htmlfooter',
1288 'section' => 'invoicing',
1289 'description' => 'Footer for HTML invoices. Defaults to the same data in invoice_latexfooter if not specified.',
1290 'type' => 'textarea',
1296 'key' => 'invoice_htmlsummary',
1297 'section' => 'invoicing',
1298 'description' => 'Summary initial page for HTML invoices.',
1299 'type' => 'textarea',
1305 'key' => 'invoice_htmlreturnaddress',
1306 'section' => 'invoicing',
1307 'description' => 'Return address for HTML invoices. Defaults to the same data in invoice_latexreturnaddress if not specified.',
1308 'type' => 'textarea',
1313 'key' => 'invoice_latex',
1314 'section' => 'invoicing',
1315 'description' => 'Optional LaTeX template for typeset PostScript invoices. See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
1316 'type' => 'textarea',
1320 'key' => 'quotation_latex',
1322 'description' => 'LaTeX template for typeset PostScript quotations.',
1323 'type' => 'textarea',
1327 'key' => 'invoice_latextopmargin',
1328 'section' => 'invoicing',
1329 'description' => 'Optional LaTeX invoice topmargin setting. Include units.',
1332 'validate' => sub { shift =~
1333 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1334 ? '' : 'Invalid LaTex length';
1339 'key' => 'invoice_latexheadsep',
1340 'section' => 'invoicing',
1341 'description' => 'Optional LaTeX invoice headsep setting. Include units.',
1344 'validate' => sub { shift =~
1345 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1346 ? '' : 'Invalid LaTex length';
1351 'key' => 'invoice_latexaddresssep',
1352 'section' => 'invoicing',
1353 'description' => 'Optional LaTeX invoice separation between invoice header
1354 and customer address. Include units.',
1357 'validate' => sub { shift =~
1358 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1359 ? '' : 'Invalid LaTex length';
1364 'key' => 'invoice_latextextheight',
1365 'section' => 'invoicing',
1366 'description' => 'Optional LaTeX invoice textheight setting. Include units.',
1369 'validate' => sub { shift =~
1370 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1371 ? '' : 'Invalid LaTex length';
1376 'key' => 'invoice_latexnotes',
1377 'section' => 'invoicing',
1378 'description' => 'Notes section for LaTeX typeset PostScript invoices.',
1379 'type' => 'textarea',
1385 'key' => 'quotation_latexnotes',
1387 'description' => 'Notes section for LaTeX typeset PostScript quotations.',
1388 'type' => 'textarea',
1394 'key' => 'invoice_latexfooter',
1395 'section' => 'invoicing',
1396 'description' => 'Footer for LaTeX typeset PostScript invoices.',
1397 'type' => 'textarea',
1403 'key' => 'invoice_latexsummary',
1404 'section' => 'invoicing',
1405 'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
1406 'type' => 'textarea',
1412 'key' => 'invoice_latexcoupon',
1413 'section' => 'invoicing',
1414 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
1415 'type' => 'textarea',
1421 'key' => 'invoice_latexextracouponspace',
1422 'section' => 'invoicing',
1423 'description' => 'Optional LaTeX invoice textheight space to reserve for a tear off coupon. Include units. Default is 3.6cm',
1426 'validate' => sub { shift =~
1427 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1428 ? '' : 'Invalid LaTex length';
1433 'key' => 'invoice_latexcouponfootsep',
1434 'section' => 'invoicing',
1435 'description' => 'Optional LaTeX invoice separation between tear off coupon and footer. Include units.',
1438 'validate' => sub { shift =~
1439 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1440 ? '' : 'Invalid LaTex length';
1445 'key' => 'invoice_latexcouponamountenclosedsep',
1446 'section' => 'invoicing',
1447 'description' => 'Optional LaTeX invoice separation between total due and amount enclosed line. Include units.',
1450 'validate' => sub { shift =~
1451 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1452 ? '' : 'Invalid LaTex length';
1456 'key' => 'invoice_latexcoupontoaddresssep',
1457 'section' => 'invoicing',
1458 'description' => 'Optional LaTeX invoice separation between invoice data and the to address (usually invoice_latexreturnaddress). Include units.',
1461 'validate' => sub { shift =~
1462 /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
1463 ? '' : 'Invalid LaTex length';
1468 'key' => 'invoice_latexreturnaddress',
1469 'section' => 'invoicing',
1470 'description' => 'Return address for LaTeX typeset PostScript invoices.',
1471 'type' => 'textarea',
1475 'key' => 'invoice_latexverticalreturnaddress',
1476 'section' => 'invoicing',
1477 'description' => 'Place the return address under the company logo rather than beside it.',
1478 'type' => 'checkbox',
1483 'key' => 'invoice_latexcouponaddcompanytoaddress',
1484 'section' => 'invoicing',
1485 'description' => 'Add the company name to the To address on the remittance coupon because the return address does not contain it.',
1486 'type' => 'checkbox',
1491 'key' => 'invoice_latexsmallfooter',
1492 'section' => 'invoicing',
1493 'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
1494 'type' => 'textarea',
1500 'key' => 'invoice_email_pdf',
1501 'section' => 'invoicing',
1502 '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.',
1503 'type' => 'checkbox'
1507 'key' => 'invoice_email_pdf_note',
1508 'section' => 'invoicing',
1509 'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
1510 'type' => 'textarea'
1514 'key' => 'invoice_print_pdf',
1515 'section' => 'invoicing',
1516 'description' => 'For all invoice print operations, store postal invoices for download in PDF format rather than printing them directly.',
1517 'type' => 'checkbox',
1521 'key' => 'invoice_print_pdf-spoolagent',
1522 'section' => 'invoicing',
1523 'description' => 'Store postal invoices PDF downloads in per-agent spools.',
1524 'type' => 'checkbox',
1528 'key' => 'invoice_default_terms',
1529 'section' => 'invoicing',
1530 'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1532 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 3', 'Net 9', 'Net 10', 'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 30', 'Net 45', 'Net 60', 'Net 90' ],
1536 'key' => 'invoice_show_prior_due_date',
1537 'section' => 'invoicing',
1538 'description' => 'Show previous invoice due dates when showing prior balances. Default is to show invoice date.',
1539 'type' => 'checkbox',
1543 'key' => 'invoice_sections',
1544 'section' => 'invoicing',
1545 'description' => 'Split invoice into sections and label according to package category when enabled.',
1546 'type' => 'checkbox',
1551 'key' => 'invoice_include_aging',
1552 'section' => 'invoicing',
1553 'description' => 'Show an aging line after the prior balance section. Only valid when invoice_sections is enabled.',
1554 'type' => 'checkbox',
1558 'key' => 'invoice_sections_by_location',
1559 'section' => 'invoicing',
1560 'description' => 'Divide invoice into sections according to service location. Currently, this overrides sectioning by package category.',
1561 'type' => 'checkbox',
1565 #quotations seem broken-ish with sections ATM?
1567 # 'key' => 'quotation_sections',
1568 # 'section' => 'invoicing',
1569 # 'description' => 'Split quotations into sections and label according to package category when enabled.',
1570 # 'type' => 'checkbox',
1575 'key' => 'usage_class_as_a_section',
1576 'section' => 'invoicing',
1577 'description' => 'Split usage into sections and label according to usage class name when enabled. Only valid when invoice_sections is enabled.',
1578 'type' => 'checkbox',
1582 'key' => 'phone_usage_class_summary',
1583 'section' => 'invoicing',
1584 'description' => 'Summarize usage per DID by usage class and display all CDRs together regardless of usage class. Only valid when svc_phone_sections is enabled.',
1585 'type' => 'checkbox',
1589 'key' => 'svc_phone_sections',
1590 'section' => 'invoicing',
1591 'description' => 'Create a section for each svc_phone when enabled. Only valid when invoice_sections is enabled.',
1592 'type' => 'checkbox',
1596 'key' => 'finance_pkgclass',
1597 'section' => 'billing',
1598 'description' => 'The default package class for late fee charges, used if the fee event does not specify a package class itself.',
1599 'type' => 'select-pkg_class',
1603 'key' => 'separate_usage',
1604 'section' => 'invoicing',
1605 'description' => 'Split the rated call usage into a separate line from the recurring charges.',
1606 'type' => 'checkbox',
1610 'key' => 'invoice_send_receipts',
1611 'section' => 'deprecated',
1612 'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits. See the payment_receipt_email and XXXX instead.',
1613 'type' => 'checkbox',
1617 'key' => 'payment_receipt',
1618 'section' => 'notification',
1619 'description' => 'Send payment receipts.',
1620 'type' => 'checkbox',
1626 'key' => 'payment_receipt_msgnum',
1627 'section' => 'notification',
1628 'description' => 'Template to use for payment receipts.',
1629 %msg_template_options,
1633 'key' => 'payment_receipt_from',
1634 'section' => 'notification',
1635 'description' => 'From: address for payment receipts, if not specified in the template.',
1641 'key' => 'payment_receipt_email',
1642 'section' => 'deprecated',
1643 'description' => 'Template file for payment receipts. Payment receipts are sent to the customer email invoice destination(s) when a payment is received.',
1644 'type' => [qw( checkbox textarea )],
1648 'key' => 'payment_receipt-trigger',
1649 'section' => 'notification',
1650 'description' => 'When payment receipts are triggered. Defaults to when payment is made.',
1653 'cust_pay' => 'When payment is made.',
1654 'cust_bill_pay_pkg' => 'When payment is applied.',
1660 'key' => 'trigger_export_insert_on_payment',
1661 'section' => 'billing',
1662 'description' => 'Enable exports on payment application.',
1663 'type' => 'checkbox',
1668 'section' => 'required',
1669 'description' => 'Print command for paper invoices, for example `lpr -h\'',
1675 'key' => 'lpr-postscript_prefix',
1676 'section' => 'billing',
1677 'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1682 'key' => 'lpr-postscript_suffix',
1683 'section' => 'billing',
1684 'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1689 'key' => 'money_char',
1691 'description' => 'Currency symbol - defaults to `$\'',
1696 'key' => 'defaultrecords',
1697 'section' => 'BIND',
1698 'description' => 'DNS entries to add automatically when creating a domain',
1699 'type' => 'editlist',
1700 'editlist_parts' => [ { type=>'text' },
1701 { type=>'immutable', value=>'IN' },
1705 #@{ FS::domain_record->rectypes }
1706 qw(A AAAA CNAME MX NS PTR SPF SRV TXT)
1709 { type=> 'text' }, ],
1713 'key' => 'passwordmin',
1714 'section' => 'password',
1715 'description' => 'Minimum password length (default 6)',
1720 'key' => 'passwordmax',
1721 'section' => 'password',
1722 'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1727 'key' => 'sip_passwordmin',
1728 'section' => 'telephony',
1729 'description' => 'Minimum SIP password length (default 6)',
1734 'key' => 'sip_passwordmax',
1735 'section' => 'telephony',
1736 'description' => 'Maximum SIP password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1742 'key' => 'password-noampersand',
1743 'section' => 'password',
1744 'description' => 'Disallow ampersands in passwords',
1745 'type' => 'checkbox',
1749 'key' => 'password-noexclamation',
1750 'section' => 'password',
1751 'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1752 'type' => 'checkbox',
1756 'key' => 'default-password-encoding',
1757 'section' => 'password',
1758 'description' => 'Default storage format for passwords',
1761 'plain' => 'Plain text',
1762 'crypt-des' => 'Unix password (DES encrypted)',
1763 'crypt-md5' => 'Unix password (MD5 digest)',
1764 'ldap-plain' => 'LDAP (plain text)',
1765 'ldap-crypt' => 'LDAP (DES encrypted)',
1766 'ldap-md5' => 'LDAP (MD5 digest)',
1767 'ldap-sha1' => 'LDAP (SHA1 digest)',
1768 'legacy' => 'Legacy mode',
1773 'key' => 'referraldefault',
1775 'description' => 'Default referral, specified by refnum',
1776 'type' => 'select-sub',
1777 'options_sub' => sub { require FS::Record;
1778 require FS::part_referral;
1779 map { $_->refnum => $_->referral }
1780 FS::Record::qsearch( 'part_referral',
1781 { 'disabled' => '' }
1784 'option_sub' => sub { require FS::Record;
1785 require FS::part_referral;
1786 my $part_referral = FS::Record::qsearchs(
1787 'part_referral', { 'refnum'=>shift } );
1788 $part_referral ? $part_referral->referral : '';
1793 # 'key' => 'registries',
1794 # 'section' => 'required',
1795 # 'description' => 'Directory which contains domain registry information. Each registry is a directory.',
1799 'key' => 'report_template',
1800 'section' => 'deprecated',
1801 'description' => 'Deprecated template file for reports.',
1802 'type' => 'textarea',
1806 'key' => 'maxsearchrecordsperpage',
1808 'description' => 'If set, number of search records to return per page.',
1813 'key' => 'disable_maxselect',
1815 'description' => 'Prevent changing the number of records per page.',
1816 'type' => 'checkbox',
1820 'key' => 'session-start',
1821 'section' => 'session',
1822 '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.',
1827 'key' => 'session-stop',
1828 'section' => 'session',
1829 '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.',
1835 'section' => 'shell',
1836 '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.',
1837 'type' => 'textarea',
1841 'key' => 'showpasswords',
1843 'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1844 'type' => 'checkbox',
1848 'key' => 'report-showpasswords',
1850 'description' => 'This is a terrible idea. Do not enable it. STRONGLY NOT RECOMMENDED. Enables display of passwords on services reports.',
1851 'type' => 'checkbox',
1855 'key' => 'signupurl',
1857 'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
1862 'key' => 'smtpmachine',
1863 'section' => 'required',
1864 'description' => 'SMTP relay for Freeside\'s outgoing mail',
1869 'key' => 'smtp-username',
1871 'description' => 'Optional SMTP username for Freeside\'s outgoing mail',
1876 'key' => 'smtp-password',
1878 'description' => 'Optional SMTP password for Freeside\'s outgoing mail',
1883 'key' => 'smtp-encryption',
1885 'description' => 'Optional SMTP encryption method. The STARTTLS methods require smtp-username and smtp-password to be set.',
1887 'select_hash' => [ '25' => 'None (port 25)',
1888 '25-starttls' => 'STARTTLS (port 25)',
1889 '587-starttls' => 'STARTTLS / submission (port 587)',
1890 '465-tls' => 'SMTPS (SSL) (port 465)',
1895 'key' => 'soadefaultttl',
1896 'section' => 'BIND',
1897 'description' => 'SOA default TTL for new domains.',
1902 'key' => 'soaemail',
1903 'section' => 'BIND',
1904 'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1909 'key' => 'soaexpire',
1910 'section' => 'BIND',
1911 'description' => 'SOA expire for new domains',
1916 'key' => 'soamachine',
1917 'section' => 'BIND',
1918 'description' => 'SOA machine for new domains, with trailing `.\'',
1923 'key' => 'soarefresh',
1924 'section' => 'BIND',
1925 'description' => 'SOA refresh for new domains',
1930 'key' => 'soaretry',
1931 'section' => 'BIND',
1932 'description' => 'SOA retry for new domains',
1937 'key' => 'statedefault',
1939 'description' => 'Default state or province (if not supplied, the default is `CA\')',
1944 'key' => 'unsuspendauto',
1945 'section' => 'billing',
1946 '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',
1947 'type' => 'checkbox',
1951 'key' => 'unsuspend-always_adjust_next_bill_date',
1952 'section' => 'billing',
1953 '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.',
1954 'type' => 'checkbox',
1958 'key' => 'usernamemin',
1959 'section' => 'username',
1960 'description' => 'Minimum username length (default 2)',
1965 'key' => 'usernamemax',
1966 'section' => 'username',
1967 'description' => 'Maximum username length',
1972 'key' => 'username-ampersand',
1973 'section' => 'username',
1974 '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.',
1975 'type' => 'checkbox',
1979 'key' => 'username-letter',
1980 'section' => 'username',
1981 'description' => 'Usernames must contain at least one letter',
1982 'type' => 'checkbox',
1987 'key' => 'username-letterfirst',
1988 'section' => 'username',
1989 'description' => 'Usernames must start with a letter',
1990 'type' => 'checkbox',
1994 'key' => 'username-noperiod',
1995 'section' => 'username',
1996 'description' => 'Disallow periods in usernames',
1997 'type' => 'checkbox',
2001 'key' => 'username-nounderscore',
2002 'section' => 'username',
2003 'description' => 'Disallow underscores in usernames',
2004 'type' => 'checkbox',
2008 'key' => 'username-nodash',
2009 'section' => 'username',
2010 'description' => 'Disallow dashes in usernames',
2011 'type' => 'checkbox',
2015 'key' => 'username-uppercase',
2016 'section' => 'username',
2017 'description' => 'Allow uppercase characters in usernames. Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
2018 'type' => 'checkbox',
2023 'key' => 'username-percent',
2024 'section' => 'username',
2025 'description' => 'Allow the percent character (%) in usernames.',
2026 'type' => 'checkbox',
2030 'key' => 'username-colon',
2031 'section' => 'username',
2032 'description' => 'Allow the colon character (:) in usernames.',
2033 'type' => 'checkbox',
2037 'key' => 'username-slash',
2038 'section' => 'username',
2039 'description' => 'Allow the slash character (/) in usernames. When using, make sure to set "Home directory" to fixed and blank in all svc_acct service definitions.',
2040 'type' => 'checkbox',
2044 'key' => 'username-equals',
2045 'section' => 'username',
2046 'description' => 'Allow the equal sign character (=) in usernames.',
2047 'type' => 'checkbox',
2051 'key' => 'safe-part_bill_event',
2053 'description' => 'Validates invoice event expressions against a preset list. Useful for webdemos, annoying to powerusers.',
2054 'type' => 'checkbox',
2058 'key' => 'show_ship_company',
2060 'description' => 'Turns on display/collection of a "service company name" field for customers.',
2061 'type' => 'checkbox',
2067 'description' => 'Turns on display/collection of social security numbers in the web interface. Sometimes required by electronic check (ACH) processors.',
2068 'type' => 'checkbox',
2072 'key' => 'unmask_ss',
2074 'description' => "Don't mask social security numbers in the web interface.",
2075 'type' => 'checkbox',
2079 'key' => 'show_stateid',
2081 'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface. Sometimes required by electronic check (ACH) processors.",
2082 'type' => 'checkbox',
2086 'key' => 'national_id-country',
2088 'description' => 'Track a national identification number, for specific countries.',
2090 'select_enum' => [ '', 'MY' ],
2094 'key' => 'show_bankstate',
2096 'description' => "Turns on display/collection of state for bank accounts in the web interface. Sometimes required by electronic check (ACH) processors.",
2097 'type' => 'checkbox',
2101 'key' => 'agent_defaultpkg',
2103 'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
2104 'type' => 'checkbox',
2108 'key' => 'legacy_link',
2110 'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
2111 'type' => 'checkbox',
2115 'key' => 'legacy_link-steal',
2117 'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
2118 'type' => 'checkbox',
2122 'key' => 'queue_dangerous_controls',
2124 '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.',
2125 'type' => 'checkbox',
2129 'key' => 'security_phrase',
2130 'section' => 'password',
2131 'description' => 'Enable the tracking of a "security phrase" with each account. Not recommended, as it is vulnerable to social engineering.',
2132 'type' => 'checkbox',
2138 'description' => 'Default locale',
2139 'type' => 'select-sub',
2140 'options_sub' => sub {
2141 map { $_ => FS::Locales->description($_) } FS::Locales->locales;
2143 'option_sub' => sub {
2144 FS::Locales->description(shift)
2149 'key' => 'signup_server-payby',
2150 'section' => 'self-service',
2151 'description' => 'Acceptable payment types for the signup server',
2152 'type' => 'selectmultiple',
2153 'select_enum' => [ qw(CARD DCRD CHEK DCHK PREPAY PPAL BILL COMP) ],
2157 'key' => 'selfservice-payment_gateway',
2158 'section' => 'self-service',
2159 'description' => 'Force the use of this payment gateway for self-service.',
2160 %payment_gateway_options,
2164 'key' => 'selfservice-save_unchecked',
2165 'section' => 'self-service',
2166 'description' => 'In self-service, uncheck "Remember information" checkboxes by default (normally, they are checked by default).',
2167 'type' => 'checkbox',
2171 'key' => 'default_agentnum',
2173 'description' => 'Default agent for the backoffice',
2174 'type' => 'select-agent',
2178 'key' => 'signup_server-default_agentnum',
2179 'section' => 'self-service',
2180 'description' => 'Default agent for the signup server',
2181 'type' => 'select-agent',
2185 'key' => 'signup_server-default_refnum',
2186 'section' => 'self-service',
2187 'description' => 'Default advertising source for the signup server',
2188 'type' => 'select-sub',
2189 'options_sub' => sub { require FS::Record;
2190 require FS::part_referral;
2191 map { $_->refnum => $_->referral }
2192 FS::Record::qsearch( 'part_referral',
2193 { 'disabled' => '' }
2196 'option_sub' => sub { require FS::Record;
2197 require FS::part_referral;
2198 my $part_referral = FS::Record::qsearchs(
2199 'part_referral', { 'refnum'=>shift } );
2200 $part_referral ? $part_referral->referral : '';
2205 'key' => 'signup_server-default_pkgpart',
2206 'section' => 'self-service',
2207 'description' => 'Default package for the signup server',
2208 'type' => 'select-part_pkg',
2212 'key' => 'signup_server-default_svcpart',
2213 'section' => 'self-service',
2214 'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning or domain selection).',
2215 'type' => 'select-part_svc',
2219 'key' => 'signup_server-default_domsvc',
2220 'section' => 'self-service',
2221 'description' => 'If specified, the default domain svcpart for signup (useful when domain is set to selectable choice).',
2226 'key' => 'signup_server-mac_addr_svcparts',
2227 'section' => 'self-service',
2228 'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
2229 'type' => 'select-part_svc',
2234 'key' => 'signup_server-nomadix',
2235 'section' => 'self-service',
2236 'description' => 'Signup page Nomadix integration',
2237 'type' => 'checkbox',
2241 'key' => 'signup_server-service',
2242 'section' => 'self-service',
2243 'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
2246 'svc_acct' => 'Account (svc_acct)',
2247 'svc_phone' => 'Phone number (svc_phone)',
2248 'svc_pbx' => 'PBX (svc_pbx)',
2253 'key' => 'signup_server-prepaid-template-custnum',
2254 'section' => 'self-service',
2255 'description' => 'When the signup server is used with prepaid cards and customer info is not required for signup, the contact/address info will be copied from this customer, if specified',
2260 'key' => 'signup_server-terms_of_service',
2261 'section' => 'self-service',
2262 'description' => 'Terms of Service for the signup server. May contain HTML.',
2263 'type' => 'textarea',
2268 'key' => 'selfservice_server-base_url',
2269 'section' => 'self-service',
2270 '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.',
2275 'key' => 'show-msgcat-codes',
2277 'description' => 'Show msgcat codes in error messages. Turn this option on before reporting errors to the mailing list.',
2278 'type' => 'checkbox',
2282 'key' => 'signup_server-realtime',
2283 'section' => 'self-service',
2284 'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
2285 'type' => 'checkbox',
2289 'key' => 'signup_server-classnum2',
2290 'section' => 'self-service',
2291 'description' => 'Package Class for first optional purchase',
2292 'type' => 'select-pkg_class',
2296 'key' => 'signup_server-classnum3',
2297 'section' => 'self-service',
2298 'description' => 'Package Class for second optional purchase',
2299 'type' => 'select-pkg_class',
2303 'key' => 'signup_server-third_party_as_card',
2304 'section' => 'self-service',
2305 'description' => 'Allow customer payment type to be set to CARD even when using third-party credit card billing.',
2306 'type' => 'checkbox',
2310 'key' => 'selfservice-xmlrpc',
2311 'section' => 'self-service',
2312 'description' => 'Run a standalone self-service XML-RPC server on the backend (on port 8080).',
2313 'type' => 'checkbox',
2317 'key' => 'selfservice-timeout',
2318 'section' => 'self-service',
2319 'description' => 'Timeout for the self-service login cookie, in seconds. Defaults to 1 hour.',
2324 'key' => 'backend-realtime',
2325 'section' => 'billing',
2326 'description' => 'Run billing for backend signups immediately.',
2327 'type' => 'checkbox',
2331 'key' => 'decline_msgnum',
2332 'section' => 'notification',
2333 'description' => 'Template to use for credit card and electronic check decline messages.',
2334 %msg_template_options,
2338 'key' => 'declinetemplate',
2339 'section' => 'deprecated',
2340 'description' => 'Template file for credit card and electronic check decline emails.',
2341 'type' => 'textarea',
2345 'key' => 'emaildecline',
2346 'section' => 'notification',
2347 'description' => 'Enable emailing of credit card and electronic check decline notices.',
2348 'type' => 'checkbox',
2353 'key' => 'emaildecline-exclude',
2354 'section' => 'notification',
2355 'description' => 'List of error messages that should not trigger email decline notices, one per line.',
2356 'type' => 'textarea',
2361 'key' => 'cancel_msgnum',
2362 'section' => 'notification',
2363 'description' => 'Template to use for cancellation emails.',
2364 %msg_template_options,
2368 'key' => 'cancelmessage',
2369 'section' => 'deprecated',
2370 'description' => 'Template file for cancellation emails.',
2371 'type' => 'textarea',
2375 'key' => 'cancelsubject',
2376 'section' => 'deprecated',
2377 'description' => 'Subject line for cancellation emails.',
2382 'key' => 'emailcancel',
2383 'section' => 'notification',
2384 'description' => 'Enable emailing of cancellation notices. Make sure to select the template in the cancel_msgnum option.',
2385 'type' => 'checkbox',
2390 'key' => 'bill_usage_on_cancel',
2391 'section' => 'billing',
2392 '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.',
2393 'type' => 'checkbox',
2397 'key' => 'require_cardname',
2398 'section' => 'billing',
2399 'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
2400 'type' => 'checkbox',
2404 'key' => 'enable_taxclasses',
2405 'section' => 'billing',
2406 'description' => 'Enable per-package tax classes',
2407 'type' => 'checkbox',
2411 'key' => 'require_taxclasses',
2412 'section' => 'billing',
2413 'description' => 'Require a taxclass to be entered for every package',
2414 'type' => 'checkbox',
2418 'key' => 'enable_taxproducts',
2419 'section' => 'billing',
2420 'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
2421 'type' => 'checkbox',
2425 'key' => 'taxdatadirectdownload',
2426 'section' => 'billing', #well
2427 'description' => 'Enable downloading tax data directly from the vendor site. at least three lines: URL, username, and password.j',
2428 'type' => 'textarea',
2432 'key' => 'ignore_incalculable_taxes',
2433 'section' => 'billing',
2434 'description' => 'Prefer to invoice without tax over not billing at all',
2435 'type' => 'checkbox',
2439 'key' => 'welcome_msgnum',
2440 'section' => 'notification',
2441 'description' => 'Template to use for welcome messages when a svc_acct record is created.',
2442 %msg_template_options,
2446 'key' => 'svc_acct_welcome_exclude',
2447 'section' => 'notification',
2448 'description' => 'A list of svc_acct services for which no welcome email is to be sent.',
2449 'type' => 'select-part_svc',
2454 'key' => 'welcome_email',
2455 'section' => 'deprecated',
2456 '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.',
2457 'type' => 'textarea',
2462 'key' => 'welcome_email-from',
2463 'section' => 'deprecated',
2464 'description' => 'From: address header for welcome email',
2470 'key' => 'welcome_email-subject',
2471 'section' => 'deprecated',
2472 'description' => 'Subject: header for welcome email',
2478 'key' => 'welcome_email-mimetype',
2479 'section' => 'deprecated',
2480 'description' => 'MIME type for welcome email',
2482 'select_enum' => [ 'text/plain', 'text/html' ],
2487 'key' => 'welcome_letter',
2489 '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>',
2490 'type' => 'textarea',
2494 # 'key' => 'warning_msgnum',
2495 # 'section' => 'notification',
2496 # 'description' => 'Template to use for warning messages, sent to the customer email invoice destination(s) when a svc_acct record has its usage drop below a threshold.',
2497 # %msg_template_options,
2501 'key' => 'warning_email',
2502 'section' => 'notification',
2503 '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>',
2504 'type' => 'textarea',
2508 'key' => 'warning_email-from',
2509 'section' => 'notification',
2510 'description' => 'From: address header for warning email',
2515 'key' => 'warning_email-cc',
2516 'section' => 'notification',
2517 'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
2522 'key' => 'warning_email-subject',
2523 'section' => 'notification',
2524 'description' => 'Subject: header for warning email',
2529 'key' => 'warning_email-mimetype',
2530 'section' => 'notification',
2531 'description' => 'MIME type for warning email',
2533 'select_enum' => [ 'text/plain', 'text/html' ],
2538 'section' => 'billing',
2539 'description' => 'Available payment types.',
2540 'type' => 'selectmultiple',
2541 'select_enum' => [ qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD PPAL COMP) ],
2545 'key' => 'payby-default',
2547 'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
2549 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD PPAL COMP HIDE) ],
2553 'key' => 'require_cash_deposit_info',
2554 'section' => 'billing',
2555 'description' => 'When recording cash payments, display bank deposit information fields.',
2556 'type' => 'checkbox',
2560 'key' => 'paymentforcedtobatch',
2561 'section' => 'deprecated',
2562 '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.',
2563 'type' => 'checkbox',
2567 'key' => 'svc_acct-notes',
2568 'section' => 'deprecated',
2569 'description' => 'Extra HTML to be displayed on the Account View screen.',
2570 'type' => 'textarea',
2574 'key' => 'radius-password',
2576 'description' => 'RADIUS attribute for plain-text passwords.',
2578 'select_enum' => [ 'Password', 'User-Password', 'Cleartext-Password' ],
2582 'key' => 'radius-ip',
2584 'description' => 'RADIUS attribute for IP addresses.',
2586 'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
2589 #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
2591 'key' => 'radius-chillispot-max',
2593 'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
2594 'type' => 'checkbox',
2598 'key' => 'svc_broadband-radius',
2600 'description' => 'Enable RADIUS groups for broadband services.',
2601 'type' => 'checkbox',
2605 'key' => 'svc_acct-alldomains',
2607 '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.',
2608 'type' => 'checkbox',
2612 'key' => 'dump-localdest',
2614 'description' => 'Destination for local database dumps (full path)',
2619 'key' => 'dump-scpdest',
2621 'description' => 'Destination for scp database dumps: user@host:/path',
2626 'key' => 'dump-pgpid',
2628 '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.",
2633 'key' => 'users-allow_comp',
2634 'section' => 'deprecated',
2635 '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.',
2636 'type' => 'textarea',
2640 'key' => 'credit_card-recurring_billing_flag',
2641 'section' => 'billing',
2642 '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. ',
2645 'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
2646 'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
2651 'key' => 'credit_card-recurring_billing_acct_code',
2652 'section' => 'billing',
2653 'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill". Useful for reporting purposes with supported gateways (PlugNPay, others?)',
2654 'type' => 'checkbox',
2658 'key' => 'cvv-save',
2659 'section' => 'billing',
2660 '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.',
2661 'type' => 'selectmultiple',
2662 'select_enum' => \@card_types,
2666 'key' => 'manual_process-pkgpart',
2667 'section' => 'billing',
2668 'description' => 'Package to add to each manual credit card and ACH payment entered by employees from the backend. Enabling this option may be in violation of your merchant agreement(s), so please check it(/them) carefully before enabling this option.',
2669 'type' => 'select-part_pkg',
2674 'key' => 'manual_process-display',
2675 'section' => 'billing',
2676 'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2679 'add' => 'Add fee to amount entered',
2680 'subtract' => 'Subtract fee from amount entered',
2685 'key' => 'manual_process-skip_first',
2686 'section' => 'billing',
2687 'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
2688 'type' => 'checkbox',
2692 'key' => 'selfservice_process-pkgpart',
2693 'section' => 'billing',
2694 'description' => 'Package to add to each manual credit card and ACH payment entered by the customer themselves in the self-service interface. Enabling this option may be in violation of your merchant agreement(s), so please check it(/them) carefully before enabling this option.',
2695 'type' => 'select-part_pkg',
2700 'key' => 'selfservice_process-display',
2701 'section' => 'billing',
2702 'description' => 'When using selfservice_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2705 'add' => 'Add fee to amount entered',
2706 'subtract' => 'Subtract fee from amount entered',
2711 'key' => 'selfservice_process-skip_first',
2712 'section' => 'billing',
2713 'description' => "When using selfservice_process-pkgpart, omit the fee if it is the customer's first payment.",
2714 'type' => 'checkbox',
2718 # 'key' => 'auto_process-pkgpart',
2719 # 'section' => 'billing',
2720 # 'description' => 'Package to add to each automatic credit card and ACH payment processed by billing events. Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option.',
2721 # 'type' => 'select-part_pkg',
2725 ## 'key' => 'auto_process-display',
2726 ## 'section' => 'billing',
2727 ## 'description' => 'When using auto_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
2728 ## 'type' => 'select',
2729 ## 'select_hash' => [
2730 ## 'add' => 'Add fee to amount entered',
2731 ## 'subtract' => 'Subtract fee from amount entered',
2736 # 'key' => 'auto_process-skip_first',
2737 # 'section' => 'billing',
2738 # 'description' => "When using auto_process-pkgpart, omit the fee if it is the customer's first payment.",
2739 # 'type' => 'checkbox',
2743 'key' => 'allow_negative_charges',
2744 'section' => 'billing',
2745 'description' => 'Allow negative charges. Normally not used unless importing data from a legacy system that requires this.',
2746 'type' => 'checkbox',
2749 'key' => 'auto_unset_catchall',
2751 '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.',
2752 'type' => 'checkbox',
2756 'key' => 'system_usernames',
2757 'section' => 'username',
2758 '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.',
2759 'type' => 'textarea',
2763 'key' => 'cust_pkg-change_svcpart',
2765 'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
2766 'type' => 'checkbox',
2770 'key' => 'cust_pkg-change_pkgpart-bill_now',
2772 'description' => "When changing packages, bill the new package immediately. Useful for prepaid situations with RADIUS where an Expiration attribute based on the package must be present at all times.",
2773 'type' => 'checkbox',
2777 'key' => 'disable_autoreverse',
2778 'section' => 'BIND',
2779 'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
2780 'type' => 'checkbox',
2784 'key' => 'svc_www-enable_subdomains',
2786 'description' => 'Enable selection of specific subdomains for virtual host creation.',
2787 'type' => 'checkbox',
2791 'key' => 'svc_www-usersvc_svcpart',
2793 'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
2794 'type' => 'select-part_svc',
2799 'key' => 'selfservice_server-primary_only',
2800 'section' => 'self-service',
2801 'description' => 'Only allow primary accounts to access self-service functionality.',
2802 'type' => 'checkbox',
2806 'key' => 'selfservice_server-phone_login',
2807 'section' => 'self-service',
2808 'description' => 'Allow login to self-service with phone number and PIN.',
2809 'type' => 'checkbox',
2813 'key' => 'selfservice_server-single_domain',
2814 'section' => 'self-service',
2815 'description' => 'If specified, only use this one domain for self-service access.',
2820 'key' => 'selfservice_server-login_svcpart',
2821 'section' => 'self-service',
2822 'description' => 'If specified, only allow the specified svcparts to login to self-service.',
2823 'type' => 'select-part_svc',
2828 'key' => 'selfservice-svc_forward_svcpart',
2829 'section' => 'self-service',
2830 'description' => 'Service for self-service forward editing.',
2831 'type' => 'select-part_svc',
2835 'key' => 'selfservice-password_reset_verification',
2836 'section' => 'self-service',
2837 'description' => 'If enabled, specifies the type of verification required for self-service password resets.',
2839 'select_hash' => [ '' => 'Password reset disabled',
2840 'email' => 'Click on a link in email',
2841 'paymask,amount,zip' => 'Click on a link in email, and also verify with credit card (or bank account) last 4 digits, payment amount and zip code',
2846 'key' => 'selfservice-password_reset_msgnum',
2847 'section' => 'self-service',
2848 'description' => 'Template to use for password reset emails.',
2849 %msg_template_options,
2853 'key' => 'selfservice-hide_invoices-taxclass',
2854 'section' => 'self-service',
2855 'description' => 'Hide invoices with only this package tax class from self-service and supress sending (emailing, printing, faxing) them. Typically set to something like "Previous balance" and used when importing legacy invoices into legacy_cust_bill.',
2860 'key' => 'selfservice-recent-did-age',
2861 'section' => 'self-service',
2862 'description' => 'If specified, defines "recent", in number of seconds, for "Download recently allocated DIDs" in self-service.',
2867 'key' => 'selfservice_server-view-wholesale',
2868 'section' => 'self-service',
2869 'description' => 'If enabled, use a wholesale package view in the self-service.',
2870 'type' => 'checkbox',
2874 'key' => 'selfservice-agent_signup',
2875 'section' => 'self-service',
2876 'description' => 'Allow agent signup via self-service.',
2877 'type' => 'checkbox',
2881 'key' => 'selfservice-agent_signup-agent_type',
2882 'section' => 'self-service',
2883 'description' => 'Agent type when allowing agent signup via self-service.',
2884 'type' => 'select-sub',
2885 'options_sub' => sub { require FS::Record;
2886 require FS::agent_type;
2887 map { $_->typenum => $_->atype }
2888 FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
2890 'option_sub' => sub { require FS::Record;
2891 require FS::agent_type;
2892 my $agent = FS::Record::qsearchs(
2893 'agent_type', { 'typenum'=>shift }
2895 $agent_type ? $agent_type->atype : '';
2900 'key' => 'selfservice-agent_login',
2901 'section' => 'self-service',
2902 'description' => 'Allow agent login via self-service.',
2903 'type' => 'checkbox',
2907 'key' => 'selfservice-self_suspend_reason',
2908 'section' => 'self-service',
2909 'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
2910 'type' => 'select-sub',
2911 'options_sub' => sub { require FS::Record;
2913 my $type = qsearchs('reason_type',
2916 map { $_->reasonnum => $_->reason }
2917 FS::Record::qsearch('reason',
2918 { reason_type => $type->typenum }
2921 'option_sub' => sub { require FS::Record;
2923 my $reason = FS::Record::qsearchs(
2924 'reason', { 'reasonnum' => shift }
2926 $reason ? $reason->reason : '';
2933 'key' => 'card_refund-days',
2934 'section' => 'billing',
2935 'description' => 'After a payment, the number of days a refund link will be available for that payment. Defaults to 120.',
2940 'key' => 'agent-showpasswords',
2942 'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
2943 'type' => 'checkbox',
2947 'key' => 'global_unique-username',
2948 'section' => 'username',
2949 '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.',
2951 'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
2955 'key' => 'global_unique-phonenum',
2957 '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.',
2959 'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
2963 'key' => 'global_unique-pbx_title',
2965 'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2967 'select_enum' => [ 'enabled', 'disabled' ],
2971 'key' => 'global_unique-pbx_id',
2973 'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
2975 'select_enum' => [ 'enabled', 'disabled' ],
2979 'key' => 'svc_external-skip_manual',
2981 '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).',
2982 'type' => 'checkbox',
2986 'key' => 'svc_external-display_type',
2988 'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
2990 'select_enum' => [ 'generic', 'artera_turbo', ],
2994 'key' => 'ticket_system',
2995 'section' => 'ticketing',
2996 'description' => 'Ticketing system integration. <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:RT_Installation">integrated ticketing installation instructions</a>). <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
2998 #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2999 'select_enum' => [ '', qw(RT_Internal RT_External) ],
3003 'key' => 'network_monitoring_system',
3004 'section' => 'network_monitoring',
3005 'description' => 'Networking monitoring system (NMS) integration. <b>Torrus_Internal</b> uses the built-in Torrus ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:3:Documentation:Torrus_Installation">integrated networking monitoring system installation instructions</a>).',
3007 'select_enum' => [ '', qw(Torrus_Internal) ],
3011 'key' => 'nms-auto_add-svc_ips',
3012 'section' => 'network_monitoring',
3013 'description' => 'Automatically add (and remove) IP addresses from these service tables to the network monitoring system.',
3014 'type' => 'selectmultiple',
3015 'select_enum' => [ 'svc_acct', 'svc_broadband', 'svc_dsl' ],
3019 'key' => 'nms-auto_add-community',
3020 'section' => 'network_monitoring',
3021 'description' => 'SNMP community string to use when automatically adding IP addresses from these services to the network monitoring system.',
3026 'key' => 'ticket_system-default_queueid',
3027 'section' => 'ticketing',
3028 'description' => 'Default queue used when creating new customer tickets.',
3029 'type' => 'select-sub',
3030 'options_sub' => sub {
3031 my $conf = new FS::Conf;
3032 if ( $conf->config('ticket_system') ) {
3033 eval "use FS::TicketSystem;";
3035 FS::TicketSystem->queues();
3040 'option_sub' => sub {
3041 my $conf = new FS::Conf;
3042 if ( $conf->config('ticket_system') ) {
3043 eval "use FS::TicketSystem;";
3045 FS::TicketSystem->queue(shift);
3052 'key' => 'ticket_system-force_default_queueid',
3053 'section' => 'ticketing',
3054 'description' => 'Disallow queue selection when creating new tickets from customer view.',
3055 'type' => 'checkbox',
3058 'key' => 'ticket_system-selfservice_queueid',
3059 'section' => 'ticketing',
3060 'description' => 'Queue used when creating new customer tickets from self-service. Defautls to ticket_system-default_queueid if not specified.',
3061 #false laziness w/above
3062 'type' => 'select-sub',
3063 'options_sub' => sub {
3064 my $conf = new FS::Conf;
3065 if ( $conf->config('ticket_system') ) {
3066 eval "use FS::TicketSystem;";
3068 FS::TicketSystem->queues();
3073 'option_sub' => sub {
3074 my $conf = new FS::Conf;
3075 if ( $conf->config('ticket_system') ) {
3076 eval "use FS::TicketSystem;";
3078 FS::TicketSystem->queue(shift);
3086 'key' => 'ticket_system-requestor',
3087 'section' => 'ticketing',
3088 'description' => 'Email address to use as the requestor for new tickets. If blank, the customer\'s invoicing address(es) will be used.',
3093 'key' => 'ticket_system-priority_reverse',
3094 'section' => 'ticketing',
3095 '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.',
3096 'type' => 'checkbox',
3100 'key' => 'ticket_system-custom_priority_field',
3101 'section' => 'ticketing',
3102 'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
3107 'key' => 'ticket_system-custom_priority_field-values',
3108 'section' => 'ticketing',
3109 'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
3110 'type' => 'textarea',
3114 'key' => 'ticket_system-custom_priority_field_queue',
3115 'section' => 'ticketing',
3116 'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
3121 'key' => 'ticket_system-selfservice_priority_field',
3122 'section' => 'ticketing',
3123 'description' => 'Custom field from the ticket system to use as a customer-managed priority field.',
3128 'key' => 'ticket_system-selfservice_edit_subject',
3129 'section' => 'ticketing',
3130 'description' => 'Allow customers to edit ticket subjects through selfservice.',
3131 'type' => 'checkbox',
3135 'key' => 'ticket_system-escalation',
3136 'section' => 'ticketing',
3137 'description' => 'Enable priority escalation of tickets as part of daily batch processing.',
3138 'type' => 'checkbox',
3142 'key' => 'ticket_system-rt_external_datasrc',
3143 'section' => 'ticketing',
3144 '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>',
3150 'key' => 'ticket_system-rt_external_url',
3151 'section' => 'ticketing',
3152 'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
3157 'key' => 'company_name',
3158 'section' => 'required',
3159 'description' => 'Your company name',
3161 'per_agent' => 1, #XXX just FS/FS/ClientAPI/Signup.pm
3165 'key' => 'company_url',
3167 'description' => 'Your company URL',
3173 'key' => 'company_address',
3174 'section' => 'required',
3175 'description' => 'Your company address',
3176 'type' => 'textarea',
3181 'key' => 'company_phonenum',
3182 'section' => 'notification',
3183 'description' => 'Your company phone number',
3189 'key' => 'echeck-void',
3190 'section' => 'deprecated',
3191 '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',
3192 'type' => 'checkbox',
3197 'section' => 'deprecated',
3198 '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',
3199 'type' => 'checkbox',
3204 'section' => 'deprecated',
3205 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable unvoiding of voided payments',
3206 'type' => 'checkbox',
3210 'key' => 'address1-search',
3212 'description' => 'Enable the ability to search the address1 field from the quick customer search. Not recommended in most cases as it tends to bring up too many search results - use explicit address searching from the advanced customer search instead.',
3213 'type' => 'checkbox',
3217 'key' => 'address2-search',
3219 'description' => 'Enable a "Unit" search box which searches the second address field. Useful for multi-tenant applications. See also: cust_main-require_address2',
3220 'type' => 'checkbox',
3224 'key' => 'cust_main-require_address2',
3226 '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',
3227 'type' => 'checkbox',
3231 'key' => 'agent-ship_address',
3233 '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.",
3234 'type' => 'checkbox',
3238 { 'key' => 'referral_credit',
3239 'section' => 'deprecated',
3240 '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.",
3241 'type' => 'checkbox',
3244 { 'key' => 'selfservice_server-cache_module',
3245 'section' => 'self-service',
3246 '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.',
3248 'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
3253 'section' => 'billing',
3254 '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).',
3255 'type' => [qw( checkbox textarea )],
3259 'key' => 'cust_bill-ftpformat',
3260 'section' => 'invoicing',
3261 'description' => 'Enable FTP of raw invoice data - format.',
3263 'options' => [ spool_formats() ],
3267 'key' => 'cust_bill-ftpserver',
3268 'section' => 'invoicing',
3269 'description' => 'Enable FTP of raw invoice data - server.',
3274 'key' => 'cust_bill-ftpusername',
3275 'section' => 'invoicing',
3276 'description' => 'Enable FTP of raw invoice data - server.',
3281 'key' => 'cust_bill-ftppassword',
3282 'section' => 'invoicing',
3283 'description' => 'Enable FTP of raw invoice data - server.',
3288 'key' => 'cust_bill-ftpdir',
3289 'section' => 'invoicing',
3290 'description' => 'Enable FTP of raw invoice data - server.',
3295 'key' => 'cust_bill-spoolformat',
3296 'section' => 'invoicing',
3297 'description' => 'Enable spooling of raw invoice data - format.',
3299 'options' => [ spool_formats() ],
3303 'key' => 'cust_bill-spoolagent',
3304 'section' => 'invoicing',
3305 'description' => 'Enable per-agent spooling of raw invoice data.',
3306 'type' => 'checkbox',
3310 'key' => 'bridgestone-batch_counter',
3312 'description' => 'Batch counter for spool files. Increments every time a spool file is uploaded.',
3318 'key' => 'bridgestone-prefix',
3320 'description' => 'Agent identifier for uploading to BABT printing service.',
3326 'key' => 'bridgestone-confirm_template',
3328 'description' => 'Confirmation email template for uploading to BABT service. Text::Template format, with variables "$zipfile" (name of the zipped file), "$seq" (sequence number), "$prefix" (user ID string), and "$rows" (number of records in the file). Should include Subject: and To: headers, separated from the rest of the message by a blank line.',
3329 # this could use a true message template, but it's hard to see how that
3330 # would make the world a better place
3331 'type' => 'textarea',
3336 'key' => 'ics-confirm_template',
3338 'description' => 'Confirmation email template for uploading to ICS invoice printing. Text::Template format, with variables "%count" and "%sum".',
3339 'type' => 'textarea',
3344 'key' => 'svc_acct-usage_suspend',
3345 'section' => 'billing',
3346 '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.',
3347 'type' => 'checkbox',
3351 'key' => 'svc_acct-usage_unsuspend',
3352 'section' => 'billing',
3353 '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.',
3354 'type' => 'checkbox',
3358 'key' => 'svc_acct-usage_threshold',
3359 'section' => 'billing',
3360 '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.',
3365 'key' => 'overlimit_groups',
3367 'description' => 'RADIUS group(s) to assign to svc_acct which has exceeded its bandwidth or time limit.',
3368 'type' => 'select-sub',
3371 'options_sub' => sub { require FS::Record;
3372 require FS::radius_group;
3373 map { $_->groupnum => $_->long_description }
3374 FS::Record::qsearch('radius_group', {} );
3376 'option_sub' => sub { require FS::Record;
3377 require FS::radius_group;
3378 my $radius_group = FS::Record::qsearchs(
3379 'radius_group', { 'groupnum' => shift }
3381 $radius_group ? $radius_group->long_description : '';
3386 'key' => 'cust-fields',
3388 'description' => 'Which customer fields to display on reports by default',
3390 'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
3394 'key' => 'cust_location-label_prefix',
3396 'description' => 'Optional "site ID" to show in the location label',
3398 'select_hash' => [ '' => '',
3399 'CoStAg' => 'CoStAgXXXXX (country, state, agent name, locationnum)',
3404 'key' => 'cust_pkg-display_times',
3406 'description' => 'Display full timestamps (not just dates) for customer packages. Useful if you are doing real-time things like hourly prepaid.',
3407 'type' => 'checkbox',
3411 'key' => 'cust_pkg-always_show_location',
3413 'description' => "Always display package locations, even when they're all the default service address.",
3414 'type' => 'checkbox',
3418 'key' => 'cust_pkg-group_by_location',
3420 'description' => "Group packages by location.",
3421 'type' => 'checkbox',
3425 'key' => 'cust_pkg-show_fcc_voice_grade_equivalent',
3427 'description' => "Show fields on package definitions for FCC Form 477 classification",
3428 'type' => 'checkbox',
3432 'key' => 'cust_pkg-large_pkg_size',
3434 'description' => "In customer view, summarize packages with more than this many services. Set to zero to never summarize packages.",
3439 'key' => 'svc_acct-edit_uid',
3440 'section' => 'shell',
3441 'description' => 'Allow UID editing.',
3442 'type' => 'checkbox',
3446 'key' => 'svc_acct-edit_gid',
3447 'section' => 'shell',
3448 'description' => 'Allow GID editing.',
3449 'type' => 'checkbox',
3453 'key' => 'svc_acct-no_edit_username',
3454 'section' => 'shell',
3455 'description' => 'Disallow username editing.',
3456 'type' => 'checkbox',
3460 'key' => 'zone-underscore',
3461 'section' => 'BIND',
3462 'description' => 'Allow underscores in zone names. As underscores are illegal characters in zone names, this option is not recommended.',
3463 'type' => 'checkbox',
3467 'key' => 'echeck-country',
3468 'section' => 'billing',
3469 'description' => 'Format electronic check information for the specified country.',
3471 'select_hash' => [ 'US' => 'United States',
3472 'CA' => 'Canada (enables branch)',
3478 'key' => 'voip-cust_accountcode_cdr',
3479 'section' => 'telephony',
3480 'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
3481 'type' => 'checkbox',
3485 'key' => 'voip-cust_cdr_spools',
3486 'section' => 'telephony',
3487 'description' => 'Enable the per-customer option for individual CDR spools.',
3488 'type' => 'checkbox',
3492 'key' => 'voip-cust_cdr_squelch',
3493 'section' => 'telephony',
3494 'description' => 'Enable the per-customer option for not printing CDR on invoices.',
3495 'type' => 'checkbox',
3499 'key' => 'voip-cdr_email',
3500 'section' => 'telephony',
3501 'description' => 'Include the call details on emailed invoices (and HTML invoices viewed in the backend), even if the customer is configured for not printing them on the invoices.',
3502 'type' => 'checkbox',
3506 'key' => 'voip-cust_email_csv_cdr',
3507 'section' => 'telephony',
3508 'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
3509 'type' => 'checkbox',
3513 'key' => 'cgp_rule-domain_templates',
3515 'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
3516 'type' => 'textarea',
3520 'key' => 'svc_forward-no_srcsvc',
3522 'description' => "Don't allow forwards from existing accounts, only arbitrary addresses. Useful when exporting to systems such as Communigate Pro which treat forwards in this fashion.",
3523 'type' => 'checkbox',
3527 'key' => 'svc_forward-arbitrary_dst',
3529 '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.",
3530 'type' => 'checkbox',
3534 'key' => 'tax-ship_address',
3535 'section' => 'billing',
3536 'description' => 'By default, tax calculations are done based on the billing address. Enable this switch to calculate tax based on the shipping address instead.',
3537 'type' => 'checkbox',
3541 'key' => 'tax-pkg_address',
3542 'section' => 'billing',
3543 '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).',
3544 'type' => 'checkbox',
3548 'key' => 'invoice-ship_address',
3549 'section' => 'invoicing',
3550 'description' => 'Include the shipping address on invoices.',
3551 'type' => 'checkbox',
3555 'key' => 'invoice-unitprice',
3556 'section' => 'invoicing',
3557 'description' => 'Enable unit pricing on invoices and quantities on packages.',
3558 'type' => 'checkbox',
3562 'key' => 'invoice-smallernotes',
3563 'section' => 'invoicing',
3564 'description' => 'Display the notes section in a smaller font on invoices.',
3565 'type' => 'checkbox',
3569 'key' => 'invoice-smallerfooter',
3570 'section' => 'invoicing',
3571 'description' => 'Display footers in a smaller font on invoices.',
3572 'type' => 'checkbox',
3576 'key' => 'postal_invoice-fee_pkgpart',
3577 'section' => 'billing',
3578 'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
3579 'type' => 'select-part_pkg',
3584 'key' => 'postal_invoice-recurring_only',
3585 'section' => 'billing',
3586 'description' => 'The postal invoice fee is omitted on invoices without recurring charges when this is set.',
3587 'type' => 'checkbox',
3591 'key' => 'batch-enable',
3592 'section' => 'deprecated', #make sure batch-enable_payby is set for
3593 #everyone before removing
3594 'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
3595 'type' => 'checkbox',
3599 'key' => 'batch-enable_payby',
3600 'section' => 'billing',
3601 'description' => 'Enable batch processing for the specified payment types.',
3602 'type' => 'selectmultiple',
3603 'select_enum' => [qw( CARD CHEK )],
3607 'key' => 'realtime-disable_payby',
3608 'section' => 'billing',
3609 'description' => 'Disable realtime processing for the specified payment types.',
3610 'type' => 'selectmultiple',
3611 'select_enum' => [qw( CARD CHEK )],
3615 'key' => 'batch-default_format',
3616 'section' => 'billing',
3617 'description' => 'Default format for batches.',
3619 'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch',
3620 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
3621 'paymentech', 'ach-spiritone', 'RBC'
3625 { 'key' => 'batch-gateway-CARD',
3626 'section' => 'billing',
3627 'description' => 'Business::BatchPayment gateway for credit card batches.',
3628 %batch_gateway_options,
3631 { 'key' => 'batch-gateway-CHEK',
3632 'section' => 'billing',
3633 'description' => 'Business::BatchPayment gateway for check batches.',
3634 %batch_gateway_options,
3638 'key' => 'batch-reconsider',
3639 'section' => 'billing',
3640 'description' => 'Allow imported batch results to change the status of payments from previous imports. Enable this only if your gateway is known to send both positive and negative results for the same batch.',
3641 'type' => 'checkbox',
3645 'key' => 'batch-auto_resolve_days',
3646 'section' => 'billing',
3647 'description' => 'Automatically resolve payment batches this many days after they were first downloaded.',
3652 'key' => 'batch-auto_resolve_status',
3653 'section' => 'billing',
3654 'description' => 'When automatically resolving payment batches, take this action for payments of unknown status.',
3656 'select_enum' => [ 'approve', 'decline' ],
3660 'key' => 'batch-errors_to',
3661 'section' => 'billing',
3662 'description' => 'Email errors when processing batches to this address. If unspecified, batch processing will stop immediately on error.',
3666 #lists could be auto-generated from pay_batch info
3668 'key' => 'batch-fixed_format-CARD',
3669 'section' => 'billing',
3670 'description' => 'Fixed (unchangeable) format for credit card batches.',
3672 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
3673 'csv-chase_canada-E-xactBatch', 'paymentech' ]
3677 'key' => 'batch-fixed_format-CHEK',
3678 'section' => 'billing',
3679 'description' => 'Fixed (unchangeable) format for electronic check batches.',
3681 'select_enum' => [ 'NACHA', 'csv-td_canada_trust-merchant_pc_batch', 'BoM',
3682 'PAP', 'paymentech', 'ach-spiritone', 'RBC',
3683 'td_eft1464', 'eft_canada'
3688 'key' => 'batch-increment_expiration',
3689 'section' => 'billing',
3690 'description' => 'Increment expiration date years in batches until cards are current. Make sure this is acceptable to your batching provider before enabling.',
3691 'type' => 'checkbox'
3695 'key' => 'batchconfig-BoM',
3696 'section' => 'billing',
3697 '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',
3698 'type' => 'textarea',
3702 'key' => 'batchconfig-PAP',
3703 'section' => 'billing',
3704 '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',
3705 'type' => 'textarea',
3709 'key' => 'batchconfig-csv-chase_canada-E-xactBatch',
3710 'section' => 'billing',
3711 'description' => 'Gateway ID for Chase Canada E-xact batching',
3716 'key' => 'batchconfig-paymentech',
3717 'section' => 'billing',
3718 'description' => 'Configuration for Chase Paymentech batching, six lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password (for batch uploads), 6. Flag to send recurring indicator.',
3719 'type' => 'textarea',
3723 'key' => 'batchconfig-RBC',
3724 'section' => 'billing',
3725 'description' => 'Configuration for Royal Bank of Canada PDS batching, four lines: 1. Client number, 2. Short name, 3. Long name, 4. Transaction code.',
3726 'type' => 'textarea',
3730 'key' => 'batchconfig-td_eft1464',
3731 'section' => 'billing',
3732 'description' => 'Configuration for TD Bank EFT1464 batching, seven lines: 1. Originator ID, 2. Datacenter Code, 3. Short name, 4. Long name, 5. Returned payment branch number, 6. Returned payment account, 7. Transaction code.',
3733 'type' => 'textarea',
3737 'key' => 'batchconfig-eft_canada',
3738 'section' => 'billing',
3739 'description' => 'Configuration for EFT Canada batching, four lines: 1. SFTP username, 2. SFTP password, 3. Transaction code, 4. Number of days to delay process date. If you are using separate per-agent batches (batch-spoolagent), you must set this option separately for each agent, as the global setting will be ignored.',
3740 'type' => 'textarea',
3745 'key' => 'batchconfig-nacha-destination',
3746 'section' => 'billing',
3747 'description' => 'Configuration for NACHA batching, Destination (9 digit transit routing number).',
3752 'key' => 'batchconfig-nacha-destination_name',
3753 'section' => 'billing',
3754 'description' => 'Configuration for NACHA batching, Destination (Bank Name, up to 23 characters).',
3759 'key' => 'batchconfig-nacha-origin',
3760 'section' => 'billing',
3761 'description' => 'Configuration for NACHA batching, Origin (your 10-digit company number, IRS tax ID recommended).',
3766 'key' => 'batch-manual_approval',
3767 'section' => 'billing',
3768 'description' => 'Allow manual batch closure, which will approve all payments that do not yet have a status. This is not advised unless needed for specific payment processors that provide a report of rejected rather than approved payments.',
3769 'type' => 'checkbox',
3773 'key' => 'batch-spoolagent',
3774 'section' => 'billing',
3775 'description' => 'Store payment batches per-agent.',
3776 'type' => 'checkbox',
3780 'key' => 'payment_history-years',
3782 'description' => 'Number of years of payment history to show by default. Currently defaults to 2.',
3787 'key' => 'change_history-years',
3789 'description' => 'Number of years of change history to show by default. Currently defaults to 0.5.',
3794 'key' => 'cust_main-packages-years',
3796 'description' => 'Number of years to show old (cancelled and one-time charge) packages by default. Currently defaults to 2.',
3801 'key' => 'cust_main-use_comments',
3803 'description' => 'Display free form comments on the customer edit screen. Useful as a scratch pad.',
3804 'type' => 'checkbox',
3808 'key' => 'cust_main-disable_notes',
3810 'description' => 'Disable new style customer notes - timestamped and user identified customer notes. Useful in tracking who did what.',
3811 'type' => 'checkbox',
3815 'key' => 'cust_main_note-display_times',
3817 'description' => 'Display full timestamps (not just dates) for customer notes.',
3818 'type' => 'checkbox',
3822 'key' => 'cust_main-ticket_statuses',
3824 'description' => 'Show tickets with these statuses on the customer view page.',
3825 'type' => 'selectmultiple',
3826 'select_enum' => [qw( new open stalled resolved rejected deleted )],
3830 'key' => 'cust_main-max_tickets',
3832 'description' => 'Maximum number of tickets to show on the customer view page.',
3837 'key' => 'cust_main-enable_birthdate',
3839 'description' => 'Enable tracking of a birth date with each customer record',
3840 'type' => 'checkbox',
3844 'key' => 'cust_main-enable_spouse_birthdate',
3846 'description' => 'Enable tracking of a spouse birth date with each customer record',
3847 'type' => 'checkbox',
3851 'key' => 'cust_main-enable_anniversary_date',
3853 'description' => 'Enable tracking of an anniversary date with each customer record',
3854 'type' => 'checkbox',
3858 'key' => 'cust_main-edit_calling_list_exempt',
3860 'description' => 'Display the "calling_list_exempt" checkbox on customer edit.',
3861 'type' => 'checkbox',
3865 'key' => 'support-key',
3867 '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.',
3872 'key' => 'card-types',
3873 'section' => 'billing',
3874 'description' => 'Select one or more card types to enable only those card types. If no card types are selected, all card types are available.',
3875 'type' => 'selectmultiple',
3876 'select_enum' => \@card_types,
3880 'key' => 'disable-fuzzy',
3882 'description' => 'Disable fuzzy searching. Speeds up searching for large sites, but only shows exact matches.',
3883 'type' => 'checkbox',
3887 'key' => 'fuzzy-fuzziness',
3889 'description' => 'Set the "fuzziness" of fuzzy searching (see the String::Approx manpage for details). Defaults to 10%',
3894 'key' => 'enable_fuzzy_on_exact',
3896 'description' => 'Enable approximate customer searching even when an exact match is found.',
3897 'type' => 'checkbox',
3900 { 'key' => 'pkg_referral',
3902 'description' => 'Enable package-specific advertising sources.',
3903 'type' => 'checkbox',
3906 { 'key' => 'pkg_referral-multiple',
3908 'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
3909 'type' => 'checkbox',
3913 'key' => 'dashboard-install_welcome',
3915 'description' => 'New install welcome screen.',
3917 'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
3921 'key' => 'dashboard-toplist',
3923 'description' => 'List of items to display on the top of the front page',
3924 'type' => 'textarea',
3928 'key' => 'impending_recur_msgnum',
3929 'section' => 'notification',
3930 'description' => 'Template to use for alerts about first-time recurring billing.',
3931 %msg_template_options,
3935 'key' => 'impending_recur_template',
3936 'section' => 'deprecated',
3937 '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>',
3938 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
3939 'type' => 'textarea',
3943 'key' => 'logo.png',
3944 'section' => 'UI', #'invoicing' ?
3945 'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format. Suggested size somewhere near 92x62.',
3947 'per_agent' => 1, #XXX just view/logo.cgi, which is for the global
3948 #old-style editor anyway...?
3953 'key' => 'logo.eps',
3954 'section' => 'invoicing',
3955 'description' => 'Company logo for printed and PDF invoices, in EPS format.',
3957 'per_agent' => 1, #XXX as above, kinda
3962 'key' => 'selfservice-ignore_quantity',
3963 'section' => 'self-service',
3964 'description' => 'Ignores service quantity restrictions in self-service context. Strongly not recommended - just set your quantities correctly in the first place.',
3965 'type' => 'checkbox',
3969 'key' => 'selfservice-session_timeout',
3970 'section' => 'self-service',
3971 'description' => 'Self-service session timeout. Defaults to 1 hour.',
3973 'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
3977 'key' => 'disable_setup_suspended_pkgs',
3978 'section' => 'billing',
3979 'description' => 'Disables charging of setup fees for suspended packages.',
3980 'type' => 'checkbox',
3984 'key' => 'password-generated-allcaps',
3985 'section' => 'password',
3986 'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
3987 'type' => 'checkbox',
3991 'key' => 'datavolume-forcemegabytes',
3993 'description' => 'All data volumes are expressed in megabytes',
3994 'type' => 'checkbox',
3998 'key' => 'datavolume-significantdigits',
4000 'description' => 'number of significant digits to use to represent data volumes',
4005 'key' => 'disable_void_after',
4006 'section' => 'billing',
4007 'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
4012 'key' => 'disable_line_item_date_ranges',
4013 'section' => 'billing',
4014 'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
4015 'type' => 'checkbox',
4019 'key' => 'cust_bill-line_item-date_style',
4020 'section' => 'billing',
4021 'description' => 'Display format for line item date ranges on invoice line items.',
4023 'select_hash' => [ '' => 'STARTDATE-ENDDATE',
4024 'month_of' => 'Month of MONTHNAME',
4025 'X_month' => 'DATE_DESC MONTHNAME',
4031 'key' => 'cust_bill-line_item-date_style-non_monthly',
4032 'section' => 'billing',
4033 'description' => 'If set, override cust_bill-line_item-date_style for non-monthly charges.',
4035 'select_hash' => [ '' => 'Default',
4036 'start_end' => 'STARTDATE-ENDDATE',
4037 'month_of' => 'Month of MONTHNAME',
4038 'X_month' => 'DATE_DESC MONTHNAME',
4044 'key' => 'cust_bill-line_item-date_description',
4045 'section' => 'billing',
4046 'description' => 'Text to display for "DATE_DESC" when using cust_bill-line_item-date_style DATE_DESC MONTHNAME.',
4052 'key' => 'support_packages',
4054 '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...
4055 'type' => 'select-part_pkg',
4060 'key' => 'cust_main-require_phone',
4062 'description' => 'Require daytime or night phone for all customer records.',
4063 'type' => 'checkbox',
4068 'key' => 'cust_main-require_invoicing_list_email',
4070 'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
4071 'type' => 'checkbox',
4076 'key' => 'cust_main-check_unique',
4078 'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
4082 'address' => 'Billing or service address',
4087 'key' => 'svc_acct-display_paid_time_remaining',
4089 'description' => 'Show paid time remaining in addition to time remaining.',
4090 'type' => 'checkbox',
4094 'key' => 'cancel_credit_type',
4095 'section' => 'billing',
4096 'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
4097 reason_type_options('R'),
4101 'key' => 'suspend_credit_type',
4102 'section' => 'billing',
4103 'description' => 'The group to use for new, automatically generated credit reasons resulting from package suspension.',
4104 reason_type_options('R'),
4108 'key' => 'referral_credit_type',
4109 'section' => 'deprecated',
4110 '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.',
4111 reason_type_options('R'),
4115 'key' => 'signup_credit_type',
4116 'section' => 'billing', #self-service?
4117 'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
4118 reason_type_options('R'),
4122 'key' => 'prepayment_discounts-credit_type',
4123 'section' => 'billing',
4124 'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
4125 reason_type_options('R'),
4129 'key' => 'cust_main-agent_custid-format',
4131 'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
4134 '' => 'Numeric only',
4135 '\d{7}' => 'Numeric only, exactly 7 digits',
4136 'ww?d+' => 'Numeric with one or two letter prefix',
4141 'key' => 'card_masking_method',
4143 '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.',
4146 '' => '123456xxxxxx1234',
4147 'first6last2' => '123456xxxxxxxx12',
4148 'first4last4' => '1234xxxxxxxx1234',
4149 'first4last2' => '1234xxxxxxxxxx12',
4150 'first2last4' => '12xxxxxxxxxx1234',
4151 'first2last2' => '12xxxxxxxxxxxx12',
4152 'first0last4' => 'xxxxxxxxxxxx1234',
4153 'first0last2' => 'xxxxxxxxxxxxxx12',
4158 'key' => 'disable_previous_balance',
4159 'section' => 'invoicing',
4160 'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices.',
4161 'type' => 'checkbox',
4166 'key' => 'previous_balance-exclude_from_total',
4167 'section' => 'invoicing',
4168 'description' => 'Do not include previous balance in the \'Total\' line. Only meaningful when invoice_sections is false. Optionally provide text to override the Total New Charges description',
4169 'type' => [ qw(checkbox text) ],
4173 'key' => 'previous_balance-section',
4174 'section' => 'invoicing',
4175 'description' => 'Show previous invoice balances in a separate invoice section. Does not require invoice_sections to be enabled.',
4176 'type' => 'checkbox',
4180 'key' => 'previous_balance-summary_only',
4181 'section' => 'invoicing',
4182 'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
4183 'type' => 'checkbox',
4187 'key' => 'previous_balance-show_credit',
4188 'section' => 'invoicing',
4189 'description' => 'Show the customer\'s credit balance on invoices when applicable.',
4190 'type' => 'checkbox',
4194 'key' => 'previous_balance-show_on_statements',
4195 'section' => 'invoicing',
4196 'description' => 'Show previous invoices on statements, without itemized charges.',
4197 'type' => 'checkbox',
4201 'key' => 'previous_balance-payments_since',
4202 'section' => 'invoicing',
4203 'description' => 'Instead of showing payments (and credits) applied to the invoice, show those received since the previous invoice date.',
4204 'type' => 'checkbox',
4208 'key' => 'balance_due_below_line',
4209 'section' => 'invoicing',
4210 'description' => 'Place the balance due message below a line. Only meaningful when when invoice_sections is false.',
4211 'type' => 'checkbox',
4215 'key' => 'always_show_tax',
4216 'section' => 'invoicing',
4217 'description' => 'Show a line for tax on the invoice even when the tax is zero. Optionally provide text for the tax name to show.',
4218 'type' => [ qw(checkbox text) ],
4222 'key' => 'address_standardize_method',
4223 'section' => 'UI', #???
4224 'description' => 'Method for standardizing customer addresses.',
4226 'select_hash' => [ '' => '',
4227 'usps' => 'U.S. Postal Service',
4228 'ezlocate' => 'EZLocate',
4229 'tomtom' => 'TomTom',
4230 'melissa' => 'Melissa WebSmart',
4235 'key' => 'usps_webtools-userid',
4237 '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.',
4242 'key' => 'usps_webtools-password',
4244 '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.',
4249 'key' => 'tomtom-userid',
4251 'description' => 'TomTom geocoding service API key. See <a href="http://www.tomtom.com/">the TomTom website</a> to obtain a key. This is recommended for addresses in the United States only.',
4256 'key' => 'ezlocate-userid',
4258 'description' => 'User ID for EZ-Locate service. See <a href="http://www.geocode.com/">the TomTom website</a> for access and pricing information.',
4263 'key' => 'ezlocate-password',
4265 'description' => 'Password for EZ-Locate service.',
4270 'key' => 'melissa-userid',
4271 'section' => 'UI', # it's really not...
4272 'description' => 'User ID for Melissa WebSmart service. See <a href="http://www.melissadata.com/">the Melissa website</a> for access and pricing.',
4277 'key' => 'melissa-enable_geocoding',
4279 'description' => 'Use the Melissa service for census tract and coordinate lookups. Enable this only if your subscription includes geocoding access.',
4280 'type' => 'checkbox',
4284 'key' => 'cust_main-auto_standardize_address',
4286 'description' => 'When using USPS web tools, automatically standardize the address without asking.',
4287 'type' => 'checkbox',
4291 'key' => 'cust_main-require_censustract',
4293 'description' => 'Customer is required to have a census tract. Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
4294 'type' => 'checkbox',
4298 'key' => 'census_year',
4300 'description' => 'The year to use in census tract lookups. NOTE: you need to select 2012 or 2013 for Year 2010 Census tract codes. A selection of 2011 provides Year 2000 Census tract codes. Use the freeside-censustract-update tool if exisitng customers need to be changed.',
4302 'select_enum' => [ qw( 2013 2012 2011 ) ],
4306 'key' => 'tax_district_method',
4308 'description' => 'The method to use to look up tax district codes.',
4310 #'select_hash' => [ FS::Misc::Geo::get_district_methods() ],
4311 #after RT#13763, using FS::Misc::Geo here now causes a dependancy loop :/
4314 'wa_sales' => 'Washington sales tax',
4319 'key' => 'company_latitude',
4321 'description' => 'Your company latitude (-90 through 90)',
4326 'key' => 'company_longitude',
4328 'description' => 'Your company longitude (-180 thru 180)',
4333 'key' => 'geocode_module',
4335 'description' => 'Module to geocode (retrieve a latitude and longitude for) addresses',
4337 'select_enum' => [ 'Geo::Coder::Googlev3' ],
4341 'key' => 'geocode-require_nw_coordinates',
4343 'description' => 'Require latitude and longitude in the North Western quadrant, e.g. for North American co-ordinates, etc.',
4344 'type' => 'checkbox',
4348 'key' => 'disable_acl_changes',
4350 'description' => 'Disable all ACL changes, for demos.',
4351 'type' => 'checkbox',
4355 'key' => 'disable_settings_changes',
4357 'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
4358 'type' => [qw( checkbox text )],
4362 'key' => 'cust_main-edit_agent_custid',
4364 'description' => 'Enable editing of the agent_custid field.',
4365 'type' => 'checkbox',
4369 'key' => 'cust_main-default_agent_custid',
4371 'description' => 'Display the agent_custid field when available instead of the custnum field.',
4372 'type' => 'checkbox',
4376 'key' => 'cust_main-title-display_custnum',
4378 'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
4379 'type' => 'checkbox',
4383 'key' => 'cust_bill-default_agent_invid',
4385 'description' => 'Display the agent_invid field when available instead of the invnum field.',
4386 'type' => 'checkbox',
4390 'key' => 'cust_main-auto_agent_custid',
4392 'description' => 'Automatically assign an agent_custid - select format',
4394 'select_hash' => [ '' => 'No',
4395 '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
4400 'key' => 'cust_main-custnum-display_prefix',
4402 'description' => 'Prefix the customer number with this string for display purposes.',
4408 'key' => 'cust_main-custnum-display_special',
4410 'description' => 'Use this customer number prefix format',
4412 'select_hash' => [ '' => '',
4413 'CoStAg' => 'CoStAg (country, state, agent name or display_prefix)',
4414 'CoStCl' => 'CoStCl (country, state, class name)' ],
4418 'key' => 'cust_main-custnum-display_length',
4420 'description' => 'Zero fill the customer number to this many digits for display purposes.',
4425 'key' => 'cust_main-default_areacode',
4427 'description' => 'Default area code for customers.',
4432 'key' => 'order_pkg-no_start_date',
4434 'description' => 'Don\'t set a default start date for new packages.',
4435 'type' => 'checkbox',
4439 'key' => 'part_pkg-delay_start',
4441 'description' => 'Enabled "delayed start" option for packages.',
4442 'type' => 'checkbox',
4446 'key' => 'mcp_svcpart',
4448 'description' => 'Master Control Program svcpart. Leave this blank.',
4449 'type' => 'text', #select-part_svc
4453 'key' => 'cust_bill-max_same_services',
4454 'section' => 'invoicing',
4455 '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.',
4460 'key' => 'cust_bill-consolidate_services',
4461 'section' => 'invoicing',
4462 'description' => 'Consolidate service display into fewer lines on invoices rather than one per service.',
4463 'type' => 'checkbox',
4467 'key' => 'suspend_email_admin',
4469 'description' => 'Destination admin email address to enable suspension notices',
4474 'key' => 'unsuspend_email_admin',
4476 'description' => 'Destination admin email address to enable unsuspension notices',
4481 'key' => 'email_report-subject',
4483 'description' => 'Subject for reports emailed by freeside-fetch. Defaults to "Freeside report".',
4488 'key' => 'selfservice-head',
4489 'section' => 'self-service',
4490 'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
4491 'type' => 'textarea', #htmlarea?
4497 'key' => 'selfservice-body_header',
4498 'section' => 'self-service',
4499 'description' => 'HTML header for the self-service interface',
4500 'type' => 'textarea', #htmlarea?
4505 'key' => 'selfservice-body_footer',
4506 'section' => 'self-service',
4507 'description' => 'HTML footer for the self-service interface',
4508 'type' => 'textarea', #htmlarea?
4514 'key' => 'selfservice-body_bgcolor',
4515 'section' => 'self-service',
4516 'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
4522 'key' => 'selfservice-box_bgcolor',
4523 'section' => 'self-service',
4524 'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0',
4530 'key' => 'selfservice-stripe1_bgcolor',
4531 'section' => 'self-service',
4532 'description' => 'HTML color for self-service interface lists (primary stripe), for example, #FFFFFF',
4538 'key' => 'selfservice-stripe2_bgcolor',
4539 'section' => 'self-service',
4540 'description' => 'HTML color for self-service interface lists (alternate stripe), for example, #DDDDDD',
4546 'key' => 'selfservice-text_color',
4547 'section' => 'self-service',
4548 'description' => 'HTML text color for the self-service interface, for example, #000000',
4554 'key' => 'selfservice-link_color',
4555 'section' => 'self-service',
4556 'description' => 'HTML link color for the self-service interface, for example, #0000FF',
4562 'key' => 'selfservice-vlink_color',
4563 'section' => 'self-service',
4564 'description' => 'HTML visited link color for the self-service interface, for example, #FF00FF',
4570 'key' => 'selfservice-hlink_color',
4571 'section' => 'self-service',
4572 'description' => 'HTML hover link color for the self-service interface, for example, #808080',
4578 'key' => 'selfservice-alink_color',
4579 'section' => 'self-service',
4580 'description' => 'HTML active (clicked) link color for the self-service interface, for example, #808080',
4586 'key' => 'selfservice-font',
4587 'section' => 'self-service',
4588 'description' => 'HTML font CSS for the self-service interface, for example, 0.9em/1.5em Arial, Helvetica, Geneva, sans-serif',
4594 'key' => 'selfservice-no_logo',
4595 'section' => 'self-service',
4596 'description' => 'Disable the logo in self-service',
4597 'type' => 'checkbox',
4602 'key' => 'selfservice-title_color',
4603 'section' => 'self-service',
4604 'description' => 'HTML color for the self-service title, for example, #000000',
4610 'key' => 'selfservice-title_align',
4611 'section' => 'self-service',
4612 'description' => 'HTML alignment for the self-service title, for example, center',
4617 'key' => 'selfservice-title_size',
4618 'section' => 'self-service',
4619 'description' => 'HTML font size for the self-service title, for example, 3',
4625 'key' => 'selfservice-title_left_image',
4626 'section' => 'self-service',
4627 'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4633 'key' => 'selfservice-title_right_image',
4634 'section' => 'self-service',
4635 'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4641 'key' => 'selfservice-menu_disable',
4642 'section' => 'self-service',
4643 'description' => 'Disable the selected menu entries in the self-service menu',
4644 'type' => 'selectmultiple',
4645 'select_enum' => [ #false laziness w/myaccount_menu.html
4648 'Purchase additional package',
4649 'Recharge my account with a credit card',
4650 'Recharge my account with a check',
4651 'Recharge my account with a prepaid card',
4654 'Setup my services',
4655 'Change my information',
4656 'Change billing address',
4657 'Change service address',
4658 'Change payment information',
4659 'Change password(s)',
4666 'key' => 'selfservice-menu_skipblanks',
4667 'section' => 'self-service',
4668 'description' => 'Skip blank (spacer) entries in the self-service menu',
4669 'type' => 'checkbox',
4674 'key' => 'selfservice-menu_skipheadings',
4675 'section' => 'self-service',
4676 'description' => 'Skip the unclickable heading entries in the self-service menu',
4677 'type' => 'checkbox',
4682 'key' => 'selfservice-menu_bgcolor',
4683 'section' => 'self-service',
4684 'description' => 'HTML color for the self-service menu, for example, #C0C0C0',
4690 'key' => 'selfservice-menu_fontsize',
4691 'section' => 'self-service',
4692 'description' => 'HTML font size for the self-service menu, for example, -1',
4697 'key' => 'selfservice-menu_nounderline',
4698 'section' => 'self-service',
4699 'description' => 'Styles menu links in the self-service without underlining.',
4700 'type' => 'checkbox',
4706 'key' => 'selfservice-menu_top_image',
4707 'section' => 'self-service',
4708 'description' => 'Image used for the top of the menu in the self-service interface, in PNG format.',
4714 'key' => 'selfservice-menu_body_image',
4715 'section' => 'self-service',
4716 'description' => 'Repeating image used for the body of the menu in the self-service interface, in PNG format.',
4722 'key' => 'selfservice-menu_bottom_image',
4723 'section' => 'self-service',
4724 'description' => 'Image used for the bottom of the menu in the self-service interface, in PNG format.',
4730 'key' => 'selfservice-view_usage_nodomain',
4731 'section' => 'self-service',
4732 'description' => 'Show usernames without their domains in "View my usage" in the self-service interface.',
4733 'type' => 'checkbox',
4737 'key' => 'selfservice-login_banner_image',
4738 'section' => 'self-service',
4739 'description' => 'Banner image shown on the login page, in PNG format.',
4744 'key' => 'selfservice-login_banner_url',
4745 'section' => 'self-service',
4746 'description' => 'Link for the login banner.',
4751 'key' => 'ng_selfservice-menu',
4752 'section' => 'self-service',
4753 'description' => 'Custom menu for the next-generation self-service interface. Each line is in the format "link Label", for example "main.php Home". Sub-menu items are listed on subsequent lines. Blank lines terminate the submenu.', #more docs/examples would be helpful
4754 'type' => 'textarea',
4758 'key' => 'signup-no_company',
4759 'section' => 'self-service',
4760 'description' => "Don't display a field for company name on signup.",
4761 'type' => 'checkbox',
4765 'key' => 'signup-recommend_email',
4766 'section' => 'self-service',
4767 'description' => 'Encourage the entry of an invoicing email address on signup.',
4768 'type' => 'checkbox',
4772 'key' => 'signup-recommend_daytime',
4773 'section' => 'self-service',
4774 'description' => 'Encourage the entry of a daytime phone number on signup.',
4775 'type' => 'checkbox',
4779 'key' => 'signup-duplicate_cc-warn_hours',
4780 'section' => 'self-service',
4781 'description' => 'Issue a warning if the same credit card is used for multiple signups within this many hours.',
4786 'key' => 'svc_phone-radius-password',
4787 'section' => 'telephony',
4788 'description' => 'Password when exporting svc_phone records to RADIUS',
4791 '' => 'Use default from svc_phone-radius-default_password config',
4792 'countrycode_phonenum' => 'Phone number (with country code)',
4797 'key' => 'svc_phone-radius-default_password',
4798 'section' => 'telephony',
4799 'description' => 'Default password when exporting svc_phone records to RADIUS',
4804 'key' => 'svc_phone-allow_alpha_phonenum',
4805 'section' => 'telephony',
4806 'description' => 'Allow letters in phone numbers.',
4807 'type' => 'checkbox',
4811 'key' => 'svc_phone-domain',
4812 'section' => 'telephony',
4813 'description' => 'Track an optional domain association with each phone service.',
4814 'type' => 'checkbox',
4818 'key' => 'svc_phone-phone_name-max_length',
4819 'section' => 'telephony',
4820 'description' => 'Maximum length of the phone service "Name" field (svc_phone.phone_name). Sometimes useful to limit this (to 15?) when exporting as Caller ID data.',
4825 'key' => 'svc_phone-random_pin',
4826 'section' => 'telephony',
4827 'description' => 'Number of random digits to generate in the "PIN" field, if empty.',
4832 'key' => 'svc_phone-lnp',
4833 'section' => 'telephony',
4834 'description' => 'Enables Number Portability features for svc_phone',
4835 'type' => 'checkbox',
4839 'key' => 'default_phone_countrycode',
4841 'description' => 'Default countrcode',
4846 'key' => 'cdr-charged_party-field',
4847 'section' => 'telephony',
4848 'description' => 'Set the charged_party field of CDRs to this field.',
4849 'type' => 'select-sub',
4850 'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
4851 map { $_ => $fields->{$_}||$_ }
4852 grep { $_ !~ /^(acctid|charged_party)$/ }
4853 FS::Schema::dbdef->table('cdr')->columns;
4855 'option_sub' => sub { my $f = shift;
4856 FS::cdr->table_info->{'fields'}{$f} || $f;
4860 #probably deprecate in favor of cdr-charged_party-field above
4862 'key' => 'cdr-charged_party-accountcode',
4863 'section' => 'telephony',
4864 'description' => 'Set the charged_party field of CDRs to the accountcode.',
4865 'type' => 'checkbox',
4869 'key' => 'cdr-charged_party-accountcode-trim_leading_0s',
4870 'section' => 'telephony',
4871 'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
4872 'type' => 'checkbox',
4876 # 'key' => 'cdr-charged_party-truncate_prefix',
4878 # 'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
4883 # 'key' => 'cdr-charged_party-truncate_length',
4885 # 'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
4890 'key' => 'cdr-charged_party_rewrite',
4891 'section' => 'telephony',
4892 '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*.',
4893 'type' => 'checkbox',
4897 'key' => 'cdr-taqua-da_rewrite',
4898 'section' => 'telephony',
4899 '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.',
4904 'key' => 'cdr-taqua-accountcode_rewrite',
4905 'section' => 'telephony',
4906 'description' => 'For the Taqua CDR format, pull accountcodes from secondary CDRs with matching sessionNumber.',
4907 'type' => 'checkbox',
4911 'key' => 'cdr-taqua-callerid_rewrite',
4912 'section' => 'telephony',
4913 'description' => 'For the Taqua CDR format, pull Caller ID blocking information from secondary CDRs.',
4914 'type' => 'checkbox',
4918 'key' => 'cdr-asterisk_australia_rewrite',
4919 'section' => 'telephony',
4920 'description' => 'For Asterisk CDRs, assign CDR type numbers based on Australian conventions.',
4921 'type' => 'checkbox',
4925 'key' => 'cdr-gsm_tap3-sender',
4926 'section' => 'telephony',
4927 'description' => 'GSM TAP3 Sender network (5 letter code)',
4932 'key' => 'cust_pkg-show_autosuspend',
4934 'description' => 'Show package auto-suspend dates. Use with caution for now; can slow down customer view for large insallations.',
4935 'type' => 'checkbox',
4939 'key' => 'cdr-asterisk_forward_rewrite',
4940 'section' => 'telephony',
4941 '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").',
4942 'type' => 'checkbox',
4946 'key' => 'mc-outbound_packages',
4948 'description' => "Don't use this.",
4949 'type' => 'select-part_pkg',
4954 'key' => 'disable-cust-pkg_class',
4956 'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
4957 'type' => 'checkbox',
4961 'key' => 'queued-max_kids',
4963 'description' => 'Maximum number of queued processes. Defaults to 10.',
4968 'key' => 'queued-sleep_time',
4970 'description' => 'Time to sleep between attempts to find new jobs to process in the queue. Defaults to 10. Installations doing real-time CDR processing for prepaid may want to set it lower.',
4975 'key' => 'queue-no_history',
4977 'description' => "Don't recreate the h_queue and h_queue_arg tables on upgrades. This can save disk space for large installs, especially when using prepaid or multi-process billing. After turning this option on, drop the h_queue and h_queue_arg tables, run freeside-dbdef-create and restart Apache and Freeside.",
4978 'type' => 'checkbox',
4982 'key' => 'cancelled_cust-noevents',
4983 'section' => 'billing',
4984 'description' => "Don't run events for cancelled customers",
4985 'type' => 'checkbox',
4989 'key' => 'agent-invoice_template',
4990 'section' => 'invoicing',
4991 'description' => 'Enable display/edit of old-style per-agent invoice template selection',
4992 'type' => 'checkbox',
4996 'key' => 'svc_broadband-manage_link',
4998 'description' => 'URL for svc_broadband "Manage Device" link. The following substitutions are available: $ip_addr and $mac_addr.',
5003 'key' => 'svc_broadband-manage_link_text',
5005 'description' => 'Label for "Manage Device" link',
5010 'key' => 'svc_broadband-manage_link_loc',
5012 'description' => 'Location for "Manage Device" link',
5015 'bottom' => 'Near Unprovision link',
5016 'right' => 'With export-related links',
5021 'key' => 'svc_broadband-manage_link-new_window',
5023 'description' => 'Open the "Manage Device" link in a new window',
5024 'type' => 'checkbox',
5027 #more fine-grained, service def-level control could be useful eventually?
5029 'key' => 'svc_broadband-allow_null_ip_addr',
5031 'description' => '',
5032 'type' => 'checkbox',
5036 'key' => 'svc_hardware-check_mac_addr',
5038 'description' => 'Require the "hardware address" field in hardware services to be a valid MAC address.',
5039 'type' => 'checkbox',
5043 'key' => 'tax-report_groups',
5045 'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
5046 'type' => 'textarea',
5050 'key' => 'tax-cust_exempt-groups',
5052 '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).',
5053 'type' => 'textarea',
5057 'key' => 'tax-cust_exempt-groups-require_individual_nums',
5059 'description' => 'When using tax-cust_exempt-groups, require an individual tax exemption number for each exemption from different taxes.',
5060 'type' => 'checkbox',
5064 'key' => 'cust_main-default_view',
5066 'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
5069 #false laziness w/view/cust_main.cgi and pref/pref.html
5070 'basics' => 'Basics',
5072 'tickets' => 'Tickets',
5073 'packages' => 'Packages',
5074 'payment_history' => 'Payment History',
5075 'change_history' => 'Change History',
5081 'key' => 'enable_tax_adjustments',
5082 'section' => 'billing',
5083 'description' => 'Enable the ability to add manual tax adjustments.',
5084 'type' => 'checkbox',
5088 'key' => 'rt-crontool',
5090 'description' => 'Enable the RT CronTool extension.',
5091 'type' => 'checkbox',
5095 'key' => 'pkg-balances',
5096 'section' => 'billing',
5097 'description' => 'Enable per-package balances.',
5098 'type' => 'checkbox',
5102 'key' => 'pkg-addon_classnum',
5103 'section' => 'billing',
5104 'description' => 'Enable the ability to restrict additional package orders based on package class.',
5105 'type' => 'checkbox',
5109 'key' => 'cust_main-edit_signupdate',
5111 'description' => 'Enable manual editing of the signup date.',
5112 'type' => 'checkbox',
5116 'key' => 'svc_acct-disable_access_number',
5118 'description' => 'Disable access number selection.',
5119 'type' => 'checkbox',
5123 'key' => 'cust_bill_pay_pkg-manual',
5125 'description' => 'Allow manual application of payments to line items.',
5126 'type' => 'checkbox',
5130 'key' => 'cust_credit_bill_pkg-manual',
5132 'description' => 'Allow manual application of credits to line items.',
5133 'type' => 'checkbox',
5137 'key' => 'breakage-days',
5138 'section' => 'billing',
5139 'description' => 'If set to a number of days, after an account goes that long without activity, recognizes any outstanding payments and credits as "breakage" by creating a breakage charge and invoice.',
5145 'key' => 'breakage-pkg_class',
5146 'section' => 'billing',
5147 'description' => 'Package class to use for breakage reconciliation.',
5148 'type' => 'select-pkg_class',
5152 'key' => 'disable_cron_billing',
5153 'section' => 'billing',
5154 'description' => 'Disable billing and collection from being run by freeside-daily and freeside-monthly, while still allowing other actions to run, such as notifications and backup.',
5155 'type' => 'checkbox',
5159 'key' => 'svc_domain-edit_domain',
5161 'description' => 'Enable domain renaming',
5162 'type' => 'checkbox',
5166 'key' => 'enable_legacy_prepaid_income',
5168 'description' => "Enable legacy prepaid income reporting. Only useful when you have imported pre-Freeside packages with longer-than-monthly duration, and need to do prepaid income reporting on them before they've been invoiced the first time.",
5169 'type' => 'checkbox',
5173 'key' => 'cust_main-exports',
5175 'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
5176 'type' => 'select-sub',
5178 'options_sub' => sub {
5180 require FS::part_export;
5182 map { qsearch( 'part_export', {exporttype => $_ } ) }
5183 keys %{FS::part_export::export_info('cust_main')};
5184 map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
5186 'option_sub' => sub {
5188 require FS::part_export;
5189 my $part_export = FS::Record::qsearchs(
5190 'part_export', { 'exportnum' => shift }
5193 ? $part_export->exporttype.' to '.$part_export->machine
5199 'key' => 'cust_tag-location',
5201 'description' => 'Location where customer tags are displayed.',
5203 'select_enum' => [ 'misc_info', 'top' ],
5207 'key' => 'cust_main-custom_link',
5209 'description' => 'URL to use as source for the "Custom" tab in the View Customer page. The customer number will be appended, or you can insert "$custnum" to have it inserted elsewhere. "$agentnum" will be replaced with the agent number, and "$usernum" will be replaced with the employee number.',
5210 'type' => 'textarea',
5214 'key' => 'cust_main-custom_content',
5216 'description' => 'As an alternative to cust_main-custom_link (leave it blank), the contant to display on this customer page, one item per line. Available iems are: small_custview, birthdate, spouse_birthdate, svc_acct, svc_phone and svc_external.',
5217 'type' => 'textarea',
5221 'key' => 'cust_main-custom_title',
5223 'description' => 'Title for the "Custom" tab in the View Customer page.',
5228 'key' => 'part_pkg-default_suspend_bill',
5229 'section' => 'billing',
5230 'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
5231 'type' => 'checkbox',
5235 'key' => 'qual-alt_address_format',
5237 'description' => 'Enable the alternate address format (location type, number, and kind) for qualifications.',
5238 'type' => 'checkbox',
5242 'key' => 'prospect_main-alt_address_format',
5244 'description' => 'Enable the alternate address format (location type, number, and kind) for prospects. Recommended if qual-alt_address_format is set and the main use of propects is for qualifications.',
5245 'type' => 'checkbox',
5249 'key' => 'prospect_main-location_required',
5251 'description' => 'Require an address for prospects. Recommended if the main use of propects is for qualifications.',
5252 'type' => 'checkbox',
5256 'key' => 'note-classes',
5258 'description' => 'Use customer note classes',
5263 2 => 'Enabled, with tabs',
5268 'key' => 'svc_acct-cf_privatekey-message',
5270 'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
5271 'type' => 'textarea',
5275 'key' => 'menu-prepend_links',
5277 'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
5278 'type' => 'textarea',
5282 'key' => 'cust_main-external_links',
5284 'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)". The URL will have custnum appended.',
5285 'type' => 'textarea',
5289 'key' => 'svc_phone-did-summary',
5290 'section' => 'invoicing',
5291 'description' => 'Experimental feature to enable DID activity summary on invoices, showing # DIDs activated/deactivated/ported-in/ported-out and total minutes usage, covering period since last invoice.',
5292 'type' => 'checkbox',
5296 'key' => 'svc_acct-usage_seconds',
5297 'section' => 'invoicing',
5298 'description' => 'Enable calculation of RADIUS usage time for invoices. You must modify your template to display this information.',
5299 'type' => 'checkbox',
5303 'key' => 'opensips_gwlist',
5304 'section' => 'telephony',
5305 'description' => 'For svc_phone OpenSIPS dr_rules export, gwlist column value, per-agent',
5312 'key' => 'opensips_description',
5313 'section' => 'telephony',
5314 'description' => 'For svc_phone OpenSIPS dr_rules export, description column value, per-agent',
5321 'key' => 'opensips_route',
5322 'section' => 'telephony',
5323 'description' => 'For svc_phone OpenSIPS dr_rules export, routeid column value, per-agent',
5330 'key' => 'cust_bill-no_recipients-error',
5331 'section' => 'invoicing',
5332 'description' => 'For customers with no invoice recipients, throw a job queue error rather than the default behavior of emailing the invoice to the invoice_from address.',
5333 'type' => 'checkbox',
5337 'key' => 'cust_bill-latex_lineitem_maxlength',
5338 'section' => 'invoicing',
5339 'description' => 'Truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin. Defaults to 50. ',
5344 'key' => 'invoice_payment_details',
5345 'section' => 'invoicing',
5346 'description' => 'When displaying payments on an invoice, show the payment method used, including the check or credit card number. Credit card numbers will be masked.',
5347 'type' => 'checkbox',
5351 'key' => 'cust_main-status_module',
5353 'description' => 'Which module to use for customer status display. The "Classic" module (the default) considers accounts with cancelled recurring packages but un-cancelled one-time charges Inactive. The "Recurring" module considers those customers Cancelled. Similarly for customers with suspended recurring packages but one-time charges.', #other differences?
5355 'select_enum' => [ 'Classic', 'Recurring' ],
5359 'key' => 'username-pound',
5360 'section' => 'username',
5361 'description' => 'Allow the pound character (#) in usernames.',
5362 'type' => 'checkbox',
5366 'key' => 'username-exclamation',
5367 'section' => 'username',
5368 'description' => 'Allow the exclamation character (!) in usernames.',
5369 'type' => 'checkbox',
5373 'key' => 'ie-compatibility_mode',
5375 'description' => "Compatibility mode META tag for Internet Explorer, used on the customer view page. Not necessary in normal operation unless custom content (notes, cust_main-custom_link) is included on customer view that is incompatibile with newer IE verisons.",
5377 'select_enum' => [ '', '7', 'EmulateIE7', '8', 'EmulateIE8' ],
5381 'key' => 'disable_payauto_default',
5383 'description' => 'Disable the "Charge future payments to this (card|check) automatically" checkbox from defaulting to checked.',
5384 'type' => 'checkbox',
5388 'key' => 'payment-history-report',
5390 'description' => 'Show a link to the raw database payment history report in the Reports menu. DO NOT ENABLE THIS for modern installations.',
5391 'type' => 'checkbox',
5395 'key' => 'svc_broadband-require-nw-coordinates',
5396 'section' => 'deprecated',
5397 'description' => 'Deprecated; see geocode-require_nw_coordinates instead',
5398 'type' => 'checkbox',
5402 'key' => 'cust-email-high-visibility',
5404 'description' => 'Move the invoicing e-mail address field to the top of the billing address section and highlight it.',
5405 'type' => 'checkbox',
5409 'key' => 'cust-edit-alt-field-order',
5411 'description' => 'An alternate ordering of fields for the New Customer and Edit Customer screens.',
5412 'type' => 'checkbox',
5416 'key' => 'cust_bill-enable_promised_date',
5418 'description' => 'Enable display/editing of the "promised payment date" field on invoices.',
5419 'type' => 'checkbox',
5423 'key' => 'available-locales',
5425 'description' => 'Limit available locales (employee preferences, per-customer locale selection, etc.) to a particular set.',
5426 'type' => 'select-sub',
5428 'options_sub' => sub {
5429 map { $_ => FS::Locales->description($_) }
5430 grep { $_ ne 'en_US' }
5431 FS::Locales->locales;
5433 'option_sub' => sub { FS::Locales->description(shift) },
5437 'key' => 'cust_main-require_locale',
5439 'description' => 'Require an explicit locale to be chosen for new customers.',
5440 'type' => 'checkbox',
5444 'key' => 'translate-auto-insert',
5446 'description' => 'Auto-insert untranslated strings for selected non-en_US locales with their default/en_US values. Do not turn this on unless translating the interface into a new language.',
5449 'select_enum' => [ grep { $_ ne 'en_US' } FS::Locales::locales ],
5453 'key' => 'svc_acct-tower_sector',
5455 'description' => 'Track tower and sector for svc_acct (account) services.',
5456 'type' => 'checkbox',
5460 'key' => 'cdr-prerate',
5461 'section' => 'telephony',
5462 'description' => 'Experimental feature to rate CDRs immediately, rather than waiting until invoice generation time. Can reduce invoice generation time when processing lots of CDRs. Currently works with "VoIP/telco CDR rating (standard)" price plans using "Phone numbers (svc_phone.phonenum)" CDR service matching, without any included minutes.',
5463 'type' => 'checkbox',
5467 'key' => 'cdr-prerate-cdrtypenums',
5468 'section' => 'telephony',
5469 'description' => 'When using cdr-prerate to rate CDRs immediately, limit processing to these CDR types.',
5470 'type' => 'select-sub',
5472 'options_sub' => sub { require FS::Record;
5473 require FS::cdr_type;
5474 map { $_->cdrtypenum => $_->cdrtypename }
5475 FS::Record::qsearch( 'cdr_type',
5476 {} #{ 'disabled' => '' }
5479 'option_sub' => sub { require FS::Record;
5480 require FS::cdr_type;
5481 my $cdr_type = FS::Record::qsearchs(
5482 'cdr_type', { 'cdrtypenum'=>shift } );
5483 $cdr_type ? $cdr_type->cdrtypename : '';
5488 'key' => 'cdr-minutes_priority',
5489 'section' => 'telephony',
5490 'description' => 'Priority rule for assigning included minutes to CDRs.',
5493 '' => 'No specific order',
5494 'time' => 'Chronological',
5495 'rate_high' => 'Highest rate first',
5496 'rate_low' => 'Lowest rate first',
5501 'key' => 'brand-agent',
5503 'description' => 'Brand the backoffice interface (currently Help->About) using the company_name, company_url and logo.png configuration settings of the selected agent. Typically used when selling or bundling hosted access to the backoffice interface. NOTE: The AGPL software license has specific requirements for source code availability in this situation.',
5504 'type' => 'select-agent',
5508 'key' => 'cust_class-tax_exempt',
5509 'section' => 'billing',
5510 'description' => 'Control the tax exemption flag per customer class rather than per indivual customer.',
5511 'type' => 'checkbox',
5515 'key' => 'selfservice-billing_history-line_items',
5516 'section' => 'self-service',
5517 'description' => 'Return line item billing detail for the self-service billing_history API call.',
5518 'type' => 'checkbox',
5522 'key' => 'selfservice-default_cdr_format',
5523 'section' => 'self-service',
5524 'description' => 'Format for showing outbound CDRs in self-service. The per-package option overrides this.',
5526 'select_hash' => \@cdr_formats,
5530 'key' => 'selfservice-default_inbound_cdr_format',
5531 'section' => 'self-service',
5532 'description' => 'Format for showing inbound CDRs in self-service. The per-package option overrides this. Leave blank to avoid showing these CDRs.',
5534 'select_hash' => \@cdr_formats,
5538 'key' => 'logout-timeout',
5540 'description' => 'If set, automatically log users out of the backoffice after this many minutes.',
5545 'key' => 'spreadsheet_format',
5547 'description' => 'Default format for spreadsheet download.',
5550 'XLS' => 'XLS (Excel 97/2000/XP)',
5551 'XLSX' => 'XLSX (Excel 2007+)',
5556 'key' => 'agent-email_day',
5558 'description' => 'On this day of each month, agents with master customer records containing email addresses will be emailed a list of their customers and balances.',
5563 'key' => 'report-cust_pay-select_time',
5565 'description' => 'Enable time selection on payment and refund reports.',
5566 'type' => 'checkbox',
5570 'key' => 'authentication_module',
5572 'description' => '"Internal" is the default , which authenticates against the internal database. "Legacy" is similar, but matches passwords against a legacy htpasswd file.',
5574 'select_enum' => [qw( Internal Legacy )],
5578 'key' => 'external_auth-access_group-template_user',
5580 'description' => 'When using an external authentication module, specifies the default access groups for autocreated users, via a template user.',
5585 'key' => 'allow_invalid_cards',
5587 'description' => 'Accept invalid credit card numbers. Useful for testing with fictitious customers. There is no good reason to enable this in production.',
5588 'type' => 'checkbox',
5591 { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5592 { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5593 { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5594 { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5595 { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5596 { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5597 { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5598 { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5599 { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5600 { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5601 { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5602 { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5603 { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5604 { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5605 { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5606 { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5607 { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5608 { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5609 { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5610 { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5611 { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5612 { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5613 { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5614 { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5615 { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5616 { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5617 { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5618 { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5619 { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5620 { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5621 { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5622 { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5623 { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5624 { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5625 { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5626 { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5627 { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5628 { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5629 { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5630 { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
5631 { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },