add (unfinished) credit card surcharge, part 1
[freeside.git] / FS / FS / Conf.pm
index aa6ad1b..fc7e5c8 100644 (file)
@@ -395,6 +395,7 @@ sub verify_config_item {
 
   } else {
 
+    no warnings 'uninitialized';
     $error .= "$key fails binary comparison; "
       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
 
@@ -464,7 +465,7 @@ sub _orbase_items {
                   'key'         => $_,
                   'base_key'    => $proto->key,
                   'section'     => $proto->section,
-                  '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.',
+                  'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
                   'type'        => $proto->type,
                 };
               } &$listmaker($base);
@@ -549,21 +550,60 @@ worry that config_items is freeside-specific and icky.
   "Solo",
 );
 
-@base_items = qw (
-                   invoice_template
-                   invoice_latex
-                   invoice_latexreturnaddress
-                   invoice_latexfooter
-                   invoice_latexsmallfooter
-                   invoice_latexnotes
-                   invoice_latexcoupon
-                   invoice_html
-                   invoice_htmlreturnaddress
-                   invoice_htmlfooter
-                   invoice_htmlnotes
-                   logo.png
-                   logo.eps
-                 );
+@base_items = qw(
+invoice_template
+invoice_latex
+invoice_latexreturnaddress
+invoice_latexfooter
+invoice_latexsmallfooter
+invoice_latexnotes
+invoice_latexcoupon
+invoice_html
+invoice_htmlreturnaddress
+invoice_htmlfooter
+invoice_htmlnotes
+logo.png
+logo.eps
+);
+
+my %msg_template_options = (
+  'type'        => 'select-sub',
+  'options_sub' => sub { 
+    my @templates = qsearch({
+        'table' => 'msg_template', 
+        'hashref' => { 'disabled' => '' },
+        'extra_sql' => ' AND '. 
+          $FS::CurrentUser::CurrentUser->agentnums_sql(null => 1),
+        });
+    map { $_->msgnum, $_->msgname } @templates;
+  },
+  'option_sub'  => sub { 
+                         my $msg_template = FS::msg_template->by_key(shift);
+                         $msg_template ? $msg_template->msgname : ''
+                       },
+  'per_agent' => 1,
+);
+
+my $_gateway_name = sub {
+  my $g = shift;
+  return '' if !$g;
+  ($g->gateway_username . '@' . $g->gateway_module);
+};
+
+my %payment_gateway_options = (
+  'type'        => 'select-sub',
+  'options_sub' => sub {
+    my @gateways = qsearch({
+        'table' => 'payment_gateway',
+        'hashref' => { 'disabled' => '' },
+      });
+    map { $_->gatewaynum, $_gateway_name->($_) } @gateways;
+  },
+  'option_sub'  => sub {
+    my $gateway = FS::payment_gateway->by_key(shift);
+    $_gateway_name->($gateway);
+  },
+);
 
 #Billing (81 items)
 #Invoicing (50 items)
@@ -572,7 +612,6 @@ worry that config_items is freeside-specific and icky.
 #...
 #Unclassified (77 items)
 
-
 @config_items = map { new FS::ConfItem $_ } (
 
   {
@@ -584,7 +623,7 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'alert_expiration',
-    'section'     => 'billing',
+    'section'     => 'notification',
     'description' => 'Enable alerts about billing method expiration (i.e. expiring credit cards).',
     'type'        => 'checkbox',
     'per_agent'   => 1,
@@ -592,11 +631,18 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'alerter_template',
-    'section'     => 'billing',
-    'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).  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.',
+    'section'     => 'deprecated',
+    'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).',
     'type'        => 'textarea',
     'per_agent'   => 1,
   },
+  
+  {
+    'key'         => 'alerter_msgnum',
+    'section'     => 'notification',
+    'description' => 'Template to use for credit card expiration alerts.',
+    %msg_template_options,
+  },
 
   {
     'key'         => 'apacheip',
@@ -607,6 +653,20 @@ worry that config_items is freeside-specific and icky.
     'description' => 'IP address to assign to new virtual hosts',
     'type'        => 'text',
   },
+  
+  {
+    'key'         => 'credit-card-surcharge-percentage',
+    'section'     => 'billing',
+    'description' => 'Add a credit card surcharge to invoices, as a % of the invoice total. WARNING: this is usually prohibited by merchant account / other agreements and/or law, but is currently lawful in AU and UK.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'discount-show-always',
+    'section'     => 'billing',
+    'description' => 'Generate a line item on an invoice even when a package is discounted 100%',
+    'type'        => 'checkbox',
+  },
 
   {
     'key'         => 'encryption',
@@ -717,6 +777,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'business-onlinepayment-test_transaction',
+    'section'     => 'billing',
+    'description' => 'Turns on the Business::OnlinePayment test_transaction flag.  Note that not all gateway modules support this flag; if yours does not, transactions will still be sent live.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'countrydefault',
     'section'     => 'UI',
     'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
@@ -736,6 +803,17 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'date_format_long',
+    'section'     => 'UI',
+    'description' => 'Verbose format for displaying dates',
+    'type'        => 'select',
+    'select_hash' => [
+                       '%b %o, %Y' => 'Mon DDth, YYYY',
+                       '%e %b %Y'  => 'DD Mon YYYY',
+                     ],
+  },
+
+  {
     'key'         => 'deletecustomers',
     'section'     => 'UI',
     '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.',
@@ -918,14 +996,14 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'invoice_template',
     'section'     => 'invoicing',
-    '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.',
+    'description' => 'Text template file for invoices.  Used if no invoice_html template is defined, and also seen by users using non-HTML capable mail clients.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
     'type'        => 'textarea',
   },
 
   {
     'key'         => 'invoice_html',
     'section'     => 'invoicing',
-    '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.',
+    'description' => 'Optional HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
 
     'type'        => 'textarea',
   },
@@ -964,11 +1042,60 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'invoice_latex',
     'section'     => 'invoicing',
-    '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.',
+    'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
     'type'        => 'textarea',
   },
 
   {
+    'key'         => 'invoice_latextopmargin',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice topmargin setting. Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+
+  {
+    'key'         => 'invoice_latexheadsep',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice headsep setting. Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+
+  {
+    'key'         => 'invoice_latexaddresssep',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice separation between invoice header
+and customer address. Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+
+  {
+    'key'         => 'invoice_latextextheight',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice textheight setting. Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+
+  {
     'key'         => 'invoice_latexnotes',
     'section'     => 'invoicing',
     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
@@ -1001,6 +1128,53 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'invoice_latexextracouponspace',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice textheight space to reserve for a tear off coupon. Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+
+  {
+    'key'         => 'invoice_latexcouponfootsep',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice separation between tear off coupon and footer. Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+
+  {
+    'key'         => 'invoice_latexcouponamountenclosedsep',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice separation between total due and amount enclosed line. Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+  {
+    'key'         => 'invoice_latexcoupontoaddresssep',
+    'section'     => 'invoicing',
+    'description' => 'Optional LaTeX invoice separation between invoice data and the to address (usually invoice_latexreturnaddress).  Include units.',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'validate'    => sub { shift =~
+                             /^-?\d*\.?\d+(in|mm|cm|pt|em|ex|pc|bp|dd|cc|sp)$/
+                             ? '' : 'Invalid LaTex length';
+                         },
+  },
+
+  {
     'key'         => 'invoice_latexreturnaddress',
     'section'     => 'invoicing',
     'description' => 'Return address for LaTeX typeset PostScript invoices.',
@@ -1008,6 +1182,22 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'invoice_latexverticalreturnaddress',
+    'section'     => 'invoicing',
+    'description' => 'Place the return address under the company logo rather than beside it.',
+    'type'        => 'checkbox',
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'invoice_latexcouponaddcompanytoaddress',
+    'section'     => 'invoicing',
+    'description' => 'Add the company name to the To address on the remittance coupon because the return address does not contain it.',
+    'type'        => 'checkbox',
+    'per_agent'   => 1,
+  },
+
+  {
     'key'         => 'invoice_latexsmallfooter',
     'section'     => 'invoicing',
     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
@@ -1029,13 +1219,19 @@ worry that config_items is freeside-specific and icky.
     'type'        => 'textarea'
   },
 
+  {
+    'key'         => 'invoice_print_pdf',
+    'section'     => 'invoicing',
+    'description' => 'Store postal invoices for download in PDF format rather than printing them directly.',
+    'type'        => 'checkbox',
+  },
 
   { 
     'key'         => 'invoice_default_terms',
     'section'     => 'invoicing',
     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
     'type'        => 'select',
-    'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
+    'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 21', 'Net 30', 'Net 45', 'Net 60', 'Net 90' ],
   },
 
   { 
@@ -1095,21 +1291,37 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'payment_receipt',
+    'section'     => 'notification',
+    'description' => 'Send payment receipts.',
+    'type'        => 'checkbox',
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'payment_receipt_msgnum',
+    'section'     => 'notification',
+    'description' => 'Template to use for payment receipts.',
+    %msg_template_options,
+  },
+
+  {
     'key'         => 'payment_receipt_email',
-    'section'     => 'billing',
-    '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>',
+    'section'     => 'deprecated',
+    'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.',
     'type'        => [qw( checkbox textarea )],
   },
 
   {
     'key'         => 'payment_receipt-trigger',
-    'section'     => 'billing',
+    'section'     => 'notification',
     'description' => 'When payment receipts are triggered.  Defaults to when payment is made.',
     'type'        => 'select',
     'select_hash' => [
                        'cust_pay'          => 'When payment is made.',
                        'cust_bill_pay_pkg' => 'When payment is applied.',
                      ],
+    'per_agent'   => 1,
   },
 
   {
@@ -1155,7 +1367,12 @@ worry that config_items is freeside-specific and icky.
     'editlist_parts' => [ { type=>'text' },
                           { type=>'immutable', value=>'IN' },
                           { type=>'select',
-                            select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
+                            select_enum => {
+                              map { $_=>$_ }
+                                  #@{ FS::domain_record->rectypes }
+                                  qw(A AAAA CNAME MX NS PTR SPF SRV TXT)
+                            },
+                          },
                           { type=> 'text' }, ],
   },
 
@@ -1208,7 +1425,20 @@ worry that config_items is freeside-specific and icky.
     'key'         => 'referraldefault',
     'section'     => 'UI',
     'description' => 'Default referral, specified by refnum',
-    'type'        => 'text',
+    'type'        => 'select-sub',
+    'options_sub' => sub { require FS::Record;
+                           require FS::part_referral;
+                           map { $_->refnum => $_->referral }
+                               FS::Record::qsearch( 'part_referral', 
+                                                   { 'disabled' => '' }
+                                                 );
+                        },
+    'option_sub'  => sub { require FS::Record;
+                           require FS::part_referral;
+                           my $part_referral = FS::Record::qsearchs(
+                            'part_referral', { 'refnum'=>shift } );
+                           $part_referral ? $part_referral->referral : '';
+                        },
   },
 
 #  {
@@ -1260,9 +1490,16 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'report-showpasswords',
+    'section'     => 'UI',
+    'description' => 'This is a terrible idea.  Do not enable it.  STRONGLY NOT RECOMMENDED.  Enables display of passwords on services reports.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'signupurl',
     'section'     => 'UI',
-    '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',
+    'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
     'type'        => 'text',
   },
 
@@ -1440,6 +1677,20 @@ worry that config_items is freeside-specific and icky.
     'type'        => 'checkbox',
   },
 
+  { 
+    'key'         => 'username-slash',
+    'section'     => 'username',
+    'description' => 'Allow the slash character (/) in usernames.  When using, make sure to set "Home directory" to fixed and blank in all svc_acct service definitions.',
+    'type'        => 'checkbox',
+  },
+
+  { 
+    'key'         => 'username-equals',
+    'section'     => 'username',
+    'description' => 'Allow the equal sign character (=) in usernames.',
+    'type'        => 'checkbox',
+  },
+
   {
     'key'         => 'safe-part_bill_event',
     'section'     => 'UI',
@@ -1520,6 +1771,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'selfservice-payment_gateway',
+    'section'     => 'self-service',
+    'description' => 'Force the use of this payment gateway for self-service.',
+    %payment_gateway_options,
+  },
+
+  {
     'key'         => 'selfservice-save_unchecked',
     'section'     => 'self-service',
     'description' => 'In self-service, uncheck "Remember information" checkboxes by default (normally, they are checked by default).',
@@ -1602,8 +1860,16 @@ worry that config_items is freeside-specific and icky.
     'select_hash' => [
                        'svc_acct'  => 'Account (svc_acct)',
                        'svc_phone' => 'Phone number (svc_phone)',
+                       'svc_pbx'   => 'PBX (svc_pbx)',
                      ],
   },
+  
+  {
+    'key'         => 'signup_server-prepaid-template-custnum',
+    'section'     => 'self-service',
+    'description' => 'When the signup server is used with prepaid cards and customer info is not required for signup, the contact/address info will be copied from this customer, if specified',
+    'type'        => 'text',
+  },
 
   {
     'key'         => 'selfservice_server-base_url',
@@ -1625,6 +1891,7 @@ worry that config_items is freeside-specific and icky.
     'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
     'type'        => 'checkbox',
   },
+
   {
     'key'         => 'signup_server-classnum2',
     'section'     => 'self-service',
@@ -1640,6 +1907,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'selfservice-xmlrpc',
+    'section'     => 'self-service',
+    'description' => 'Run a standalone self-service XML-RPC server on the backend (on port 8080).',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'backend-realtime',
     'section'     => 'billing',
     'description' => 'Run billing for backend signups immediately.',
@@ -1647,45 +1921,62 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'decline_msgnum',
+    'section'     => 'notification',
+    'description' => 'Template to use for credit card and electronic check decline messages.',
+    %msg_template_options,
+  },
+
+  {
     'key'         => 'declinetemplate',
-    'section'     => 'billing',
+    'section'     => 'deprecated',
     'description' => 'Template file for credit card and electronic check decline emails.',
     'type'        => 'textarea',
   },
 
   {
     'key'         => 'emaildecline',
-    'section'     => 'billing',
+    'section'     => 'notification',
     'description' => 'Enable emailing of credit card and electronic check decline notices.',
     'type'        => 'checkbox',
+    'per_agent'   => 1,
   },
 
   {
     'key'         => 'emaildecline-exclude',
-    'section'     => 'billing',
+    'section'     => 'notification',
     'description' => 'List of error messages that should not trigger email decline notices, one per line.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'cancel_msgnum',
+    'section'     => 'notification',
+    'description' => 'Template to use for cancellation emails.',
+    %msg_template_options,
   },
 
   {
     'key'         => 'cancelmessage',
-    'section'     => 'billing',
+    'section'     => 'deprecated',
     'description' => 'Template file for cancellation emails.',
     'type'        => 'textarea',
   },
 
   {
     'key'         => 'cancelsubject',
-    'section'     => 'billing',
+    'section'     => 'deprecated',
     'description' => 'Subject line for cancellation emails.',
     'type'        => 'text',
   },
 
   {
     'key'         => 'emailcancel',
-    'section'     => 'billing',
-    'description' => 'Enable emailing of cancellation notices.  Make sure to fill in the cancelmessage and cancelsubject configuration values as well.',
+    'section'     => 'notification',
+    'description' => 'Enable emailing of cancellation notices.  Make sure to select the template in the cancel_msgnum option.',
     'type'        => 'checkbox',
+    'per_agent'   => 1,
   },
 
   {
@@ -1738,16 +2029,23 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'welcome_msgnum',
+    'section'     => 'notification',
+    'description' => 'Template to use for welcome messages when a svc_acct record is created.',
+    %msg_template_options,
+  },
+
+  {
     'key'         => 'welcome_email',
-    'section'     => '',
-    '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>',
+    'section'     => 'deprecated',
+    '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.',
     'type'        => 'textarea',
     'per_agent'   => 1,
   },
 
   {
     'key'         => 'welcome_email-from',
-    'section'     => '',
+    'section'     => 'deprecated',
     'description' => 'From: address header for welcome email',
     'type'        => 'text',
     'per_agent'   => 1,
@@ -1755,7 +2053,7 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'welcome_email-subject',
-    'section'     => '',
+    'section'     => 'deprecated',
     'description' => 'Subject: header for welcome email',
     'type'        => 'text',
     'per_agent'   => 1,
@@ -1763,7 +2061,7 @@ worry that config_items is freeside-specific and icky.
   
   {
     'key'         => 'welcome_email-mimetype',
-    'section'     => '',
+    'section'     => 'deprecated',
     'description' => 'MIME type for welcome email',
     'type'        => 'select',
     'select_enum' => [ 'text/plain', 'text/html' ],
@@ -1777,37 +2075,44 @@ worry that config_items is freeside-specific and icky.
     'type'        => 'textarea',
   },
 
+#  {
+#    'key'         => 'warning_msgnum',
+#    'section'     => 'notification',
+#    'description' => 'Template to use for warning messages, sent to the customer email invoice destination(s) when a svc_acct record has its usage drop below a threshold.',
+#    %msg_template_options,
+#  },
+
   {
     'key'         => 'warning_email',
-    'section'     => '',
+    'section'     => 'notification',
     '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>',
     'type'        => 'textarea',
   },
 
   {
     'key'         => 'warning_email-from',
-    'section'     => '',
+    'section'     => 'notification',
     'description' => 'From: address header for warning email',
     'type'        => 'text',
   },
 
   {
     'key'         => 'warning_email-cc',
-    'section'     => '',
+    'section'     => 'notification',
     'description' => 'Additional recipient(s) (comma separated) for warning email when remaining usage reaches zero.',
     'type'        => 'text',
   },
 
   {
     'key'         => 'warning_email-subject',
-    'section'     => '',
+    'section'     => 'notification',
     'description' => 'Subject: header for warning email',
     'type'        => 'text',
   },
   
   {
     'key'         => 'warning_email-mimetype',
-    'section'     => '',
+    'section'     => 'notification',
     'description' => 'MIME type for warning email',
     'type'        => 'select',
     'select_enum' => [ 'text/plain', 'text/html' ],
@@ -2024,6 +2329,87 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'selfservice_server-login_svcpart',
+    'section'     => 'self-service',
+    'description' => 'If specified, only allow the specified svcparts to login to self-service.',
+    'type'        => 'select-part_svc',
+    'multiple'    => 1,
+  },
+  
+  {
+    'key'         => 'selfservice-recent-did-age',
+    'section'     => 'self-service',
+    'description' => 'If specified, defines "recent", in number of seconds, for "Download recently allocated DIDs" in self-service.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'selfservice_server-view-wholesale',
+    'section'     => 'self-service',
+    'description' => 'If enabled, use a wholesale package view in the self-service.',
+    'type'        => 'checkbox',
+  },
+  
+  {
+    'key'         => 'selfservice-agent_signup',
+    'section'     => 'self-service',
+    'description' => 'Allow agent signup via self-service.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'selfservice-agent_signup-agent_type',
+    'section'     => 'self-service',
+    'description' => 'Agent type when allowing agent signup via self-service.',
+    'type'        => 'select-sub',
+    'options_sub' => sub { require FS::Record;
+                           require FS::agent_type;
+                          map { $_->typenum => $_->atype }
+                               FS::Record::qsearch('agent_type', {} ); # disabled=>'' } );
+                        },
+    'option_sub'  => sub { require FS::Record;
+                           require FS::agent_type;
+                          my $agent = FS::Record::qsearchs(
+                            'agent_type', { 'typenum'=>shift }
+                          );
+                           $agent_type ? $agent_type->atype : '';
+                        },
+  },
+
+  {
+    'key'         => 'selfservice-agent_login',
+    'section'     => 'self-service',
+    'description' => 'Allow agent login via self-service.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'selfservice-self_suspend_reason',
+    'section'     => 'self-service',
+    'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
+    'type'        => 'select-sub',
+    'options_sub' => sub { require FS::Record;
+                           require FS::reason;
+                           my $type = qsearchs('reason_type', 
+                             { class => 'S' }) 
+                              or return ();
+                          map { $_->reasonnum => $_->reason }
+                               FS::Record::qsearch('reason', 
+                                 { reason_type => $type->typenum } 
+                               );
+                        },
+    'option_sub'  => sub { require FS::Record;
+                           require FS::reason;
+                          my $reason = FS::Record::qsearchs(
+                            'reason', { 'reasonnum' => shift }
+                          );
+                           $reason ? $reason->reason : '';
+                        },
+
+    'per_agent'   => 1,
+  },
+
+  {
     'key'         => 'card_refund-days',
     'section'     => 'billing',
     'description' => 'After a payment, the number of days a refund link will be available for that payment.  Defaults to 120.',
@@ -2054,6 +2440,22 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'global_unique-pbx_title',
+    'section'     => '',
+    'description' => 'Global phone number uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
+    'type'        => 'select',
+    'select_enum' => [ 'enabled', 'disabled' ],
+  },
+
+  {
+    'key'         => 'global_unique-pbx_id',
+    'section'     => '',
+    'description' => 'Global PBX id uniqueness control: none (check uniqueness per exports), enabled (check across all services), or disabled (no duplicate checking).',
+    'type'        => 'select',
+    'select_enum' => [ 'enabled', 'disabled' ],
+  },
+
+  {
     'key'         => 'svc_external-skip_manual',
     'section'     => 'UI',
     '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).',
@@ -2071,13 +2473,22 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'ticket_system',
     'section'     => '',
-    '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).',
+    'description' => 'Ticketing system integration.  <b>RT_Internal</b> uses the built-in RT ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:RT_Installation">integrated ticketing installation instructions</a>).   <b>RT_External</b> accesses an external RT installation in a separate database (local or remote).',
     'type'        => 'select',
     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
     'select_enum' => [ '', qw(RT_Internal RT_External) ],
   },
 
   {
+    'key'         => 'network_monitoring_system',
+    'section'     => '',
+    'description' => 'Networking monitoring system (NMS) integration.  <b>Torrus_Internal</b> uses the built-in Torrus ticketing system (see the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Torrus_Installation">integrated networking monitoring system installation instructions</a>).',
+    'type'        => 'select',
+    #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
+    'select_enum' => [ '', qw(Torrus_Internal) ],
+  },
+
+  {
     'key'         => 'ticket_system-default_queueid',
     'section'     => '',
     'description' => 'Default queue used when creating new customer tickets.',
@@ -2103,7 +2514,12 @@ worry that config_items is freeside-specific and icky.
                            }
                          },
   },
-
+  {
+    'key'         => 'ticket_system-force_default_queueid',
+    'section'     => '',
+    'description' => 'Disallow queue selection when creating new tickets from customer view.',
+    'type'        => 'checkbox',
+  },
   {
     'key'         => 'ticket_system-selfservice_queueid',
     'section'     => '',
@@ -2161,6 +2577,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'ticket_system-escalation',
+    'section'     => '',
+    'description' => 'Enable priority escalation of tickets as part of daily batch processing.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'ticket_system-rt_external_datasrc',
     'section'     => '',
     '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>',
@@ -2215,7 +2638,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'address1-search',
     'section'     => 'UI',
-    'description' => 'Enable the ability to search the address1 field from customer search.',
+    'description' => 'Enable the ability to search the address1 field from the quick customer search.  Not recommended in most cases as it tends to bring up too many search results - use explicit address searching from the advanced customer search instead.',
     'type'        => 'checkbox',
   },
 
@@ -2363,6 +2786,27 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'cust_pkg-group_by_location',
+    'section'     => 'UI',
+    'description' => "Group packages by location.",
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_pkg-show_fcc_voice_grade_equivalent',
+    'section'     => 'UI',
+    'description' => "Show a field on package definitions for assigning a DSO equivalency number suitable for use on FCC form 477.",
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_pkg-large_pkg_size',
+    'section'     => 'UI',
+    'description' => "In customer view, summarize packages with more than this many services.  Set to zero to never summarize packages.",
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'svc_acct-edit_uid',
     'section'     => 'shell',
     'description' => 'Allow UID editing.',
@@ -2392,33 +2836,40 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'voip-cust_cdr_spools',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'Enable the per-customer option for individual CDR spools.',
     'type'        => 'checkbox',
   },
 
   {
     'key'         => 'voip-cust_cdr_squelch',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'Enable the per-customer option for not printing CDR on invoices.',
     'type'        => 'checkbox',
   },
 
   {
     'key'         => 'voip-cdr_email',
-    'section'     => '',
-    'description' => 'Include the call details on emailed invoices even if the customer is configured for not printing them on the invoices.',
+    'section'     => 'telephony',
+    'description' => 'Include the call details on emailed invoices (and HTML invoices viewed in the backend), even if the customer is configured for not printing them on the invoices.',
     'type'        => 'checkbox',
   },
 
   {
     'key'         => 'voip-cust_email_csv_cdr',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'Enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
     'type'        => 'checkbox',
   },
 
   {
+    'key'         => 'cgp_rule-domain_templates',
+    'section'     => '',
+    'description' => 'Communigate Pro rule templates for domains, one per line, "svcnum Name"',
+    'type'        => 'textarea',
+  },
+
+  {
     'key'         => 'svc_forward-no_srcsvc',
     'section'     => '',
     'description' => "Don't allow forwards from existing accounts, only arbitrary addresses.  Useful when exporting to systems such as Communigate Pro which treat forwards in this fashion.",
@@ -2442,7 +2893,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'tax-pkg_address',
     'section'     => 'billing',
-    '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.',
+    '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).',
     'type'        => 'checkbox',
   },
 
@@ -2586,6 +3037,20 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'batchconfig-td_eft1464',
+    'section'     => 'billing',
+    'description' => 'Configuration for TD Bank EFT1464 batching, five lines: 1. Originator ID, 2. Datacenter Code, 3. Short name, 4. Long name, 5. Returned payment branch number, 6. Returned payment account, 7. Transaction code.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'batch-manual_approval',
+    'section'     => 'billing',
+    'description' => 'Allow manual batch closure, which will approve all payments that do not yet have a status.  This is not advised, but is needed for payment processors that provide a report of rejected rather than approved payments.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'payment_history-years',
     'section'     => 'UI',
     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',
@@ -2713,8 +3178,15 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'impending_recur_msgnum',
+    'section'     => 'notification',
+    'description' => 'Template to use for alerts about first-time recurring billing.',
+    %msg_template_options,
+  },
+
+  {
     'key'         => 'impending_recur_template',
-    'section'     => 'billing',
+    'section'     => 'deprecated',
     '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>',
 # <li><code>$payby</code> <li><code>$expdate</code> most likely only confuse
     'type'        => 'textarea',
@@ -2881,12 +3353,33 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'prepayment_discounts-credit_type',
+    'section'     => 'billing',
+    'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
+    'type'        => 'select-sub',
+    'options_sub' => sub { require FS::Record;
+                           require FS::reason_type;
+                           map { $_->typenum => $_->type }
+                               FS::Record::qsearch('reason_type', { class=>'R' } );
+                         },
+    'option_sub'  => sub { require FS::Record;
+                           require FS::reason_type;
+                           my $reason_type = FS::Record::qsearchs(
+                             'reason_type', { 'typenum' => shift }
+                           );
+                           $reason_type ? $reason_type->type : '';
+                         },
+
+  },
+
+  {
     'key'         => 'cust_main-agent_custid-format',
     'section'     => '',
     'description' => 'Enables searching of various formatted values in cust_main.agent_custid',
     'type'        => 'select',
     'select_hash' => [
                        ''      => 'Numeric only',
+                       '\d{7}' => 'Numeric only, exactly 7 digits',
                        'ww?d+' => 'Numeric with one or two letter prefix',
                      ],
   },
@@ -2911,11 +3404,18 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'disable_previous_balance',
     'section'     => 'invoicing',
-    'description' => 'Disable inclusion of previous balancem payment, and credit lines on invoices',
+    'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices',
     'type'        => 'checkbox',
   },
 
   {
+    'key'         => 'previous_balance-exclude_from_total',
+    'section'     => 'invoicing',
+    'description' => 'Do not include previous balance in the \'Total\' line.  Only meaningful when invoice_sections is false.  Optionally provide text to override the Total New Charges description',
+    'type'        => [ qw(checkbox text) ],
+  },
+
+  {
     'key'         => 'previous_balance-summary_only',
     'section'     => 'invoicing',
     'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
@@ -2923,6 +3423,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'balance_due_below_line',
+    'section'     => 'invoicing',
+    'description' => 'Place the balance due message below a line.  Only meaningful when when invoice_sections is false.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'usps_webtools-userid',
     'section'     => 'UI',
     '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.',
@@ -2955,7 +3462,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'UI',
     'description' => 'The year to use in census tract lookups',
     'type'        => 'select',
-    'select_enum' => [ qw( 2009 2008 2007 2006 ) ],
+    'select_enum' => [ qw( 2010 2009 2008 ) ],
   },
 
   {
@@ -2980,6 +3487,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'disable_settings_changes',
+    'section'     => '',
+    'description' => 'Disable all settings changes, for demos, except for the usernames given in the comma-separated list.',
+    'type'        => [qw( checkbox text )],
+  },
+
+  {
     'key'         => 'cust_main-edit_agent_custid',
     'section'     => 'UI',
     'description' => 'Enable editing of the agent_custid field.',
@@ -2994,6 +3508,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'cust_main-title-display_custnum',
+    'section'     => 'UI',
+    'description' => 'Add the display_custom (agent_custid or custnum) to the title on customer view pages.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'cust_bill-default_agent_invid',
     'section'     => 'UI',
     'description' => 'Display the agent_invid field when available instead of the invnum field.',
@@ -3018,6 +3539,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'order_pkg-no_start_date',
+    'section'     => 'UI',
+    'description' => 'Don\'t set a default start date for new packages.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'mcp_svcpart',
     'section'     => '',
     'description' => 'Master Control Program svcpart.  Leave this blank.',
@@ -3285,26 +3813,40 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'svc_phone-radius-default_password',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'Default password when exporting svc_phone records to RADIUS',
     'type'        => 'text',
   },
 
   {
     'key'         => 'svc_phone-allow_alpha_phonenum',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'Allow letters in phone numbers.',
     'type'        => 'checkbox',
   },
 
   {
     'key'         => 'svc_phone-domain',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'Track an optional domain association with each phone service.',
     'type'        => 'checkbox',
   },
 
   {
+    'key'         => 'svc_phone-phone_name-max_length',
+    'section'     => 'telephony',
+    'description' => 'Maximum length of the phone service "Name" field (svc_phone.phone_name).  Sometimes useful to limit this (to 15?) when exporting as Caller ID data.',
+    'type'        => 'text',
+  },
+  
+  {
+    'key'         => 'svc_phone-lnp',
+    'section'     => 'telephony',
+    'description' => 'Enables Number Portability features for svc_phone',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'default_phone_countrycode',
     'section'     => '',
     'description' => 'Default countrcode',
@@ -3312,15 +3854,31 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'cdr-charged_party-field',
+    'section'     => 'telephony',
+    'description' => 'Set the charged_party field of CDRs to this field.',
+    'type'        => 'select-sub',
+    'options_sub' => sub { my $fields = FS::cdr->table_info->{'fields'};
+                           map { $_ => $fields->{$_}||$_ }
+                           grep { $_ !~ /^(acctid|charged_party)$/ }
+                           FS::Schema::dbdef->table('cdr')->columns;
+                         },
+    'option_sub'  => sub { my $f = shift;
+                           FS::cdr->table_info->{'fields'}{$f} || $f;
+                         },
+  },
+
+  #probably deprecate in favor of cdr-charged_party-field above
+  {
     'key'         => 'cdr-charged_party-accountcode',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'Set the charged_party field of CDRs to the accountcode.',
     'type'        => 'checkbox',
   },
 
   {
     'key'         => 'cdr-charged_party-accountcode-trim_leading_0s',
-    'section'     => '',
+    'section'     => 'telephony',
     'description' => 'When setting the charged_party field of CDRs to the accountcode, trim any leading zeros.',
     'type'        => 'checkbox',
   },
@@ -3341,7 +3899,7 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'cdr-charged_party_rewrite',
-    'section'     => '',
+    'section'     => 'telephony',
     '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*.',
     'type'        => 'checkbox',
   },
@@ -3362,7 +3920,7 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'cdr-asterisk_forward_rewrite',
-    'section'     => '',
+    'section'     => 'telephony',
     '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").',
     'type'        => 'checkbox',
   },
@@ -3396,6 +3954,14 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'mc-outbound_packages',
+    'section'     => '',
+    'description' => "Don't use this.",
+    'type'        => 'select-part_pkg',
+    'multiple'    => 1,
+  },
+
+  {
     'key'         => 'disable-cust-pkg_class',
     'section'     => 'UI',
     'description' => 'Disable the two-step dropdown for selecting package class and package, and return to the classic single dropdown.',
@@ -3561,6 +4127,164 @@ worry that config_items is freeside-specific and icky.
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'enable_legacy_prepaid_income',
+    'section'     => '',
+    'description' => "Enable legacy prepaid income reporting.  Only useful when you have imported pre-Freeside packages with longer-than-monthly duration, and need to do prepaid income reporting on them before they've been invoiced the first time.",
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_main-exports',
+    'section'     => '',
+    'description' => 'Export(s) to call on cust_main insert, modification and deletion.',
+    'type'        => 'select-sub',
+    'multiple'    => 1,
+    'options_sub' => sub {
+      require FS::Record;
+      require FS::part_export;
+      my @part_export =
+        map { qsearch( 'part_export', {exporttype => $_ } ) }
+          keys %{FS::part_export::export_info('cust_main')};
+      map { $_->exportnum => $_->exporttype.' to '.$_->machine } @part_export;
+    },
+    'option_sub'  => sub {
+      require FS::Record;
+      require FS::part_export;
+      my $part_export = FS::Record::qsearchs(
+        'part_export', { 'exportnum' => shift }
+      );
+      $part_export
+        ? $part_export->exporttype.' to '.$part_export->machine
+        : '';
+    },
+  },
+
+  {
+    'key'         => 'cust_tag-location',
+    'section'     => 'UI',
+    'description' => 'Location where customer tags are displayed.',
+    'type'        => 'select',
+    'select_enum' => [ 'misc_info', 'top' ],
+  },
+
+  {
+    'key'         => 'maestro-status_test',
+    'section'     => 'UI',
+    'description' => 'Display a link to the maestro status test page on the customer view page',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_main-custom_link',
+    'section'     => 'UI',
+    'description' => 'URL to use as source for the "Custom" tab in the View Customer page.  The custnum will be appended.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_main-custom_title',
+    'section'     => 'UI',
+    'description' => 'Title for the "Custom" tab in the View Customer page.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'part_pkg-default_suspend_bill',
+    'section'     => 'billing',
+    'description' => 'Default the "Continue recurring billing while suspended" flag to on for new package definitions.',
+    'type'        => 'checkbox',
+  },
+  
+  {
+    'key'         => 'qual-alt-address-format',
+    'section'     => 'UI',
+    'description' => 'Enable the alternate address format (location type, number, and kind) on qualifications',
+    'type'        => 'checkbox',
+  },
+  
+  {
+    'key'         => 'note-classes',
+    'section'     => 'UI',
+    'description' => 'Use customer note classes',
+    'type'        => 'select',
+    'select_hash' => [
+                       0 => 'Disabled',
+                      1 => 'Enabled',
+                      2 => 'Enabled, with tabs',
+                    ],
+  },
+
+  {
+    'key'         => 'svc_acct-cf_privatekey-message',
+    'section'     => '',
+    'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'menu-prepend_links',
+    'section'     => 'UI',
+    'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'cust_main-external_links',
+    'section'     => 'UI',
+    'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)".  The URL will have custnum appended.',
+    'type'        => 'textarea',
+  },
+  
+  {
+    'key'         => 'svc_phone-did-summary',
+    'section'     => 'invoicing',
+    'description' => 'Enable DID activity summary for past 30 days on invoices, showing # DIDs activated/deactivated/ported-in/ported-out and total minutes usage',
+    'type'        => 'checkbox',
+  },
+  
+  {
+    'key'         => 'opensips_gwlist',
+    'section'     => 'telephony',
+    'description' => 'For svc_phone OpenSIPS dr_rules export, gwlist column value, per-agent',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'agentonly'   => 1,
+  },
+
+  {
+    'key'         => 'opensips_description',
+    'section'     => 'telephony',
+    'description' => 'For svc_phone OpenSIPS dr_rules export, description column value, per-agent',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'agentonly'   => 1,
+  },
+  
+  {
+    'key'         => 'opensips_route',
+    'section'     => 'telephony',
+    'description' => 'For svc_phone OpenSIPS dr_rules export, routeid column value, per-agent',
+    'type'        => 'text',
+    'per_agent'   => 1,
+    'agentonly'   => 1,
+  },
+
+  {
+    'key'         => 'cust_bill-no_recipients-error',
+    'section'     => 'invoicing',
+    'description' => 'For customers with no invoice recipients, throw a job queue error rather than the default behavior of emailing the invoice to the invoice_from address.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_main-status_module',
+    'section'     => 'UI',
+    'description' => 'Which module to use for customer status display.  The "Classic" module (the default) considers accounts with cancelled recurring packages but un-cancelled one-time charges Inactive.  The "Recurring" module considers those customers Cancelled.  Similarly for customers with suspended recurring packages but one-time charges.', #other differences?
+    'type'        => 'select',
+    'select_enum' => [ 'Classic', 'Recurring' ],
+  },
+
   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },