3 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
10 use FS::Conf_compat17;
13 use FS::Record qw(qsearch qsearchs);
14 use FS::UID qw(dbh datasrc use_confcompat);
16 $base_dir = '%%%FREESIDE_CONF%%%';
22 FS::Conf - Freeside configuration values
30 $value = $conf->config('key');
31 @list = $conf->config('key');
32 $bool = $conf->exists('key');
35 $conf->set('key' => 'value');
38 @config_items = $conf->config_items;
42 Read and write Freeside configuration values. Keys currently map to filenames,
43 but this may change in the future.
51 Create a new configuration object.
57 my($class) = ref($proto) || $proto;
58 my($self) = { 'base_dir' => $base_dir };
59 bless ($self, $class);
64 Returns the base directory. By default this is /usr/local/etc/freeside.
70 my $base_dir = $self->{base_dir};
71 -e $base_dir or die "FATAL: $base_dir doesn't exist!";
72 -d $base_dir or die "FATAL: $base_dir isn't a directory!";
73 -r $base_dir or die "FATAL: Can't read $base_dir!";
74 -x $base_dir or die "FATAL: $base_dir not searchable (executable)!";
75 $base_dir =~ /^(.*)$/;
79 =item conf KEY [ AGENTNUM [ NODEFAULT ] ]
81 Returns the L<FS::conf> record for the key and agent.
90 =item config KEY [ AGENTNUM [ NODEFAULT ] ]
92 Returns the configuration value or values (depending on context) for key.
93 The optional agent number selects an agent specific value instead of the
94 global default if one is present. If NODEFAULT is true only the agent
95 specific value(s) is returned.
100 my ($self, $method) = (shift, shift);
101 carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
103 my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
104 $compat->$method(@_);
108 my($self,$name,$agentnum,$agentonly)=@_;
109 my $hashref = { 'name' => $name };
110 $hashref->{agentnum} = $agentnum;
111 local $FS::Record::conf = undef; # XXX evil hack prevents recursion
112 my $cv = FS::Record::qsearchs('conf', $hashref);
113 if (!$agentonly && !$cv && defined($agentnum) && $agentnum) {
114 $hashref->{agentnum} = '';
115 $cv = FS::Record::qsearchs('conf', $hashref);
122 return $self->_usecompat('config', @_) if use_confcompat;
124 carp "FS::Conf->config(". join(', ', @_). ") called"
127 my $cv = $self->_config(@_) or return;
132 (split "\n", $v, -1);
134 (split("\n", $cv->value))[0];
138 =item config_binary KEY [ AGENTNUM [ NODEFAULT ] ]
140 Returns the exact scalar value for key.
146 return $self->_usecompat('config_binary', @_) if use_confcompat;
148 my $cv = $self->_config(@_) or return;
149 decode_base64($cv->value);
152 =item exists KEY [ AGENTNUM [ NODEFAULT ] ]
154 Returns true if the specified key exists, even if the corresponding value
161 return $self->_usecompat('exists', @_) if use_confcompat;
163 my($name, $agentnum)=@_;
165 carp "FS::Conf->exists(". join(', ', @_). ") called"
168 defined($self->_config(@_));
171 =item config_orbase KEY SUFFIX
173 Returns the configuration value or values (depending on context) for
174 KEY_SUFFIX, if it exists, otherwise for KEY
178 # outmoded as soon as we shift to agentnum based config values
179 # well, mostly. still useful for e.g. late notices, etc. in that we want
180 # these to fall back to standard values
183 return $self->_usecompat('config_orbase', @_) if use_confcompat;
185 my( $name, $suffix ) = @_;
186 if ( $self->exists("${name}_$suffix") ) {
187 $self->config("${name}_$suffix");
189 $self->config($name);
193 =item key_orbase KEY SUFFIX
195 If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
196 KEY. Useful for determining which exact configuration option is returned by
203 #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
205 my( $name, $suffix ) = @_;
206 if ( $self->exists("${name}_$suffix") ) {
213 =item invoice_templatenames
215 Returns all possible invoice template names.
219 sub invoice_templatenames {
222 my %templatenames = ();
223 foreach my $item ( $self->config_items ) {
224 foreach my $base ( @base_items ) {
225 my( $main, $ext) = split(/\./, $base);
226 $ext = ".$ext" if $ext;
227 if ( $item->key =~ /^${main}_(.+)$ext$/ ) {
228 $templatenames{$1}++;
233 sort keys %templatenames;
237 =item touch KEY [ AGENT ];
239 Creates the specified configuration key if it does not exist.
245 return $self->_usecompat('touch', @_) if use_confcompat;
247 my($name, $agentnum) = @_;
248 unless ( $self->exists($name, $agentnum) ) {
249 $self->set($name, '', $agentnum);
253 =item set KEY VALUE [ AGENTNUM ];
255 Sets the specified configuration key to the given value.
261 return $self->_usecompat('set', @_) if use_confcompat;
263 my($name, $value, $agentnum) = @_;
267 warn "[FS::Conf] SET $name\n" if $DEBUG;
269 my $old = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum});
270 my $new = new FS::conf { $old ? $old->hash
271 : ('name' => $name, 'agentnum' => $agentnum)
277 $error = $new->replace($old);
279 $error = $new->insert;
282 die "error setting configuration value: $error \n"
287 =item set_binary KEY VALUE [ AGENTNUM ]
289 Sets the specified configuration key to an exact scalar value which
290 can be retrieved with config_binary.
296 return if use_confcompat;
298 my($name, $value, $agentnum)=@_;
299 $self->set($name, encode_base64($value), $agentnum);
302 =item delete KEY [ AGENTNUM ];
304 Deletes the specified configuration key.
310 return $self->_usecompat('delete', @_) if use_confcompat;
312 my($name, $agentnum) = @_;
313 if ( my $cv = FS::Record::qsearchs('conf', {name => $name, agentnum => $agentnum}) ) {
314 warn "[FS::Conf] DELETE $name\n";
316 my $oldAutoCommit = $FS::UID::AutoCommit;
317 local $FS::UID::AutoCommit = 0;
320 my $error = $cv->delete;
323 $dbh->rollback if $oldAutoCommit;
324 die "error setting configuration value: $error \n"
327 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
332 =item import_config_item CONFITEM DIR
334 Imports the item specified by the CONFITEM (see L<FS::ConfItem>) into
335 the database as a conf record (see L<FS::conf>). Imports from the file
336 in the directory DIR.
340 sub import_config_item {
341 my ($self,$item,$dir) = @_;
342 my $key = $item->key;
343 if ( -e "$dir/$key" && ! use_confcompat ) {
344 warn "Inserting $key\n" if $DEBUG;
346 my $value = readline(new IO::File "$dir/$key");
347 if ($item->type =~ /^(binary|image)$/ ) {
348 $self->set_binary($key, $value);
350 $self->set($key, $value);
353 warn "Not inserting $key\n" if $DEBUG;
357 =item verify_config_item CONFITEM DIR
359 Compares the item specified by the CONFITEM (see L<FS::ConfItem>) in
360 the database to the legacy file value in DIR.
364 sub verify_config_item {
365 return '' if use_confcompat;
366 my ($self,$item,$dir) = @_;
367 my $key = $item->key;
368 my $type = $item->type;
370 my $compat = new FS::Conf_compat17 $dir;
373 $error .= "$key fails existential comparison; "
374 if $self->exists($key) xor $compat->exists($key);
376 if ( $type !~ /^(binary|image)$/ ) {
380 $error .= "$key fails scalar comparison; "
381 unless scalar($self->config($key)) eq scalar($compat->config($key));
384 my (@new) = $self->config($key);
385 my (@old) = $compat->config($key);
386 unless ( scalar(@new) == scalar(@old)) {
387 $error .= "$key fails list comparison; ";
390 foreach (@old) { $r=0 if ($_ cmp shift(@new)); }
391 $error .= "$key fails list comparison; "
397 $error .= "$key fails binary comparison; "
398 unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
402 #remove deprecated config on our own terms, not freeside-upgrade's
403 # if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
405 # for ( @config_items ) { $proto = $_; last if $proto->key eq $key; }
406 # unless ($proto->key eq $key) {
407 # warn "removed config item $error\n" if $DEBUG;
415 #item _orbase_items OPTIONS
417 #Returns all of the possible extensible config items as FS::ConfItem objects.
418 #See #L<FS::ConfItem>. OPTIONS consists of name value pairs. Possible
421 # dir - the directory to search for configuration option files instead
422 # of using the conf records in the database
428 my ($self, %opt) = @_;
430 my $listmaker = sub { my $v = shift;
432 if ( $v =~ /\.(png|eps)$/ ) {
438 FS::Record::qsearch( 'conf',
441 "WHERE name LIKE '$v' ESCAPE '!'"
445 if (exists($opt{dir}) && $opt{dir}) {
446 $listmaker = sub { my $v = shift;
447 if ( $v =~ /\.(png|eps)$/ ) {
452 map { basename $_ } glob($opt{dir}. "/$v" );
459 for ( @config_items ) { $proto = $_; last if $proto->key eq $base; }
460 die "don't know about $base items" unless $proto->key eq $base;
462 map { new FS::ConfItem {
464 'base_key' => $proto->key,
465 'section' => $proto->section,
466 'description' => 'Alternate ' . $proto->description . ' See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
467 'type' => $proto->type,
469 } &$listmaker($base);
476 Returns all of the possible global/default configuration items as
477 FS::ConfItem objects. See L<FS::ConfItem>.
483 return $self->_usecompat('config_items', @_) if use_confcompat;
485 ( @config_items, $self->_orbase_items(@_) );
494 =item init-config DIR
496 Imports the configuration items from DIR (1.7 compatible)
497 to conf records in the database.
505 local $FS::UID::use_confcompat = 0;
506 my $conf = new FS::Conf;
507 foreach my $item ( $conf->config_items(dir => $dir) ) {
508 $conf->import_config_item($item, $dir);
509 my $error = $conf->verify_config_item($item, $dir);
510 return $error if $error;
513 my $compat = new FS::Conf_compat17 $dir;
514 foreach my $item ( $compat->config_items ) {
515 my $error = $conf->verify_config_item($item, $dir);
516 return $error if $error;
520 $FS::UID::use_confcompat = 0;
528 If this was more than just crud that will never be useful outside Freeside I'd
529 worry that config_items is freeside-specific and icky.
533 "Configuration" in the web interface (config/config.cgi).
537 #Business::CreditCard
542 "American Express card",
543 "Diner's Club/Carte Blanche",
554 invoice_latexreturnaddress
556 invoice_latexsmallfooter
560 invoice_htmlreturnaddress
567 @config_items = map { new FS::ConfItem $_ } (
571 'section' => 'deprecated',
572 'description' => 'This configuration option is no longer used. See <a href="#invoice_template">invoice_template</a> instead.',
577 'key' => 'alert_expiration',
578 'section' => 'billing',
579 'description' => 'Enable alerts about billing method expiration.',
580 'type' => 'checkbox',
585 'key' => 'alerter_template',
586 'section' => 'billing',
587 'description' => 'Template file for billing method expiration alerts. See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
588 'type' => 'textarea',
594 #not actually deprecated yet
595 #'section' => 'deprecated',
596 #'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',
598 'description' => 'IP address to assign to new virtual hosts',
603 'key' => 'encryption',
604 'section' => 'billing',
605 'description' => 'Enable encryption of credit cards.',
606 'type' => 'checkbox',
610 'key' => 'encryptionmodule',
611 'section' => 'billing',
612 'description' => 'Use which module for encryption?',
617 'key' => 'encryptionpublickey',
618 'section' => 'billing',
619 'description' => 'Your RSA Public Key - Required if Encryption is turned on.',
620 'type' => 'textarea',
624 'key' => 'encryptionprivatekey',
625 'section' => 'billing',
626 'description' => 'Your RSA Private Key - Including this will enable the "Bill Now" feature. However if the system is compromised, a hacker can use this key to decode the stored credit card information. This is generally not a good idea.',
627 'type' => 'textarea',
631 'key' => 'billco-url',
632 'section' => 'billing',
633 'description' => 'The url to use for performing uploads to the invoice mailing service.',
639 'key' => 'billco-username',
640 'section' => 'billing',
641 'description' => 'The login name to use for uploads to the invoice mailing service.',
648 'key' => 'billco-password',
649 'section' => 'billing',
650 'description' => 'The password to use for uploads to the invoice mailing service.',
657 'key' => 'billco-clicode',
658 'section' => 'billing',
659 'description' => 'The clicode to use for uploads to the invoice mailing service.',
665 'key' => 'business-onlinepayment',
666 'section' => 'billing',
667 '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.',
668 'type' => 'textarea',
672 'key' => 'business-onlinepayment-ach',
673 'section' => 'billing',
674 '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.',
675 'type' => 'textarea',
679 'key' => 'business-onlinepayment-namespace',
680 'section' => 'billing',
681 'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
684 'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
685 'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
690 'key' => 'business-onlinepayment-description',
691 'section' => 'billing',
692 '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)',
697 'key' => 'business-onlinepayment-email-override',
698 'section' => 'billing',
699 'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
704 'key' => 'business-onlinepayment-email_customer',
705 'section' => 'billing',
706 'description' => 'Controls the "email_customer" flag used by some Business::OnlinePayment processors to enable customer receipts.',
707 'type' => 'checkbox',
711 'key' => 'countrydefault',
713 'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
718 'key' => 'date_format',
720 'description' => 'Format for displaying dates',
723 '%m/%d/%Y' => 'MM/DD/YYYY',
724 '%Y/%m/%d' => 'YYYY/MM/DD',
729 'key' => 'deletecustomers',
731 'description' => 'Enable customer deletions. Be very careful! Deleting a customer will remove all traces that the customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customers\' packages if they cancel service.',
732 'type' => 'checkbox',
736 'key' => 'deleteinvoices',
738 'description' => 'Enable invoices deletions. Be very careful! Deleting an invoice will remove all traces that the invoice ever existed! Normally, you would apply a credit against the invoice instead.', #invoice voiding?
739 'type' => 'checkbox',
743 'key' => 'deletepayments',
744 'section' => 'billing',
745 'description' => 'Enable deletion of unclosed payments. Really, with voids this is pretty much not recommended in any situation anymore. Be very careful! Only delete payments that were data-entry errors, not adjustments. Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.',
746 'type' => [qw( checkbox text )],
750 'key' => 'deletecredits',
751 #not actually deprecated yet
752 #'section' => 'deprecated',
753 #'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.',
755 'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
756 'type' => [qw( checkbox text )],
760 'key' => 'deleterefunds',
761 'section' => 'billing',
762 'description' => 'Enable deletion of unclosed refunds. Be very careful! Only delete refunds that were data-entry errors, not adjustments.',
763 'type' => 'checkbox',
767 'key' => 'unapplypayments',
768 'section' => 'deprecated',
769 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable "unapplication" of unclosed payments.',
770 'type' => 'checkbox',
774 'key' => 'unapplycredits',
775 'section' => 'deprecated',
776 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to nable "unapplication" of unclosed credits.',
777 'type' => 'checkbox',
782 'section' => 'shell',
783 '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>',
788 'key' => 'disable_cust_attachment',
790 'description' => 'Disable customer file attachments',
791 'type' => 'checkbox',
795 'key' => 'max_attachment_size',
797 'description' => 'Maximum size for customer file attachments (leave blank for unlimited)',
802 'key' => 'disable_customer_referrals',
804 'description' => 'Disable new customer-to-customer referrals in the web interface',
805 'type' => 'checkbox',
809 'key' => 'editreferrals',
811 'description' => 'Enable advertising source modification for existing customers',
812 'type' => 'checkbox',
816 'key' => 'emailinvoiceonly',
817 'section' => 'billing',
818 'description' => 'Disables postal mail invoices',
819 'type' => 'checkbox',
823 'key' => 'disablepostalinvoicedefault',
824 'section' => 'billing',
825 '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>.',
826 'type' => 'checkbox',
830 'key' => 'emailinvoiceauto',
831 'section' => 'billing',
832 'description' => 'Automatically adds new accounts to the email invoice list',
833 'type' => 'checkbox',
837 'key' => 'emailinvoiceautoalways',
838 'section' => 'billing',
839 'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses',
840 'type' => 'checkbox',
844 'key' => 'exclude_ip_addr',
846 'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
847 'type' => 'textarea',
851 'key' => 'auto_router',
853 'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
854 'type' => 'checkbox',
858 'key' => 'hidecancelledpackages',
860 'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
861 'type' => 'checkbox',
865 'key' => 'hidecancelledcustomers',
867 'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
868 'type' => 'checkbox',
873 'section' => 'shell',
874 'description' => 'For new users, prefixed to username to create a directory name. Should have a leading but not a trailing slash.',
879 'key' => 'invoice_from',
880 'section' => 'required',
881 'description' => 'Return address on email invoices',
887 'key' => 'invoice_subject',
888 'section' => 'billing',
889 'description' => 'Subject: header on email invoices. Defaults to "Invoice". The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
895 'key' => 'invoice_usesummary',
896 'section' => 'billing',
897 'description' => 'Indicates that html and latex invoices should be in summary style and make use of invoice_latexsummary.',
898 'type' => 'checkbox',
902 'key' => 'invoice_template',
903 'section' => 'billing',
904 'description' => 'Text template file for invoices. Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients. See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
905 'type' => 'textarea',
909 'key' => 'invoice_html',
910 'section' => 'billing',
911 'description' => 'Optional HTML template for invoices. See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
913 'type' => 'textarea',
917 'key' => 'invoice_htmlnotes',
918 'section' => 'billing',
919 'description' => 'Notes section for HTML invoices. Defaults to the same data in invoice_latexnotes if not specified.',
920 'type' => 'textarea',
925 'key' => 'invoice_htmlfooter',
926 'section' => 'billing',
927 'description' => 'Footer for HTML invoices. Defaults to the same data in invoice_latexfooter if not specified.',
928 'type' => 'textarea',
933 'key' => 'invoice_htmlsummary',
934 'section' => 'billing',
935 'description' => 'Summary initial page for HTML invoices.',
936 'type' => 'textarea',
941 'key' => 'invoice_htmlreturnaddress',
942 'section' => 'billing',
943 'description' => 'Return address for HTML invoices. Defaults to the same data in invoice_latexreturnaddress if not specified.',
944 'type' => 'textarea',
948 'key' => 'invoice_latex',
949 'section' => 'billing',
950 'description' => 'Optional LaTeX template for typeset PostScript invoices. See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
951 'type' => 'textarea',
955 'key' => 'invoice_latexnotes',
956 'section' => 'billing',
957 'description' => 'Notes section for LaTeX typeset PostScript invoices.',
958 'type' => 'textarea',
963 'key' => 'invoice_latexfooter',
964 'section' => 'billing',
965 'description' => 'Footer for LaTeX typeset PostScript invoices.',
966 'type' => 'textarea',
971 'key' => 'invoice_latexsummary',
972 'section' => 'billing',
973 'description' => 'Summary initial page for LaTeX typeset PostScript invoices.',
974 'type' => 'textarea',
979 'key' => 'invoice_latexcoupon',
980 'section' => 'billing',
981 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
982 'type' => 'textarea',
987 'key' => 'invoice_latexreturnaddress',
988 'section' => 'billing',
989 'description' => 'Return address for LaTeX typeset PostScript invoices.',
990 'type' => 'textarea',
994 'key' => 'invoice_latexsmallfooter',
995 'section' => 'billing',
996 'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
997 'type' => 'textarea',
1002 'key' => 'invoice_email_pdf',
1003 'section' => 'billing',
1004 '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.',
1005 'type' => 'checkbox'
1009 'key' => 'invoice_email_pdf_note',
1010 'section' => 'billing',
1011 'description' => 'If defined, this text will replace the default plain text invoice as the body of emailed PDF invoices.',
1012 'type' => 'textarea'
1017 'key' => 'invoice_default_terms',
1018 'section' => 'billing',
1019 'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
1021 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
1025 'key' => 'invoice_sections',
1026 'section' => 'billing',
1027 'description' => 'Split invoice into sections and label according to package category when enabled.',
1028 'type' => 'checkbox',
1032 'key' => 'finance_pkgclass',
1033 'section' => 'billing',
1034 'description' => 'The package class for finance charges',
1035 'type' => 'select-sub',
1036 'options_sub' => sub { require FS::Record;
1037 require FS::pkg_class;
1038 map { $_->classnum => $_->classname }
1039 FS::Record::qsearch('pkg_class', {} );
1041 'option_sub' => sub { require FS::Record;
1042 require FS::pkg_class;
1043 my $pkg_class = FS::Record::qsearchs(
1044 'pkg_class', { 'classnum'=>shift }
1046 $pkg_class ? $pkg_class->classname : '';
1051 'key' => 'separate_usage',
1052 'section' => 'billing',
1053 'description' => 'Split the rated call usage into a separate line from the recurring charges.',
1054 'type' => 'checkbox',
1058 'key' => 'invoice_send_receipts',
1059 'section' => 'deprecated',
1060 'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits. See the payment_receipt_email and XXXX instead.',
1061 'type' => 'checkbox',
1065 'key' => 'payment_receipt_email',
1066 'section' => 'billing',
1067 'description' => 'Template file for payment receipts. Payment receipts are sent to the customer email invoice destination(s) when a payment is received. See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language. The following variables are available: <ul><li><code>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance<li><code>$pkg</code> - Package (requires payment_receipt-trigger set to "when payment is applied".)</ul>',
1068 'type' => [qw( checkbox textarea )],
1072 'key' => 'payment_receipt-trigger',
1073 'section' => 'billing',
1074 'description' => 'When payment receipts are triggered. Defaults to when payment is made.',
1077 'cust_pay' => 'When payment is made.',
1078 'cust_bill_pay_pkg' => 'When payment is applied.',
1084 'section' => 'required',
1085 'description' => 'Print command for paper invoices, for example `lpr -h\'',
1090 'key' => 'lpr-postscript_prefix',
1091 'section' => 'billing',
1092 'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1097 'key' => 'lpr-postscript_suffix',
1098 'section' => 'billing',
1099 'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)',
1104 'key' => 'money_char',
1106 'description' => 'Currency symbol - defaults to `$\'',
1111 'key' => 'defaultrecords',
1112 'section' => 'BIND',
1113 'description' => 'DNS entries to add automatically when creating a domain',
1114 'type' => 'editlist',
1115 'editlist_parts' => [ { type=>'text' },
1116 { type=>'immutable', value=>'IN' },
1118 select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
1119 { type=> 'text' }, ],
1123 'key' => 'passwordmin',
1124 'section' => 'password',
1125 'description' => 'Minimum password length (default 6)',
1130 'key' => 'passwordmax',
1131 'section' => 'password',
1132 'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
1137 'key' => 'password-noampersand',
1138 'section' => 'password',
1139 'description' => 'Disallow ampersands in passwords',
1140 'type' => 'checkbox',
1144 'key' => 'password-noexclamation',
1145 'section' => 'password',
1146 'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
1147 'type' => 'checkbox',
1151 'key' => 'referraldefault',
1153 'description' => 'Default referral, specified by refnum',
1158 # 'key' => 'registries',
1159 # 'section' => 'required',
1160 # 'description' => 'Directory which contains domain registry information. Each registry is a directory.',
1164 'key' => 'report_template',
1165 'section' => 'deprecated',
1166 'description' => 'Deprecated template file for reports.',
1167 'type' => 'textarea',
1171 'key' => 'maxsearchrecordsperpage',
1173 'description' => 'If set, number of search records to return per page.',
1178 'key' => 'session-start',
1179 'section' => 'session',
1180 '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.',
1185 'key' => 'session-stop',
1186 'section' => 'session',
1187 '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.',
1193 'section' => 'shell',
1194 '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.',
1195 'type' => 'textarea',
1199 'key' => 'showpasswords',
1201 'description' => 'Display unencrypted user passwords in the backend (employee) web interface',
1202 'type' => 'checkbox',
1206 'key' => 'signupurl',
1208 'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
1213 'key' => 'smtpmachine',
1214 'section' => 'required',
1215 'description' => 'SMTP relay for Freeside\'s outgoing mail',
1220 'key' => 'soadefaultttl',
1221 'section' => 'BIND',
1222 'description' => 'SOA default TTL for new domains.',
1227 'key' => 'soaemail',
1228 'section' => 'BIND',
1229 'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
1234 'key' => 'soaexpire',
1235 'section' => 'BIND',
1236 'description' => 'SOA expire for new domains',
1241 'key' => 'soamachine',
1242 'section' => 'BIND',
1243 'description' => 'SOA machine for new domains, with trailing `.\'',
1248 'key' => 'soarefresh',
1249 'section' => 'BIND',
1250 'description' => 'SOA refresh for new domains',
1255 'key' => 'soaretry',
1256 'section' => 'BIND',
1257 'description' => 'SOA retry for new domains',
1262 'key' => 'statedefault',
1264 'description' => 'Default state or province (if not supplied, the default is `CA\')',
1269 'key' => 'unsuspendauto',
1270 'section' => 'billing',
1271 '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',
1272 'type' => 'checkbox',
1276 'key' => 'unsuspend-always_adjust_next_bill_date',
1277 'section' => 'billing',
1278 '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.',
1279 'type' => 'checkbox',
1283 'key' => 'usernamemin',
1284 'section' => 'username',
1285 'description' => 'Minimum username length (default 2)',
1290 'key' => 'usernamemax',
1291 'section' => 'username',
1292 'description' => 'Maximum username length',
1297 'key' => 'username-ampersand',
1298 'section' => 'username',
1299 '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.',
1300 'type' => 'checkbox',
1304 'key' => 'username-letter',
1305 'section' => 'username',
1306 'description' => 'Usernames must contain at least one letter',
1307 'type' => 'checkbox',
1312 'key' => 'username-letterfirst',
1313 'section' => 'username',
1314 'description' => 'Usernames must start with a letter',
1315 'type' => 'checkbox',
1319 'key' => 'username-noperiod',
1320 'section' => 'username',
1321 'description' => 'Disallow periods in usernames',
1322 'type' => 'checkbox',
1326 'key' => 'username-nounderscore',
1327 'section' => 'username',
1328 'description' => 'Disallow underscores in usernames',
1329 'type' => 'checkbox',
1333 'key' => 'username-nodash',
1334 'section' => 'username',
1335 'description' => 'Disallow dashes in usernames',
1336 'type' => 'checkbox',
1340 'key' => 'username-uppercase',
1341 'section' => 'username',
1342 'description' => 'Allow uppercase characters in usernames. Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
1343 'type' => 'checkbox',
1347 'key' => 'username-percent',
1348 'section' => 'username',
1349 'description' => 'Allow the percent character (%) in usernames.',
1350 'type' => 'checkbox',
1354 'key' => 'username-colon',
1355 'section' => 'username',
1356 'description' => 'Allow the colon character (:) in usernames.',
1357 'type' => 'checkbox',
1361 'key' => 'safe-part_bill_event',
1363 'description' => 'Validates invoice event expressions against a preset list. Useful for webdemos, annoying to powerusers.',
1364 'type' => 'checkbox',
1370 'description' => 'Turns on display/collection of social security numbers in the web interface. Sometimes required by electronic check (ACH) processors.',
1371 'type' => 'checkbox',
1375 'key' => 'show_stateid',
1377 'description' => "Turns on display/collection of driver's license/state issued id numbers in the web interface. Sometimes required by electronic check (ACH) processors.",
1378 'type' => 'checkbox',
1382 'key' => 'show_bankstate',
1384 'description' => "Turns on display/collection of state for bank accounts in the web interface. Sometimes required by electronic check (ACH) processors.",
1385 'type' => 'checkbox',
1389 'key' => 'agent_defaultpkg',
1391 'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
1392 'type' => 'checkbox',
1396 'key' => 'legacy_link',
1398 'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
1399 'type' => 'checkbox',
1403 'key' => 'legacy_link-steal',
1405 'description' => 'Allow "stealing" an already-audited service from one customer (or package) to another using the link function.',
1406 'type' => 'checkbox',
1410 'key' => 'queue_dangerous_controls',
1412 '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.',
1413 'type' => 'checkbox',
1417 'key' => 'security_phrase',
1418 'section' => 'password',
1419 'description' => 'Enable the tracking of a "security phrase" with each account. Not recommended, as it is vulnerable to social engineering.',
1420 'type' => 'checkbox',
1426 'description' => 'Message locale',
1428 'select_enum' => [ qw(en_US) ],
1432 'key' => 'signup_server-payby',
1434 'description' => 'Acceptable payment types for the signup server',
1435 'type' => 'selectmultiple',
1436 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
1440 'key' => 'signup_server-default_agentnum',
1442 'description' => 'Default agent for the signup server',
1443 'type' => 'select-sub',
1444 'options_sub' => sub { require FS::Record;
1446 map { $_->agentnum => $_->agent }
1447 FS::Record::qsearch('agent', { disabled=>'' } );
1449 'option_sub' => sub { require FS::Record;
1451 my $agent = FS::Record::qsearchs(
1452 'agent', { 'agentnum'=>shift }
1454 $agent ? $agent->agent : '';
1459 'key' => 'signup_server-default_refnum',
1461 'description' => 'Default advertising source for the signup server',
1462 'type' => 'select-sub',
1463 'options_sub' => sub { require FS::Record;
1464 require FS::part_referral;
1465 map { $_->refnum => $_->referral }
1466 FS::Record::qsearch( 'part_referral',
1467 { 'disabled' => '' }
1470 'option_sub' => sub { require FS::Record;
1471 require FS::part_referral;
1472 my $part_referral = FS::Record::qsearchs(
1473 'part_referral', { 'refnum'=>shift } );
1474 $part_referral ? $part_referral->referral : '';
1479 'key' => 'signup_server-default_pkgpart',
1481 'description' => 'Default package for the signup server',
1482 'type' => 'select-part_pkg',
1486 'key' => 'signup_server-default_svcpart',
1488 'description' => 'Default service definition for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
1489 'type' => 'select-part_svc',
1493 'key' => 'signup_server-mac_addr_svcparts',
1495 'description' => 'Service definitions which can receive mac addresses (current mapped to username for svc_acct).',
1496 'type' => 'select-part_svc',
1501 'key' => 'signup_server-nomadix',
1503 'description' => 'Signup page Nomadix integration',
1504 'type' => 'checkbox',
1508 'key' => 'signup_server-service',
1510 'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
1513 'svc_acct' => 'Account (svc_acct)',
1514 'svc_phone' => 'Phone number (svc_phone)',
1519 'key' => 'selfservice_server-base_url',
1521 '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.',
1526 'key' => 'show-msgcat-codes',
1528 'description' => 'Show msgcat codes in error messages. Turn this option on before reporting errors to the mailing list.',
1529 'type' => 'checkbox',
1533 'key' => 'signup_server-realtime',
1535 'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
1536 'type' => 'checkbox',
1539 'key' => 'signup_server-classnum2',
1541 'description' => 'Package Class for first optional purchase',
1542 'type' => 'select-sub',
1543 'options_sub' => sub { require FS::Record;
1544 require FS::pkg_class;
1545 map { $_->classnum => $_->classname }
1546 FS::Record::qsearch('pkg_class', {} );
1548 'option_sub' => sub { require FS::Record;
1549 require FS::pkg_class;
1550 my $pkg_class = FS::Record::qsearchs(
1551 'pkg_class', { 'classnum'=>shift }
1553 $pkg_class ? $pkg_class->classname : '';
1558 'key' => 'signup_server-classnum3',
1560 'description' => 'Package Class for second optional purchase',
1561 'type' => 'select-sub',
1562 'options_sub' => sub { require FS::Record;
1563 require FS::pkg_class;
1564 map { $_->classnum => $_->classname }
1565 FS::Record::qsearch('pkg_class', {} );
1567 'option_sub' => sub { require FS::Record;
1568 require FS::pkg_class;
1569 my $pkg_class = FS::Record::qsearchs(
1570 'pkg_class', { 'classnum'=>shift }
1572 $pkg_class ? $pkg_class->classname : '';
1577 'key' => 'backend-realtime',
1579 'description' => 'Run billing for backend signups immediately.',
1580 'type' => 'checkbox',
1584 'key' => 'declinetemplate',
1585 'section' => 'billing',
1586 'description' => 'Template file for credit card decline emails.',
1587 'type' => 'textarea',
1591 'key' => 'emaildecline',
1592 'section' => 'billing',
1593 'description' => 'Enable emailing of credit card decline notices.',
1594 'type' => 'checkbox',
1598 'key' => 'emaildecline-exclude',
1599 'section' => 'billing',
1600 'description' => 'List of error messages that should not trigger email decline notices, one per line.',
1601 'type' => 'textarea',
1605 'key' => 'cancelmessage',
1606 'section' => 'billing',
1607 'description' => 'Template file for cancellation emails.',
1608 'type' => 'textarea',
1612 'key' => 'cancelsubject',
1613 'section' => 'billing',
1614 'description' => 'Subject line for cancellation emails.',
1619 'key' => 'emailcancel',
1620 'section' => 'billing',
1621 'description' => 'Enable emailing of cancellation notices. Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
1622 'type' => 'checkbox',
1626 'key' => 'bill_usage_on_cancel',
1627 'section' => 'billing',
1628 '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.',
1629 'type' => 'checkbox',
1633 'key' => 'require_cardname',
1634 'section' => 'billing',
1635 'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
1636 'type' => 'checkbox',
1640 'key' => 'enable_taxclasses',
1641 'section' => 'billing',
1642 'description' => 'Enable per-package tax classes',
1643 'type' => 'checkbox',
1647 'key' => 'require_taxclasses',
1648 'section' => 'billing',
1649 'description' => 'Require a taxclass to be entered for every package',
1650 'type' => 'checkbox',
1654 'key' => 'enable_taxproducts',
1655 'section' => 'billing',
1656 'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
1657 'type' => 'checkbox',
1661 'key' => 'taxdatadirectdownload',
1662 'section' => 'billing', #well
1663 'description' => 'Enable downloading tax data directly from the vendor site',
1664 'type' => 'checkbox',
1668 'key' => 'ignore_incalculable_taxes',
1669 'section' => 'billing',
1670 'description' => 'Prefer to invoice without tax over not billing at all',
1671 'type' => 'checkbox',
1675 'key' => 'welcome_email',
1677 'description' => 'Template file for welcome email. Welcome emails are sent to the customer email invoice destination(s) each time a svc_acct record is created. See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language. The following variables are available<ul><li><code>$username</code> <li><code>$password</code> <li><code>$first</code> <li><code>$last</code> <li><code>$pkg</code></ul>',
1678 'type' => 'textarea',
1683 'key' => 'welcome_email-from',
1685 'description' => 'From: address header for welcome email',
1691 'key' => 'welcome_email-subject',
1693 'description' => 'Subject: header for welcome email',
1699 'key' => 'welcome_email-mimetype',
1701 'description' => 'MIME type for welcome email',
1703 'select_enum' => [ 'text/plain', 'text/html' ],
1708 'key' => 'welcome_letter',
1710 '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>',
1711 'type' => 'textarea',
1715 'key' => 'warning_email',
1717 '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>',
1718 'type' => 'textarea',
1722 'key' => 'warning_email-from',
1724 'description' => 'From: address header for warning email',
1729 'key' => 'warning_email-cc',
1731 'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
1736 'key' => 'warning_email-subject',
1738 'description' => 'Subject: header for warning email',
1743 'key' => 'warning_email-mimetype',
1745 'description' => 'MIME type for warning email',
1747 'select_enum' => [ 'text/plain', 'text/html' ],
1752 'section' => 'billing',
1753 'description' => 'Available payment types.',
1754 'type' => 'selectmultiple',
1755 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
1759 'key' => 'payby-default',
1761 'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
1763 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
1767 'key' => 'paymentforcedtobatch',
1768 'section' => 'deprecated',
1769 '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.',
1770 'type' => 'checkbox',
1774 'key' => 'svc_acct-notes',
1776 'description' => 'Extra HTML to be displayed on the Account View screen.',
1777 'type' => 'textarea',
1781 'key' => 'radius-password',
1783 'description' => 'RADIUS attribute for plain-text passwords.',
1785 'select_enum' => [ 'Password', 'User-Password' ],
1789 'key' => 'radius-ip',
1791 'description' => 'RADIUS attribute for IP addresses.',
1793 'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
1796 #http://dev.coova.org/svn/coova-chilli/doc/dictionary.chillispot
1798 'key' => 'radius-chillispot-max',
1800 'description' => 'Enable ChilliSpot (and CoovaChilli) Max attributes, specifically ChilliSpot-Max-{Input,Output,Total}-{Octets,Gigawords}.',
1801 'type' => 'checkbox',
1805 'key' => 'svc_acct-alldomains',
1807 '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.',
1808 'type' => 'checkbox',
1812 'key' => 'dump-scpdest',
1814 'description' => 'destination for scp database dumps: user@host:/path',
1819 'key' => 'dump-pgpid',
1821 '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.",
1826 'key' => 'users-allow_comp',
1827 'section' => 'deprecated',
1828 '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.',
1829 'type' => 'textarea',
1833 'key' => 'credit_card-recurring_billing_flag',
1834 'section' => 'billing',
1835 '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. ',
1838 'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
1839 'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
1844 'key' => 'credit_card-recurring_billing_acct_code',
1845 'section' => 'billing',
1846 'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill". Useful for reporting purposes with supported gateways (PlugNPay, others?)',
1847 'type' => 'checkbox',
1851 'key' => 'cvv-save',
1852 'section' => 'billing',
1853 '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.',
1854 'type' => 'selectmultiple',
1855 'select_enum' => \@card_types,
1859 'key' => 'manual_process-pkgpart',
1860 'section' => 'billing',
1861 'description' => 'Package to add to each manual credit card and ACH payments entered from the backend. Enabling this option may be in violation of your merchant agreement(s), so please check them carefully before enabling this option.',
1862 'type' => 'select-part_pkg',
1866 'key' => 'manual_process-display',
1867 'section' => 'billing',
1868 'description' => 'When using manual_process-pkgpart, add the fee to the amount entered (default), or subtract the fee from the amount entered.',
1871 'add' => 'Add fee to amount entered',
1872 'subtract' => 'Subtract fee from amount entered',
1877 'key' => 'manual_process-skip_first',
1878 'section' => 'billing',
1879 'description' => "When using manual_process-pkgpart, omit the fee if it is the customer's first payment.",
1880 'type' => 'checkbox',
1884 'key' => 'allow_negative_charges',
1885 'section' => 'billing',
1886 'description' => 'Allow negative charges. Normally not used unless importing data from a legacy system that requires this.',
1887 'type' => 'checkbox',
1890 'key' => 'auto_unset_catchall',
1892 '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.',
1893 'type' => 'checkbox',
1897 'key' => 'system_usernames',
1898 'section' => 'username',
1899 '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.',
1900 'type' => 'textarea',
1904 'key' => 'cust_pkg-change_svcpart',
1906 'description' => "When changing packages, move services even if svcparts don't match between old and new pacakge definitions.",
1907 'type' => 'checkbox',
1911 'key' => 'disable_autoreverse',
1912 'section' => 'BIND',
1913 'description' => 'Disable automatic synchronization of reverse-ARPA entries.',
1914 'type' => 'checkbox',
1918 'key' => 'svc_www-enable_subdomains',
1920 'description' => 'Enable selection of specific subdomains for virtual host creation.',
1921 'type' => 'checkbox',
1925 'key' => 'svc_www-usersvc_svcpart',
1927 'description' => 'Allowable service definition svcparts for virtual hosts, one per line.',
1928 'type' => 'select-part_svc',
1933 'key' => 'selfservice_server-primary_only',
1935 'description' => 'Only allow primary accounts to access self-service functionality.',
1936 'type' => 'checkbox',
1940 'key' => 'selfservice_server-phone_login',
1942 'description' => 'Allow login to self-service with phone number and PIN.',
1943 'type' => 'checkbox',
1947 'key' => 'selfservice_server-single_domain',
1949 'description' => 'If specified, only use this one domain for self-service access.',
1954 'key' => 'card_refund-days',
1955 'section' => 'billing',
1956 'description' => 'After a payment, the number of days a refund link will be available for that payment. Defaults to 120.',
1961 'key' => 'agent-showpasswords',
1963 'description' => 'Display unencrypted user passwords in the agent (reseller) interface',
1964 'type' => 'checkbox',
1968 'key' => 'global_unique-username',
1969 'section' => 'username',
1970 '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.',
1972 'select_enum' => [ 'none', 'username', 'username@domain', 'disabled' ],
1976 'key' => 'global_unique-phonenum',
1978 '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.',
1980 'select_enum' => [ 'none', 'countrycode+phonenum', 'disabled' ],
1984 'key' => 'svc_external-skip_manual',
1986 '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).',
1987 'type' => 'checkbox',
1991 'key' => 'svc_external-display_type',
1993 'description' => 'Select a specific svc_external type to enable some UI changes specific to that type (i.e. artera_turbo).',
1995 'select_enum' => [ 'generic', 'artera_turbo', ],
1999 'key' => 'ticket_system',
2001 'description' => 'Ticketing system integration. <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:RT_Installation">integrated ticketing installation instructions</a>). <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
2003 #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
2004 'select_enum' => [ '', qw(RT_Internal RT_External) ],
2008 'key' => 'ticket_system-default_queueid',
2010 'description' => 'Default queue used when creating new customer tickets.',
2011 'type' => 'select-sub',
2012 'options_sub' => sub {
2013 my $conf = new FS::Conf;
2014 if ( $conf->config('ticket_system') ) {
2015 eval "use FS::TicketSystem;";
2017 FS::TicketSystem->queues();
2022 'option_sub' => sub {
2023 my $conf = new FS::Conf;
2024 if ( $conf->config('ticket_system') ) {
2025 eval "use FS::TicketSystem;";
2027 FS::TicketSystem->queue(shift);
2035 'key' => 'ticket_system-priority_reverse',
2037 '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.',
2038 'type' => 'checkbox',
2042 'key' => 'ticket_system-custom_priority_field',
2044 'description' => 'Custom field from the ticketing system to use as a custom priority classification.',
2049 'key' => 'ticket_system-custom_priority_field-values',
2051 'description' => 'Values for the custom field from the ticketing system to break down and sort customer ticket lists.',
2052 'type' => 'textarea',
2056 'key' => 'ticket_system-custom_priority_field_queue',
2058 'description' => 'Ticketing system queue in which the custom field specified in ticket_system-custom_priority_field is located.',
2063 'key' => 'ticket_system-rt_external_datasrc',
2065 '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>',
2071 'key' => 'ticket_system-rt_external_url',
2073 'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
2078 'key' => 'company_name',
2079 'section' => 'required',
2080 'description' => 'Your company name',
2082 'per_agent' => 1, #XXX just FS/FS/ClientAPI/Signup.pm
2086 'key' => 'company_address',
2087 'section' => 'required',
2088 'description' => 'Your company address',
2089 'type' => 'textarea',
2094 'key' => 'echeck-void',
2095 'section' => 'deprecated',
2096 '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',
2097 'type' => 'checkbox',
2102 'section' => 'deprecated',
2103 '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',
2104 'type' => 'checkbox',
2109 'section' => 'deprecated',
2110 'description' => '<B>DEPRECATED</B>, now controlled by ACLs. Used to enable unvoiding of voided payments',
2111 'type' => 'checkbox',
2115 'key' => 'address2-search',
2117 'description' => 'Enable a "Unit" search box which searches the second address field. Useful for multi-tenant applications. See also: cust_main-require_address2',
2118 'type' => 'checkbox',
2122 'key' => 'cust_main-require_address2',
2124 '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',
2125 'type' => 'checkbox',
2129 'key' => 'agent-ship_address',
2131 '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.",
2132 'type' => 'checkbox',
2135 { 'key' => 'referral_credit',
2136 'section' => 'deprecated',
2137 '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.",
2138 'type' => 'checkbox',
2141 { 'key' => 'selfservice_server-cache_module',
2143 '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.',
2145 'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
2150 'section' => 'billing',
2151 '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).',
2152 'type' => [qw( checkbox textarea )],
2156 'key' => 'cust_bill-ftpformat',
2157 'section' => 'billing',
2158 'description' => 'Enable FTP of raw invoice data - format.',
2160 'select_enum' => [ '', 'default', 'billco', ],
2164 'key' => 'cust_bill-ftpserver',
2165 'section' => 'billing',
2166 'description' => 'Enable FTP of raw invoice data - server.',
2171 'key' => 'cust_bill-ftpusername',
2172 'section' => 'billing',
2173 'description' => 'Enable FTP of raw invoice data - server.',
2178 'key' => 'cust_bill-ftppassword',
2179 'section' => 'billing',
2180 'description' => 'Enable FTP of raw invoice data - server.',
2185 'key' => 'cust_bill-ftpdir',
2186 'section' => 'billing',
2187 'description' => 'Enable FTP of raw invoice data - server.',
2192 'key' => 'cust_bill-spoolformat',
2193 'section' => 'billing',
2194 'description' => 'Enable spooling of raw invoice data - format.',
2196 'select_enum' => [ '', 'default', 'billco', ],
2200 'key' => 'cust_bill-spoolagent',
2201 'section' => 'billing',
2202 'description' => 'Enable per-agent spooling of raw invoice data.',
2203 'type' => 'checkbox',
2207 'key' => 'svc_acct-usage_suspend',
2208 'section' => 'billing',
2209 '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.',
2210 'type' => 'checkbox',
2214 'key' => 'svc_acct-usage_unsuspend',
2215 'section' => 'billing',
2216 '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.',
2217 'type' => 'checkbox',
2221 'key' => 'svc_acct-usage_threshold',
2222 'section' => 'billing',
2223 '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.',
2228 'key' => 'cust-fields',
2230 'description' => 'Which customer fields to display on reports by default',
2232 'select_hash' => [ FS::ConfDefaults->cust_fields_avail() ],
2236 'key' => 'cust_pkg-display_times',
2238 'description' => 'Display full timestamps (not just dates) for customer packages. Useful if you are doing real-time things like hourly prepaid.',
2239 'type' => 'checkbox',
2243 'key' => 'cust_pkg-always_show_location',
2245 'description' => "Always display package locations, even when they're all the default service address.",
2246 'type' => 'checkbox',
2250 'key' => 'svc_acct-edit_uid',
2251 'section' => 'shell',
2252 'description' => 'Allow UID editing.',
2253 'type' => 'checkbox',
2257 'key' => 'svc_acct-edit_gid',
2258 'section' => 'shell',
2259 'description' => 'Allow GID editing.',
2260 'type' => 'checkbox',
2264 'key' => 'zone-underscore',
2265 'section' => 'BIND',
2266 'description' => 'Allow underscores in zone names. As underscores are illegal characters in zone names, this option is not recommended.',
2267 'type' => 'checkbox',
2271 'key' => 'echeck-nonus',
2272 'section' => 'billing',
2273 'description' => 'Disable ABA-format account checking for Electronic Check payment info',
2274 'type' => 'checkbox',
2278 'key' => 'voip-cust_cdr_spools',
2280 'description' => 'Enable the per-customer option for individual CDR spools.',
2281 'type' => 'checkbox',
2285 'key' => 'voip-cust_cdr_squelch',
2287 'description' => 'Enable the per-customer option for not printing CDR on invoices.',
2288 'type' => 'checkbox',
2292 'key' => 'voip-cdr_email',
2294 'description' => 'Include the call details on emailed invoices even if the customer is configured for not printing them on the invoices.',
2295 'type' => 'checkbox',
2299 'key' => 'voip-cust_email_csv_cdr',
2301 'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
2302 'type' => 'checkbox',
2306 'key' => 'svc_forward-arbitrary_dst',
2308 '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.",
2309 'type' => 'checkbox',
2313 'key' => 'tax-ship_address',
2314 'section' => 'billing',
2315 'description' => 'By default, tax calculations are done based on the billing address. Enable this switch to calculate tax based on the shipping address instead.',
2316 'type' => 'checkbox',
2320 'key' => 'tax-pkg_address',
2321 'section' => 'billing',
2322 'description' => 'By default, tax calculations are done based on the billing address. Enable this switch to calculate tax based on the package address instead (when present). Note that this option is currently incompatible with vendor data taxation enabled by enable_taxproducts.',
2323 'type' => 'checkbox',
2327 'key' => 'invoice-ship_address',
2328 'section' => 'billing',
2329 'description' => 'Include the shipping address on invoices.',
2330 'type' => 'checkbox',
2334 'key' => 'invoice-unitprice',
2335 'section' => 'billing',
2336 'description' => 'Enable unit pricing on invoices.',
2337 'type' => 'checkbox',
2341 'key' => 'invoice-smallernotes',
2342 'section' => 'billing',
2343 'description' => 'Display the notes section in a smaller font on invoices.',
2344 'type' => 'checkbox',
2348 'key' => 'invoice-smallerfooter',
2349 'section' => 'billing',
2350 'description' => 'Display footers in a smaller font on invoices.',
2351 'type' => 'checkbox',
2355 'key' => 'postal_invoice-fee_pkgpart',
2356 'section' => 'billing',
2357 'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
2358 'type' => 'select-part_pkg',
2362 'key' => 'postal_invoice-recurring_only',
2363 'section' => 'billing',
2364 'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
2365 'type' => 'checkbox',
2369 'key' => 'batch-enable',
2370 'section' => 'deprecated', #make sure batch-enable_payby is set for
2371 #everyone before removing
2372 'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
2373 'type' => 'checkbox',
2377 'key' => 'batch-enable_payby',
2378 'section' => 'billing',
2379 'description' => 'Enable batch processing for the specified payment types.',
2380 'type' => 'selectmultiple',
2381 'select_enum' => [qw( CARD CHEK )],
2385 'key' => 'realtime-disable_payby',
2386 'section' => 'billing',
2387 'description' => 'Disable realtime processing for the specified payment types.',
2388 'type' => 'selectmultiple',
2389 'select_enum' => [qw( CARD CHEK )],
2393 'key' => 'batch-default_format',
2394 'section' => 'billing',
2395 'description' => 'Default format for batches.',
2397 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
2398 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP',
2404 'key' => 'batch-fixed_format-CARD',
2405 'section' => 'billing',
2406 'description' => 'Fixed (unchangeable) format for credit card batches.',
2408 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
2409 'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
2413 'key' => 'batch-fixed_format-CHEK',
2414 'section' => 'billing',
2415 'description' => 'Fixed (unchangeable) format for electronic check batches.',
2417 'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
2423 'key' => 'batch-increment_expiration',
2424 'section' => 'billing',
2425 'description' => 'Increment expiration date years in batches until cards are current. Make sure this is acceptable to your batching provider before enabling.',
2426 'type' => 'checkbox'
2430 'key' => 'batchconfig-BoM',
2431 'section' => 'billing',
2432 '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',
2433 'type' => 'textarea',
2437 'key' => 'batchconfig-PAP',
2438 'section' => 'billing',
2439 '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',
2440 'type' => 'textarea',
2444 'key' => 'batchconfig-csv-chase_canada-E-xactBatch',
2445 'section' => 'billing',
2446 'description' => 'Gateway ID for Chase Canada E-xact batching',
2451 'key' => 'batchconfig-paymentech',
2452 'section' => 'billing',
2453 'description' => 'Configuration for Chase Paymentech batching, four lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username',
2454 'type' => 'textarea',
2458 'key' => 'payment_history-years',
2460 'description' => 'Number of years of payment history to show by default. Currently defaults to 2.',
2465 'key' => 'change_history-years',
2467 'description' => 'Number of years of change history to show by default. Currently defaults to 0.5.',
2472 'key' => 'cust_main-packages-years',
2474 'description' => 'Number of years to show old (cancelled and one-time charge) packages by default. Currently defaults to 2.',
2479 'key' => 'cust_main-use_comments',
2481 'description' => 'Display free form comments on the customer edit screen. Useful as a scratch pad.',
2482 'type' => 'checkbox',
2486 'key' => 'cust_main-disable_notes',
2488 'description' => 'Disable new style customer notes - timestamped and user identified customer notes. Useful in tracking who did what.',
2489 'type' => 'checkbox',
2493 'key' => 'cust_main_note-display_times',
2495 'description' => 'Display full timestamps (not just dates) for customer notes.',
2496 'type' => 'checkbox',
2500 'key' => 'cust_main-ticket_statuses',
2502 'description' => 'Show tickets with these statuses on the customer view page.',
2503 'type' => 'selectmultiple',
2504 'select_enum' => [qw( new open stalled resolved rejected deleted )],
2508 'key' => 'cust_main-max_tickets',
2510 'description' => 'Maximum number of tickets to show on the customer view page.',
2515 'key' => 'cust_main-skeleton_tables',
2517 'description' => 'Tables which will have skeleton records inserted into them for each customer. Syntax for specifying tables is unfortunately a tricky perl data structure for now.',
2518 'type' => 'textarea',
2522 'key' => 'cust_main-skeleton_custnum',
2524 'description' => 'Customer number specifying the source data to copy into skeleton tables for new customers.',
2529 'key' => 'cust_main-enable_birthdate',
2531 'descritpion' => 'Enable tracking of a birth date with each customer record',
2532 'type' => 'checkbox',
2536 'key' => 'support-key',
2538 '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.',
2543 'key' => 'card-types',
2544 'section' => 'billing',
2545 'description' => 'Select one or more card types to enable only those card types. If no card types are selected, all card types are available.',
2546 'type' => 'selectmultiple',
2547 'select_enum' => \@card_types,
2551 'key' => 'disable-fuzzy',
2553 'description' => 'Disable fuzzy searching. Speeds up searching for large sites, but only shows exact matches.',
2554 'type' => 'checkbox',
2557 { 'key' => 'pkg_referral',
2559 'description' => 'Enable package-specific advertising sources.',
2560 'type' => 'checkbox',
2563 { 'key' => 'pkg_referral-multiple',
2565 'description' => 'In addition, allow multiple advertising sources to be associated with a single package.',
2566 'type' => 'checkbox',
2570 'key' => 'dashboard-install_welcome',
2572 'description' => 'New install welcome screen.',
2574 'select_enum' => [ '', 'ITSP_fsinc_hosted', ],
2578 'key' => 'dashboard-toplist',
2580 'description' => 'List of items to display on the top of the front page',
2581 'type' => 'textarea',
2585 'key' => 'impending_recur_template',
2586 'section' => 'billing',
2587 '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>',
2588 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
2589 'type' => 'textarea',
2593 'key' => 'logo.png',
2594 'section' => 'billing', #?
2595 'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format. Suggested size somewhere near 92x62.',
2597 'per_agent' => 1, #XXX just view/logo.cgi, which is for the global
2598 #old-style editor anyway...?
2602 'key' => 'logo.eps',
2603 'section' => 'billing', #?
2604 'description' => 'Company logo for printed and PDF invoices, in EPS format.',
2606 'per_agent' => 1, #XXX as above, kinda
2610 'key' => 'selfservice-ignore_quantity',
2612 'description' => 'Ignores service quantity restrictions in self-service context. Strongly not recommended - just set your quantities correctly in the first place.',
2613 'type' => 'checkbox',
2617 'key' => 'selfservice-session_timeout',
2619 'description' => 'Self-service session timeout. Defaults to 1 hour.',
2621 'select_enum' => [ '1 hour', '2 hours', '4 hours', '8 hours', '1 day', '1 week', ],
2625 'key' => 'disable_setup_suspended_pkgs',
2626 'section' => 'billing',
2627 'description' => 'Disables charging of setup fees for suspended packages.',
2628 'type' => 'checkbox',
2632 'key' => 'password-generated-allcaps',
2633 'section' => 'password',
2634 'description' => 'Causes passwords automatically generated to consist entirely of capital letters',
2635 'type' => 'checkbox',
2639 'key' => 'datavolume-forcemegabytes',
2641 'description' => 'All data volumes are expressed in megabytes',
2642 'type' => 'checkbox',
2646 'key' => 'datavolume-significantdigits',
2648 'description' => 'number of significant digits to use to represent data volumes',
2653 'key' => 'disable_void_after',
2654 'section' => 'billing',
2655 'description' => 'Number of seconds after which freeside won\'t attempt to VOID a payment first when performing a refund.',
2660 'key' => 'disable_line_item_date_ranges',
2661 'section' => 'billing',
2662 'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.',
2663 'type' => 'checkbox',
2667 'key' => 'support_packages',
2669 '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...
2670 'type' => 'select-part_pkg',
2675 'key' => 'cust_main-require_phone',
2677 'description' => 'Require daytime or night phone for all customer records.',
2678 'type' => 'checkbox',
2682 'key' => 'cust_main-require_invoicing_list_email',
2684 'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
2685 'type' => 'checkbox',
2689 'key' => 'svc_acct-display_paid_time_remaining',
2691 'description' => 'Show paid time remaining in addition to time remaining.',
2692 'type' => 'checkbox',
2696 'key' => 'cancel_credit_type',
2697 'section' => 'billing',
2698 'description' => 'The group to use for new, automatically generated credit reasons resulting from cancellation.',
2699 'type' => 'select-sub',
2700 'options_sub' => sub { require FS::Record;
2701 require FS::reason_type;
2702 map { $_->typenum => $_->type }
2703 FS::Record::qsearch('reason_type', { class=>'R' } );
2705 'option_sub' => sub { require FS::Record;
2706 require FS::reason_type;
2707 my $reason_type = FS::Record::qsearchs(
2708 'reason_type', { 'typenum' => shift }
2710 $reason_type ? $reason_type->type : '';
2715 'key' => 'referral_credit_type',
2716 'section' => 'deprecated',
2717 '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.',
2718 'type' => 'select-sub',
2719 'options_sub' => sub { require FS::Record;
2720 require FS::reason_type;
2721 map { $_->typenum => $_->type }
2722 FS::Record::qsearch('reason_type', { class=>'R' } );
2724 'option_sub' => sub { require FS::Record;
2725 require FS::reason_type;
2726 my $reason_type = FS::Record::qsearchs(
2727 'reason_type', { 'typenum' => shift }
2729 $reason_type ? $reason_type->type : '';
2734 'key' => 'signup_credit_type',
2735 'section' => 'billing',
2736 'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
2737 'type' => 'select-sub',
2738 'options_sub' => sub { require FS::Record;
2739 require FS::reason_type;
2740 map { $_->typenum => $_->type }
2741 FS::Record::qsearch('reason_type', { class=>'R' } );
2743 'option_sub' => sub { require FS::Record;
2744 require FS::reason_type;
2745 my $reason_type = FS::Record::qsearchs(
2746 'reason_type', { 'typenum' => shift }
2748 $reason_type ? $reason_type->type : '';
2753 'key' => 'cust_main-agent_custid-format',
2755 'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
2758 '' => 'Numeric only',
2759 'ww?d+' => 'Numeric with one or two letter prefix',
2764 'key' => 'card_masking_method',
2766 '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.',
2769 '' => '123456xxxxxx1234',
2770 'first6last2' => '123456xxxxxxxx12',
2771 'first4last4' => '1234xxxxxxxx1234',
2772 'first4last2' => '1234xxxxxxxxxx12',
2773 'first2last4' => '12xxxxxxxxxx1234',
2774 'first2last2' => '12xxxxxxxxxxxx12',
2775 'first0last4' => 'xxxxxxxxxxxx1234',
2776 'first0last2' => 'xxxxxxxxxxxxxx12',
2781 'key' => 'disable_previous_balance',
2782 'section' => 'billing',
2783 'description' => 'Disable inclusion of previous balancem payment, and credit lines on invoices',
2784 'type' => 'checkbox',
2788 'key' => 'previous_balance-summary_only',
2789 'section' => 'billing',
2790 'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
2791 'type' => 'checkbox',
2795 'key' => 'usps_webtools-userid',
2797 '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.',
2802 'key' => 'usps_webtools-password',
2804 '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.',
2809 'key' => 'cust_main-auto_standardize_address',
2811 'description' => 'When using USPS web tools, automatically standardize the address without asking.',
2812 'type' => 'checkbox',
2816 'key' => 'cust_main-require_censustract',
2818 'description' => 'Customer is required to have a census tract. Useful for FCC form 477 reports. See also: cust_main-auto_standardize_address',
2819 'type' => 'checkbox',
2823 'key' => 'census_year',
2825 'description' => 'The year to use in census tract lookups',
2827 'select_enum' => [ qw( 2009 2008 2007 2006 ) ],
2831 'key' => 'company_latitude',
2833 'description' => 'Your company latitude (-90 through 90)',
2838 'key' => 'company_longitude',
2840 'description' => 'Your company longitude (-180 thru 180)',
2845 'key' => 'disable_acl_changes',
2847 'description' => 'Disable all ACL changes, for demos.',
2848 'type' => 'checkbox',
2852 'key' => 'cust_main-edit_agent_custid',
2854 'description' => 'Enable editing of the agent_custid field.',
2855 'type' => 'checkbox',
2859 'key' => 'cust_main-default_agent_custid',
2861 'description' => 'Display the agent_custid field when available instead of the custnum field.',
2862 'type' => 'checkbox',
2866 'key' => 'cust_bill-default_agent_invid',
2868 'description' => 'Display the agent_invid field when available instead of the invnum field.',
2869 'type' => 'checkbox',
2873 'key' => 'cust_main-auto_agent_custid',
2875 'description' => 'Automatically assign an agent_custid - select format',
2877 'select_hash' => [ '' => 'No',
2878 '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
2883 'key' => 'cust_main-default_areacode',
2885 'description' => 'Default area code for customers.',
2890 'key' => 'mcp_svcpart',
2892 'description' => 'Master Control Program svcpart. Leave this blank.',
2893 'type' => 'text', #select-part_svc
2897 'key' => 'cust_bill-max_same_services',
2898 'section' => 'billing',
2899 '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.',
2904 'key' => 'suspend_email_admin',
2906 'description' => 'Destination admin email address to enable suspension notices',
2911 'key' => 'email_report-subject',
2913 'description' => 'Subject for reports emailed by freeside-fetch. Defaults to "Freeside report".',
2918 'key' => 'selfservice-head',
2920 'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
2921 'type' => 'textarea', #htmlarea?
2926 'key' => 'selfservice-body_header',
2928 'description' => 'HTML header for the self-service interface',
2929 'type' => 'textarea', #htmlarea?
2933 'key' => 'selfservice-body_footer',
2935 'description' => 'HTML header for the self-service interface',
2936 'type' => 'textarea', #htmlarea?
2941 'key' => 'selfservice-body_bgcolor',
2943 'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
2948 'key' => 'selfservice-box_bgcolor',
2950 'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0"',
2955 'key' => 'selfservice-bulk_format',
2957 'description' => 'Parameter arrangement for selfservice bulk features',
2959 'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
2964 'key' => 'selfservice-bulk_ftp_dir',
2966 'description' => 'Enable bulk ftp provisioning in this folder',
2972 'key' => 'signup-no_company',
2974 'description' => "Don't display a field for company name on signup.",
2975 'type' => 'checkbox',
2979 'key' => 'signup-recommend_email',
2981 'description' => 'Encourage the entry of an invoicing email address on signup.',
2982 'type' => 'checkbox',
2986 'key' => 'signup-recommend_daytime',
2988 'description' => 'Encourage the entry of a daytime phone number invoicing email address on signup.',
2989 'type' => 'checkbox',
2993 'key' => 'svc_phone-radius-default_password',
2995 'description' => 'Default password when exporting svc_phone records to RADIUS',
3000 'key' => 'svc_phone-allow_alpha_phonenum',
3002 'description' => 'Allow letters in phone numbers.',
3003 'type' => 'checkbox',
3007 'key' => 'default_phone_countrycode',
3009 'description' => 'Default countrcode',
3014 'key' => 'cdr-charged_party-accountcode',
3016 'description' => 'Set the charged_party field of CDRs to the accountcode.',
3017 'type' => 'checkbox',
3021 'key' => 'cdr-charged_party-accountcode-trim_leading_0s',
3023 'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
3024 'type' => 'checkbox',
3028 # 'key' => 'cdr-charged_party-truncate_prefix',
3030 # 'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
3035 # 'key' => 'cdr-charged_party-truncate_length',
3037 # 'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
3042 'key' => 'cdr-charged_party_rewrite',
3044 '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*.',
3045 'type' => 'checkbox',
3049 'key' => 'cdr-taqua-da_rewrite',
3051 '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.',
3056 'key' => 'cust_pkg-show_autosuspend',
3058 'description' => 'Show package auto-suspend dates. Use with caution for now; can slow down customer view for large insallations.',
3059 'type' => 'checkbox',
3063 'key' => 'cdr-asterisk_forward_rewrite',
3065 '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").',
3066 'type' => 'checkbox',
3070 'key' => 'sg-multicustomer_hack',
3072 'description' => "Don't use this.",
3073 'type' => 'checkbox',
3077 'key' => 'sg-ping_username',
3079 'description' => "Don't use this.",
3084 'key' => 'sg-ping_password',
3086 'description' => "Don't use this.",
3091 'key' => 'sg-login_username',
3093 'description' => "Don't use this.",
3098 'key' => 'disable-cust-pkg_class',
3100 'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
3101 'type' => 'checkbox',
3105 'key' => 'queued-max_kids',
3107 'description' => 'Maximum number of queued processes. Defaults to 10.',
3112 'key' => 'cancelled_cust-noevents',
3113 'section' => 'billing',
3114 'description' => "Don't run events for cancelled customers",
3115 'type' => 'checkbox',
3119 'key' => 'agent-invoice_template',
3120 'section' => 'billing',
3121 'description' => 'Enable display/edit of old-style per-agent invoice template selection',
3122 'type' => 'checkbox',
3126 'key' => 'svc_broadband-manage_link',
3128 'description' => 'URL for svc_broadband "Manage Device" link. The following substitutions are available: $ip_addr.',
3132 #more fine-grained, service def-level control could be useful eventually?
3134 'key' => 'svc_broadband-allow_null_ip_addr',
3136 'description' => '',
3137 'type' => 'checkbox',
3141 'key' => 'tax-report_groups',
3143 'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
3144 'type' => 'textarea',
3148 'key' => 'tax-cust_exempt-groups',
3150 '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).',
3151 'type' => 'textarea',
3155 'key' => 'cust_main-default_view',
3157 'description' => 'Default customer view, for users who have not selected a default view in their preferences.',
3160 #false laziness w/view/cust_main.cgi and pref/pref.html
3161 'basics' => 'Basics',
3163 'tickets' => 'Tickets',
3164 'packages' => 'Packages',
3165 'payment_history' => 'Payment History',
3166 'change_history' => 'Change History',
3172 'key' => 'enable_tax_adjustments',
3173 'section' => 'billing',
3174 'description' => 'Enable the ability to add manual tax adjustments.',
3175 'type' => 'checkbox',
3179 'key' => 'rt-crontool',
3181 'description' => 'Enable the RT CronTool extension.',
3182 'type' => 'checkbox',
3186 'key' => 'pkg-balances',
3187 'section' => 'billing',
3188 'description' => 'Enable experimental package balances. Not recommended for general use.',
3189 'type' => 'checkbox',
3193 'key' => 'cust_main-edit_signupdate',
3195 'descritpion' => 'Enable manual editing of the signup date.',
3196 'type' => 'checkbox',
3200 'key' => 'svc_acct-disable_access_number',
3202 'descritpion' => 'Disable access number selection.',
3203 'type' => 'checkbox',
3206 { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3207 { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3208 { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3209 { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3210 { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3211 { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3212 { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3213 { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3214 { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3215 { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3216 { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3217 { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3218 { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3219 { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3220 { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3221 { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3222 { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3223 { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3224 { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3225 { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3226 { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3227 { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3228 { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3229 { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3230 { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3231 { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3232 { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3233 { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3234 { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3235 { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3236 { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3237 { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3238 { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3239 { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3240 { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3241 { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3242 { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3243 { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3244 { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3245 { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
3246 { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },