bulk provisioning via ftp and SOAP #5202
[freeside.git] / FS / FS / Conf.pm
index a763ed4..cb53ef7 100644 (file)
@@ -1,12 +1,14 @@
 package FS::Conf;
 
 use vars qw($base_dir @config_items @base_items @card_types $DEBUG);
+use Carp;
 use IO::File;
 use File::Basename;
 use MIME::Base64;
 use FS::ConfItem;
 use FS::ConfDefaults;
 use FS::Conf_compat17;
+use FS::payby;
 use FS::conf;
 use FS::Record qw(qsearch qsearchs);
 use FS::UID qw(dbh datasrc use_confcompat);
@@ -84,19 +86,20 @@ global default if one is present.
 
 sub _usecompat {
   my ($self, $method) = (shift, shift);
-  warn "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
+  carp "NO CONFIGURATION RECORDS FOUND -- USING COMPATIBILITY MODE"
     if use_confcompat;
   my $compat = new FS::Conf_compat17 ("$base_dir/conf." . datasrc);
   $compat->$method(@_);
 }
 
+# needs a non _ name, called externally by config-view now (and elsewhere?)
 sub _config {
   my($self,$name,$agentnum)=@_;
   my $hashref = { 'name' => $name };
   $hashref->{agentnum} = $agentnum;
   local $FS::Record::conf = undef;  # XXX evil hack prevents recursion
   my $cv = FS::Record::qsearchs('conf', $hashref);
-  if (!$cv && defined($agentnum)) {
+  if (!$cv && defined($agentnum) && $agentnum) {
     $hashref->{agentnum} = '';
     $cv = FS::Record::qsearchs('conf', $hashref);
   }
@@ -107,7 +110,11 @@ sub config {
   my $self = shift;
   return $self->_usecompat('config', @_) if use_confcompat;
 
-  my($name,$agentnum)=@_;
+  my($name, $agentnum)=@_;
+
+  carp "FS::Conf->config($name, $agentnum) called"
+    if $DEBUG > 1;
+
   my $cv = $self->_config($name, $agentnum) or return;
 
   if ( wantarray ) {
@@ -145,16 +152,20 @@ sub exists {
   my $self = shift;
   return $self->_usecompat('exists', @_) if use_confcompat;
 
-  my($name,$agentnum)=@_;
+  my($name, $agentnum)=@_;
+
+  carp "FS::Conf->exists($name, $agentnum) called"
+    if $DEBUG > 1;
+
   defined($self->_config($name, $agentnum));
 }
 
-#=item config_orbase KEY SUFFIX
-#
-#Returns the configuration value or values (depending on context) for 
-#KEY_SUFFIX, if it exists, otherwise for KEY
-#
-#=cut
+=item config_orbase KEY SUFFIX
+
+Returns the configuration value or values (depending on context) for 
+KEY_SUFFIX, if it exists, otherwise for KEY
+
+=cut
 
 # outmoded as soon as we shift to agentnum based config values
 # well, mostly.  still useful for e.g. late notices, etc. in that we want
@@ -171,6 +182,26 @@ sub config_orbase {
   }
 }
 
+=item key_orbase KEY SUFFIX
+
+If the config value KEY_SUFFIX exists, returns KEY_SUFFIX, otherwise returns
+KEY.  Useful for determining which exact configuration option is returned by
+config_orbase.
+
+=cut
+
+sub key_orbase {
+  my $self = shift;
+  #no compat for this...return $self->_usecompat('config_orbase', @_) if use_confcompat;
+
+  my( $name, $suffix ) = @_;
+  if ( $self->exists("${name}_$suffix") ) {
+    "${name}_$suffix";
+  } else {
+    $name;
+  }
+}
+
 =item invoice_templatenames
 
 Returns all possible invoice template names.
@@ -305,7 +336,7 @@ sub import_config_item {
     warn "Inserting $key\n" if $DEBUG;
     local $/;
     my $value = readline(new IO::File "$dir/$key");
-    if ($item->type eq 'binary') {
+    if ($item->type =~ /^(binary|image)$/ ) {
       $self->set_binary($key, $value);
     }else{
       $self->set($key, $value);
@@ -334,7 +365,8 @@ sub verify_config_item {
   $error .= "$key fails existential comparison; "
     if $self->exists($key) xor $compat->exists($key);
 
-  unless ($type eq 'binary') {
+  if ( $type !~ /^(binary|image)$/ ) {
+
     {
       no warnings;
       $error .= "$key fails scalar comparison; "
@@ -351,22 +383,24 @@ sub verify_config_item {
       $error .= "$key fails list comparison; "
         unless $r;
     }
-  }
 
-  if ($type eq 'binary') {
+  } else {
+
     $error .= "$key fails binary comparison; "
       unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
-  }
 
-  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
-    my $proto;
-    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
-    unless ($proto->key eq $key) { 
-      warn "removed config item $error\n" if $DEBUG;
-      $error = '';
-    }
   }
 
+#remove deprecated config on our own terms, not freeside-upgrade's
+#  if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
+#    my $proto;
+#    for ( @config_items ) { $proto = $_; last if $proto->key eq $key;  }
+#    unless ($proto->key eq $key) { 
+#      warn "removed config item $error\n" if $DEBUG;
+#      $error = '';
+#    }
+#  }
+
   $error;
 }
 
@@ -418,11 +452,12 @@ sub _orbase_items {
           die "don't know about $base items" unless $proto->key eq $base;
 
           map { new FS::ConfItem { 
-                                   'key' => $_,
-                                   'section' => $proto->section,
-                                   'description' => 'Alternate ' . $proto->description . '  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
-                                   'type' => $proto->type,
-                                 };
+                  '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.',
+                  'type'        => $proto->type,
+                };
               } &$listmaker($base);
         } @base_items,
   );
@@ -450,7 +485,7 @@ sub config_items {
 
 =item init-config DIR
 
-Imports the non-deprecated configuration items from DIR (1.7 compatible)
+Imports the configuration items from DIR (1.7 compatible)
 to conf records in the database.
 
 =cut
@@ -512,21 +547,7 @@ worry that config_items is freeside-specific and icky.
                    invoice_latexfooter
                    invoice_latexsmallfooter
                    invoice_latexnotes
-                   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
@@ -547,14 +568,18 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'alerter_template',
     'section'     => 'billing',
-    'description' => 'Template file for billing method expiration alerts.  See the <a href="http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation:Administration#Credit_cards_and_Electronic_checks">billing documentation</a> for details.',
+    '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.',
     'type'        => 'textarea',
+    'per-agent'   => 1,
   },
 
   {
     'key'         => 'apacheip',
-    'section'     => 'deprecated',
-    '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',
+    #not actually deprecated yet
+    #'section'     => 'deprecated',
+    #'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',
+    'section'     => '',
+    'description' => 'IP address to assign to new virtual hosts',
     'type'        => 'text',
   },
 
@@ -601,6 +626,17 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'business-onlinepayment-namespace',
+    'section'     => 'billing',
+    'description' => 'Specifies which perl module namespace (which group of collection routines) is used by default.',
+    'type'        => 'select',
+    'select_hash' => [
+                       'Business::OnlinePayment' => 'Direct API (Business::OnlinePayment)',
+                      'Business::OnlineThirdPartyPayment' => 'Web API (Business::ThirdPartyPayment)',
+                     ],
+  },
+
+  {
     'key'         => 'business-onlinepayment-description',
     'section'     => 'billing',
     'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>.  Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages for which these charges apply)',
@@ -655,8 +691,11 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'deletecredits',
-    'section'     => 'deprecated',
-    '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.',
+    #not actually deprecated yet
+    #'section'     => 'deprecated',
+    #'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.',
+    'section'     => '',
+    'description' => 'One or more comma-separated email addresses to be notified when a credit is deleted.',
     'type'        => [qw( checkbox text )],
   },
 
@@ -724,6 +763,13 @@ worry that config_items is freeside-specific and icky.
   },
   
   {
+    'key'         => 'auto_router',
+    'section'     => '',
+    'description' => 'Automatically choose the correct router/block based on supplied ip address when possible while provisioning broadband services',
+    'type'        => 'checkbox',
+  },
+  
+  {
     'key'         => 'hidecancelledpackages',
     'section'     => 'UI',
     'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
@@ -749,19 +795,28 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'required',
     'description' => 'Return address on email invoices',
     'type'        => 'text',
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'invoice_subject',
+    'section'     => 'billing',
+    'description' => 'Subject: header on email invoices.  Defaults to "Invoice".  The following substitutions are available: $name, $name_short, $invoice_number, and $invoice_date.',
+    'type'        => 'text',
+    'per_agent'   => 1,
   },
 
   {
     'key'         => 'invoice_template',
     'section'     => 'billing',
-    '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.sisd.com/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:1.7:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
     'type'        => 'textarea',
   },
 
   {
     'key'         => 'invoice_html',
     'section'     => 'billing',
-    'description' => 'Optional HTML template for invoices.  See the <a href="http://www.sisd.com/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:1.7:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
 
     'type'        => 'textarea',
   },
@@ -771,6 +826,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -778,6 +834,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -790,7 +847,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'invoice_latex',
     'section'     => 'billing',
-    'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.sisd.com/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:1.7:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
     'type'        => 'textarea',
   },
 
@@ -799,6 +856,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     'description' => 'Notes section for LaTeX typeset PostScript invoices.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -806,6 +864,15 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     'description' => 'Footer for LaTeX typeset PostScript invoices.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'invoice_latexcoupon',
+    'section'     => 'billing',
+    'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
+    'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -820,6 +887,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -842,20 +910,27 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     '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 30', 'Net 45', 'Net 60' ],
+    'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 30', 'Net 45', 'Net 60' ],
   },
 
   { 
     'key'         => 'invoice_sections',
     'section'     => 'billing',
-    'description' => 'Split invoice into sections and label according to package type when enabled.',
+    'description' => 'Split invoice into sections and label according to package class when enabled.',
+    'type'        => 'checkbox',
+  },
+
+  { 
+    'key'         => 'separate_usage',
+    'section'     => 'billing',
+    'description' => 'Split the rated call usage into a separate line from the recurring charges.',
     'type'        => 'checkbox',
   },
 
   {
     '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/~mjd/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <ul><li><code>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance</ul>',
+    'description' => 'Template file for payment receipts.  Payment receipts are sent to the customer email invoice destination(s) when a payment is received.  See the <a href="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <ul><li><code>$date</code> <li><code>$name</code> <li><code>$paynum</code> - Freeside payment number <li><code>$paid</code> - Amount of payment <li><code>$payby</code> - Payment type (Card, Check, Electronic check, etc.) <li><code>$payinfo</code> - Masked credit card number or check number <li><code>$balance</code> - New balance</ul>',
     'type'        => [qw( checkbox textarea )],
   },
 
@@ -978,7 +1053,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'signupurl',
     'section'     => 'UI',
-    'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="http://www.sisd.com/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: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',
     'type'        => 'text',
   },
 
@@ -1078,6 +1153,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'username',
     'description' => 'Usernames must contain at least one letter',
     'type'        => 'checkbox',
+    'per_agent'   => 1,
   },
 
   {
@@ -1122,6 +1198,13 @@ worry that config_items is freeside-specific and icky.
     'type'        => 'checkbox',
   },
 
+  { 
+    'key'         => 'username-colon',
+    'section'     => 'username',
+    'description' => 'Allow the colon character (:) in usernames.',
+    'type'        => 'checkbox',
+  },
+
   {
     'key'         => 'safe-part_bill_event',
     'section'     => 'UI',
@@ -1243,7 +1326,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'signup_server-default_pkgpart',
     'section'     => '',
-    'description' => 'Default pakcage for the signup server',
+    'description' => 'Default package for the signup server',
     'type'        => 'select-sub',
     'options_sub' => sub { require FS::Record;
                            require FS::part_pkg;
@@ -1264,6 +1347,45 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'signup_server-default_svcpart',
+    'section'     => '',
+    'description' => 'Default svcpart for the signup server - only necessary for services that trigger special provisioning widgets (such as DID provisioning).',
+    'type'        => 'select-sub',
+    'options_sub' => sub { require FS::Record;
+                           require FS::part_svc;
+                           map { $_->svcpart => $_->svc }
+                               FS::Record::qsearch( 'part_svc',
+                                                   { 'disabled' => ''}
+                                                 );
+                        },
+    'option_sub'  => sub { require FS::Record;
+                           require FS::part_svc;
+                           my $part_svc = FS::Record::qsearchs(
+                            'part_svc', { 'svcpart'=>shift }
+                          );
+                           $part_svc ? $part_svc->svc : '';
+                        },
+  },
+
+  {
+    'key'         => 'signup_server-service',
+    'section'     => '',
+    'description' => 'Service for the signup server - "Account (svc_acct)" is the default setting, or "Phone number (svc_phone)" for ITSP signup',
+    'type'        => 'select',
+    'select_hash' => [
+                       'svc_acct'  => 'Account (svc_acct)',
+                       'svc_phone' => 'Phone number (svc_phone)',
+                     ],
+  },
+
+  {
+    'key'         => 'selfservice_server-base_url',
+    'section'     => '',
+    '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.',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'show-msgcat-codes',
     'section'     => 'UI',
     'description' => 'Show msgcat codes in error messages.  Turn this option on before reporting errors to the mailing list.',
@@ -1385,9 +1507,30 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'enable_taxproducts',
+    'section'     => 'billing',
+    'description' => 'Enable per-package mapping to vendor tax data from CCH or elsewhere.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'taxdatadirectdownload',
+    'section'     => 'billing',  #well
+    'description' => 'Enable downloading tax data directly from the vendor site',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'ignore_incalculable_taxes',
+    'section'     => 'billing',
+    'description' => 'Prefer to invoice without tax over not billing at all',
+    'type'        => 'checkbox',
+  },
+
+  {
     '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/~mjd/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>',
+    '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>',
     'type'        => 'textarea',
     'per_agent'   => 1,
   },
@@ -1420,14 +1563,14 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'welcome_letter',
     'section'     => '',
-    '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/~mjd/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>',
+    '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>',
     'type'        => 'textarea',
   },
 
   {
     'key'         => 'warning_email',
     'section'     => '',
-    '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/~mjd/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>',
+    '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',
   },
 
@@ -1478,8 +1621,8 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'paymentforcedtobatch',
-    'section'     => 'UI',
-    'description' => 'Causes per customer payment entry to be forced to a batch processor rather than performed realtime.',
+    'section'     => 'deprecated',
+    '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.',
     'type'        => 'checkbox',
   },
 
@@ -1528,6 +1671,24 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'credit_card-recurring_billing_flag',
+    'section'     => 'billing',
+    '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. ',
+    'type'        => 'select',
+    'select_hash' => [
+                       'actual_oncard' => 'Default/classic behavior: set the flag if a customer has actual previous charges on the card.',
+                      'transaction_is_recur' => 'Set the flag if the transaction itself is recurring, irregardless of previous charges on the card.',
+                     ],
+  },
+
+  {
+    'key'         => 'credit_card-recurring_billing_acct_code',
+    'section'     => 'billing',
+    'description' => 'When the "recurring billing" flag is set, also set the "acct_code" to "rebill".  Useful for reporting purposes with supported gateways (PlugNPay, others?)',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'cvv-save',
     'section'     => 'billing',
     '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.',
@@ -1591,6 +1752,20 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'selfservice_server-phone_login',
+    'section'     => '',
+    'description' => 'Allow login to self-service with phone number and PIN.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'selfservice_server-single_domain',
+    'section'     => '',
+    'description' => 'If specified, only use this one domain for self-service access.',
+    'type'        => 'text',
+  },
+
+  {
     '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.',
@@ -1613,6 +1788,14 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'global_unique-phonenum',
+    'section'     => '',
+    '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.',
+    'type'        => 'select',
+    'select_enum' => [ 'none', 'countrycode+phonenum', '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).',
@@ -1630,7 +1813,7 @@ 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.sisd.com/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: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).',
     'type'        => 'select',
     #'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
     'select_enum' => [ '', qw(RT_Internal RT_External) ],
@@ -1711,6 +1894,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'required',
     'description' => 'Your company name',
     'type'        => 'text',
+    'per_agent'   => 1, #XXX just FS/FS/ClientAPI/Signup.pm
   },
 
   {
@@ -1718,6 +1902,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'required',
     'description' => 'Your company address',
     'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -1734,9 +1919,16 @@ worry that config_items is freeside-specific and icky.
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'agent-ship_address',
+    'section'     => '',
+    '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.",
+    'type'        => 'checkbox',
+  },
+
   { 'key'         => 'referral_credit',
-    'section'     => 'billing',
-    'description' => "Enables one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).",
+    'section'     => 'deprecated',
+    '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.",
     'type'        => 'checkbox',
   },
 
@@ -1749,12 +1941,63 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'hylafax',
-    'section'     => '',
+    'section'     => 'billing',
     '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).',
     'type'        => [qw( checkbox textarea )],
   },
 
   {
+    'key'         => 'cust_bill-ftpformat',
+    'section'     => 'billing',
+    'description' => 'Enable FTP of raw invoice data - format.',
+    'type'        => 'select',
+    'select_enum' => [ '', 'default', 'billco', ],
+  },
+
+  {
+    'key'         => 'cust_bill-ftpserver',
+    'section'     => 'billing',
+    'description' => 'Enable FTP of raw invoice data - server.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_bill-ftpusername',
+    'section'     => 'billing',
+    'description' => 'Enable FTP of raw invoice data - server.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_bill-ftppassword',
+    'section'     => 'billing',
+    'description' => 'Enable FTP of raw invoice data - server.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_bill-ftpdir',
+    'section'     => 'billing',
+    'description' => 'Enable FTP of raw invoice data - server.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_bill-spoolformat',
+    'section'     => 'billing',
+    'description' => 'Enable spooling of raw invoice data - format.',
+    'type'        => 'select',
+    'select_enum' => [ '', 'default', 'billco', ],
+  },
+
+  {
+    'key'         => 'cust_bill-spoolagent',
+    'section'     => 'billing',
+    'description' => 'Enable per-agent spooling of raw invoice data.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'svc_acct-usage_suspend',
     'section'     => 'billing',
     '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.',
@@ -1791,6 +2034,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'cust_pkg-always_show_location',
+    'section'     => 'UI',
+    'description' => "Always display package locations, even when they're all the default service address.",
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'svc_acct-edit_uid',
     'section'     => 'shell',
     'description' => 'Allow UID editing.',
@@ -1826,6 +2076,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'voip-cust_cdr_squelch',
+    'section'     => '',
+    'description' => 'Enable the per-customer option for not printing CDR on invoices.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'svc_forward-arbitrary_dst',
     'section'     => '',
     '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.",
@@ -1835,18 +2092,82 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'tax-ship_address',
     'section'     => 'billing',
-    'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.  Note: Tax reports can take a long time when enabled.',
+    'description' => 'By default, tax calculations are done based on the billing address.  Enable this switch to calculate tax based on the shipping address instead.',
+    'type'        => 'checkbox',
+  }
+,
+  {
+    '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.',
     'type'        => 'checkbox',
   },
 
   {
-    'key'         => 'batch-enable',
+    'key'         => 'invoice-ship_address',
+    'section'     => 'billing',
+    'description' => 'Enable this switch to include the ship address on the invoice.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'invoice-unitprice',
+    'section'     => 'billing',
+    'description' => 'This switch enables unit pricing on the invoice.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'postal_invoice-fee_pkgpart',
+    'section'     => 'billing',
+    'description' => 'This allows selection of a package to insert on invoices for customers with postal invoices selected.',
+    'type'        => 'select-sub',
+    'options_sub' => sub { require FS::Record;
+                           require FS::part_pkg;
+                          map { $_->pkgpart => $_->pkg }
+                               FS::Record::qsearch('part_pkg', { disabled=>'' } );
+                        },
+    'option_sub'  => sub { require FS::Record;
+                           require FS::part_pkg;
+                          my $part_pkg = FS::Record::qsearchs(
+                            'part_pkg', { 'pkgpart'=>shift }
+                          );
+                           $part_pkg ? $part_pkg->pkg : '';
+                        },
+  },
+
+  {
+    'key'         => 'postal_invoice-recurring_only',
     'section'     => 'billing',
+    'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'batch-enable',
+    'section'     => 'deprecated', #make sure batch-enable_payby is set for
+                                   #everyone before removing
     'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.',
     'type'        => 'checkbox',
   },
 
   {
+    'key'         => 'batch-enable_payby',
+    'section'     => 'billing',
+    'description' => 'Enable batch processing for the specified payment types.',
+    'type'        => 'selectmultiple',
+    'select_enum' => [qw( CARD CHEK )],
+  },
+
+  {
+    'key'         => 'realtime-disable_payby',
+    'section'     => 'billing',
+    'description' => 'Disable realtime processing for the specified payment types.',
+    'type'        => 'selectmultiple',
+    'select_enum' => [qw( CARD CHEK )],
+  },
+
+  {
     'key'         => 'batch-default_format',
     'section'     => 'billing',
     'description' => 'Default format for batches.',
@@ -1912,6 +2233,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    'key'         => 'cust_main-packages-years',
+    'section'     => 'UI',
+    'description' => 'Number of years to show old (cancelled and one-time charge) packages by default.  Currently defaults to 2.',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'cust_main-use_comments',
     'section'     => 'UI',
     'description' => 'Display free form comments on the customer edit screen.  Useful as a scratch pad.',
@@ -2012,7 +2340,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'impending_recur_template',
     'section'     => 'billing',
-    'description' => 'Template file for alerts about looming first time recurrant billing.  See the <a href="http://search.cpan.org/~mjd/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>',
+    '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',
   },
@@ -2020,15 +2348,18 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'logo.png',
     'section'     => 'billing',  #? 
-    'description' => 'An image to include in some types of invoices',
-    'type'        => 'binary',
+    'description' => 'Company logo for HTML invoices and the backoffice interface, in PNG format.  Suggested size somewhere near 92x62.',
+    'type'        => 'image',
+    'per_agent'   => 1, #XXX just view/logo.cgi, which is for the global
+                        #old-style editor anyway...?
   },
 
   {
     'key'         => 'logo.eps',
     'section'     => 'billing',  #? 
-    'description' => 'An image to include in some types of invoices',
-    'type'        => 'binary',
+    'description' => 'Company logo for printed and PDF invoices, in EPS format.',
+    'type'        => 'image',
+    'per_agent'   => 1, #XXX as above, kinda
   },
 
   {
@@ -2098,7 +2429,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'cust_main-require_phone',
     'section'     => '',
-    'description' => 'Require daytime or night for all customer records.',
+    'description' => 'Require daytime or night phone for all customer records.',
     'type'        => 'checkbox',
   },
 
@@ -2137,8 +2468,8 @@ worry that config_items is freeside-specific and icky.
 
   {
     'key'         => 'referral_credit_type',
-    'section'     => 'billing',
-    'description' => 'The group to use for new, automatically generated credit reasons resulting from referrals.',
+    'section'     => 'deprecated',
+    '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.',
     'type'        => 'select-sub',
     'options_sub' => sub { require FS::Record;
                            require FS::reason_type;
@@ -2187,7 +2518,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'card_masking_method',
     'section'     => 'UI',
-    '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.',
+    '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.',
     'type'        => 'select',
     'select_hash' => [
                        ''            => '123456xxxxxx1234',
@@ -2201,6 +2532,302 @@ worry that config_items is freeside-specific and icky.
                      ],
   },
 
+  {
+    'key'         => 'disable_previous_balance',
+    'section'     => 'billing',
+    'description' => 'Disable inclusion of previous balancem payment, and credit lines on invoices',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'previous_balance-summary_only',
+    'section'     => 'billing',
+    'description' => 'Only show a single line summarizing the total previous balance rather than one line per invoice.',
+    '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.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'usps_webtools-password',
+    'section'     => 'UI',
+    '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.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_main-auto_standardize_address',
+    'section'     => 'UI',
+    'description' => 'When using USPS web tools, automatically standardize the address without asking.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'disable_acl_changes',
+    'section'     => '',
+    'description' => 'Disable all ACL changes, for demos.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_main-edit_agent_custid',
+    'section'     => 'UI',
+    'description' => 'Enable editing of the agent_custid field.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_main-default_agent_custid',
+    'section'     => 'UI',
+    'description' => 'Display the agent_custid field instead of the custnum field.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust_main-auto_agent_custid',
+    'section'     => 'UI',
+    'description' => 'Automatically assign an agent_custid - select format',
+    'type'        => 'select',
+    'select_hash' => [ '' => 'No',
+                       '1YMMXXXXXXXX' => '1YMMXXXXXXXX',
+                     ],
+  },
+
+  {
+    'key'         => 'cust_main-default_areacode',
+    'section'     => 'UI',
+    'description' => 'Default area code for customers.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'mcp_svcpart',
+    'section'     => '',
+    'description' => 'Master Control Program svcpart.  Leave this blank.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_bill-max_same_services',
+    'section'     => 'billing',
+    '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.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'suspend_email_admin',
+    'section'     => '',
+    'description' => 'Destination admin email address to enable suspension notices',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'email_report-subject',
+    'section'     => '',
+    'description' => 'Subject for reports emailed by freeside-fetch.  Defaults to "Freeside report".',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'selfservice-head',
+    'section'     => '',
+    'description' => 'HTML for the HEAD section of the self-service interface, typically used for LINK stylesheet tags',
+    'type'        => 'textarea', #htmlarea?
+  },
+
+
+  {
+    'key'         => 'selfservice-body_header',
+    'section'     => '',
+    'description' => 'HTML header for the self-service interface',
+    'type'        => 'textarea', #htmlarea?
+  },
+
+  {
+    'key'         => 'selfservice-body_footer',
+    'section'     => '',
+    'description' => 'HTML header for the self-service interface',
+    'type'        => 'textarea', #htmlarea?
+  },
+
+
+  {
+    'key'         => 'selfservice-body_bgcolor',
+    'section'     => '',
+    'description' => 'HTML background color for the self-service interface, for example, #FFFFFF',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'selfservice-box_bgcolor',
+    'section'     => '',
+    'description' => 'HTML color for self-service interface input boxes, for example, #C0C0C0"',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'selfservice-bulk_format',
+    'section'     => '',
+    'description' => 'Parameter arrangement for selfservice bulk features',
+    'type'        => 'select',
+    'select_enum' => [ '', 'izoom-soap', 'izoom-ftp' ],
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'selfservice-bulk_ftp_dir',
+    'section'     => '',
+    'description' => 'Enable bulk ftp provisioning in this folder',
+    'type'        => 'text',
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'signup-no_company',
+    'section'     => '',
+    'description' => "Don't display a field for company name on signup.",
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'signup-recommend_email',
+    'section'     => '',
+    'description' => 'Encourage the entry of an invoicing email address on signup.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'signup-recommend_daytime',
+    'section'     => '',
+    'description' => 'Encourage the entry of a daytime phone number  invoicing email address on signup.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'svc_phone-radius-default_password',
+    'section'     => '',
+    'description' => 'Default password when exporting svc_phone records to RADIUS',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'svc_phone-allow_alpha_phonenum',
+    'section'     => '',
+    'description' => 'Allow letters in phone numbers.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'default_phone_countrycode',
+    'section'     => '',
+    'description' => 'Default countrcode',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cdr-charged_party-accountcode',
+    'section'     => '',
+    'description' => 'Set the charged_party field of CDRs to the accountcode.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cdr-charged_party-truncate_prefix',
+    'section'     => '',
+    'description' => 'If the charged_party field has this prefix, truncate it to the length in cdr-charged_party-truncate_length.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cdr-charged_party-truncate_length',
+    'section'     => '',
+    'description' => 'If the charged_party field has the prefix in cdr-charged_party-truncate_prefix, truncate it to this length.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cdr-charged_party_rewrite',
+    'section'     => '',
+    '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',
+  },
+
+  {
+    'key'         => 'cdr-taqua-da_rewrite',
+    'section'     => '',
+    '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.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cust_pkg-show_autosuspend',
+    'section'     => 'UI',
+    'description' => 'Show package auto-suspend dates.  Use with caution for now; can slow down customer view for large insallations.',
+    'type'       => 'checkbox',
+  },
+
+  {
+    'key'         => 'cdr-asterisk_forward_rewrite',
+    'section'     => '',
+    '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',
+  },
+
+  {
+    'key'         => 'sg-multicustomer_hack',
+    'section'     => '',
+    'description' => "Don't use this.",
+    'type'        => 'checkbox',
+  },
+
+  {
+    '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.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'queued-max_kids',
+    'section'     => '',
+    'description' => 'Maximum number of queued processes.  Defaults to 10.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'cancelled_cust-noevents',
+    'section'     => 'billing',
+    'description' => "Don't run events for cancelled customers",
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'agent-invoice_template',
+    'section'     => 'billing',
+    'description' => 'Enable display/edit of old-style per-agent invoice template selection',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'svc_broadband-manage_link',
+    'section'     => 'UI',
+    'description' => 'URL for svc_broadband "Manage Device" link.  The following substitutions are available: $ip_addr.',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'tax-report_groups',
+    'section'     => '',
+    'description' => 'List of grouping possibilities for tax names on reports, one per line, "label op value" (op can be = or !=).',
+    'type'        => 'textarea',
+  },
+
 );
 
 1;
+