Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / FS / FS / Conf.pm
index 10328ce..b750ba5 100644 (file)
@@ -1,7 +1,8 @@
 package FS::Conf;
 
 use strict;
-use vars qw( $base_dir @config_items @base_items @card_types $DEBUG
+use vars qw( $base_dir @config_items @base_items @card_types @invoice_terms
+             $DEBUG
              $conf_cache $conf_cache_enabled
            );
 use Carp;
@@ -510,7 +511,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:2.1: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:3:Documentation:Administration#Invoice_templates">billing documentation</a> for details.',
                   'type'        => $proto->type,
                 };
               } &$listmaker($base);
@@ -616,6 +617,14 @@ logo.png
 logo.eps
 );
 
+@invoice_terms = (
+  '',
+  'Payable upon receipt',
+  'Net 0', 'Net 3', 'Net 5', 'Net 7', 'Net 9', 'Net 10', 'Net 14', 
+  'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 25', 'Net 30', 'Net 45', 
+  'Net 60', 'Net 90'
+);
+
 my %msg_template_options = (
   'type'        => 'select-sub',
   'options_sub' => sub { 
@@ -737,29 +746,6 @@ my $validate_email = sub { $_[0] =~
   },
 
   {
-    'key'         => 'alert_expiration',
-    'section'     => 'deprecated',
-    'description' => 'Enable alerts about credit card expiration.  This is obsolete and no longer works.',
-    'type'        => 'checkbox',
-    'per_agent'   => 1,
-  },
-
-  {
-    'key'         => 'alerter_template',
-    'section'     => 'deprecated',
-    'description' => 'Template file for billing method expiration alerts (i.e. expiring credit cards).',
-    'type'        => 'textarea',
-    'per_agent'   => 1,
-  },
-  
-  {
-    'key'         => 'alerter_msgnum',
-    'section'     => 'deprecated',
-    'description' => 'Template to use for credit card expiration alerts.',
-    %msg_template_options,
-  },
-
-  {
     'key'         => 'part_pkg-lineage',
     'section'     => 'packages',
     'description' => 'When editing a package definition, if setup or recur fees are changed, create a new package rather than changing the existing package.',
@@ -788,6 +774,7 @@ my $validate_email = sub { $_[0] =~
     'section'     => 'credit_cards',
     'description' => 'Add a credit card surcharge to invoices, as a % of the invoice total.  WARNING: Although recently permitted to US merchants in general, specific consumer protection laws may prohibit or restrict this practice in California, Colorado, Connecticut, Florda, Kansas, Maine, Massachusetts, New York, Oklahome, and Texas.  Surcharging is also generally prohibited in most countries outside the US, AU and UK.  When allowed, typically not permitted to be above 4%.',
     'type'        => 'text',
+    'per_agent'   => 1,
   },
 
   {
@@ -972,7 +959,7 @@ my $validate_email = sub { $_[0] =~
     'section'     => 'credit_cards',
     'description' => 'Currency parameter for Business::OnlinePayment transactions.',
     'type'        => 'select',
-    'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD ) ],
+    'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD ARS ) ],
   },
 
   {
@@ -987,7 +974,7 @@ my $validate_email = sub { $_[0] =~
     'section'     => 'localization',
     'description' => 'Main accounting currency',
     'type'        => 'select',
-    'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD XAF ) ],
+    'select_enum' => [ '', qw( USD AUD CAD DKK EUR GBP ILS JPY NZD XAF ARS ) ],
   },
 
   {
@@ -1222,14 +1209,14 @@ my $validate_email = sub { $_[0] =~
   {
     'key'         => 'invoice_template',
     'section'     => 'invoice_templates',
-    '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.',
+    '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:3:Documentation:Administration#Plaintext_invoice_templates">billing documentation</a> for details.',
     'type'        => 'textarea',
   },
 
   {
     'key'         => 'invoice_html',
     'section'     => 'invoice_templates',
-    'description' => 'HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:2.1:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
+    'description' => 'HTML template for invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:3:Documentation:Administration#HTML_invoice_templates">billing documentation</a> for details.',
 
     'type'        => 'textarea',
   },
@@ -1289,7 +1276,7 @@ my $validate_email = sub { $_[0] =~
   {
     'key'         => 'invoice_latex',
     'section'     => 'invoice_templates',
-    '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.',
+    'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:3:Documentation:Administration#Typeset_.28LaTeX.29_invoice_templates">billing documentation</a> for details.',
     'type'        => 'textarea',
   },
 
@@ -1544,11 +1531,8 @@ and customer address. Include units.',
     'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.',
     'type'        => 'select',
     'per_agent'   => 1,
-    'select_enum' => [ 
-      '', 'Payable upon receipt', 'Net 0', 'Net 3', 'Net 5', 'Net 7', 'Net 9', 'Net 10', 'Net 14', 
-      'Net 15', 'Net 18', 'Net 20', 'Net 21', 'Net 25', 'Net 30', 'Net 45', 
-      'Net 60', 'Net 90'
-    ], },
+    'select_enum' => \@invoice_terms,
+  },
 
   { 
     'key'         => 'invoice_show_prior_due_date',
@@ -1838,6 +1822,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'cust_main-packages-num_per_page',
+    'section'     => 'packages',
+    'description' => 'Number of packages to display per page on customer view (default 10).',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'disable_maxselect',
     'section'     => 'reporting',
     'description' => 'Prevent changing the number of records per page.',
@@ -1882,7 +1873,7 @@ and customer address. Include units.',
   {
     'key'         => 'signupurl',
     'section'     => 'signup',
-    '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 self-signup 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:3:Documentation:Self-Service_Installation">signup server CGI</a>, the customer view screen will display a customized link to self-signup with the appropriate customer as referral',
     'type'        => 'text',
   },
 
@@ -2079,6 +2070,21 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'google_maps_api_key',
+    'section'     => 'addresses',
+    'description' => 'API key for google maps.  This must be set for map and directions links to work.  See <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_top">Getting a Google Maps API Key</a>',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'company_physical_address',
+    'section'     => 'addresses',
+    'description' => 'Your physical company address, for use in supplying google map directions, defaults to company_address',
+    'type'        => 'textarea',
+    'per_agent'   => 1,
+  },
+
+  {
     'key'         => 'show_ship_company',
     'section'     => 'addresses',
     'description' => 'Turns on display/collection of a "service company name" field for customers.',
@@ -2179,8 +2185,8 @@ and customer address. Include units.',
 
   {
     'key'         => 'selfservice-payment_gateway',
-    'section'     => 'self-service',
-    'description' => 'Force the use of this payment gateway for self-service.',
+    'section'     => 'deprecated',
+    'description' => '(no longer supported) Force the use of this payment gateway for self-service.',
     %payment_gateway_options,
   },
 
@@ -2443,11 +2449,18 @@ and customer address. Include units.',
   {
     'key'         => 'billsoft-company_code',
     'section'     => 'taxation',
-    'description' => 'Billsoft tax service company code (3 letters)',
+    'description' => 'Billsoft (AvaTax for Communications) tax service company code (3 letters)',
     'type'        => 'text',
   },
 
   {
+    'key'         => 'billsoft-taxconfig',
+    'section'     => 'taxation',
+    'description' => 'Billsoft tax configuration flags. Four lines: Facilities, Franchise, Regulated, Business Class. See the Avalara documentation for instructions on setting these flags.',
+    'type'        => 'textarea',
+  },
+
+  {
     'key'         => 'avalara-taxconfig',
     'section'     => 'taxation',
     'description' => 'Avalara tax service configuration. Four lines: company code, account number, license key, test mode (1 to enable).',
@@ -2880,6 +2893,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'selfservice-password_reset_hours',
+    'section'     => 'self-service',
+    'description' => 'Numbers of hours an email password reset is valid.  Defaults to 24.',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'selfservice-password_reset_msgnum',
     'section'     => 'self-service',
     'description' => 'Template to use for password reset emails.',
@@ -3038,7 +3058,7 @@ and customer address. Include units.',
   {
     'key'         => 'ticket_system',
     'section'     => 'ticketing',
-    '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).',
+    '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:3: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) ],
@@ -3068,6 +3088,23 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'pingd-interval',
+    'section'     => 'network_monitoring',
+    'description' => 'Run ping scans of broadband services at this interval.',
+    'type'        => 'select',
+    'select_hash' => [ ''     => '',
+                       60     => '1 min',
+                       300    => '5 min',
+                       600    => '10 min',
+                       1800   => '30 min',
+                       3600   => '1 hour',
+                       14400  => '4 hours',
+                       28800  => '8 hours',
+                       86400  => '1 day',
+                     ],
+  },
+
+  {
     'key'         => 'ticket_system-default_queueid',
     'section'     => 'ticketing',
     'description' => 'Default queue used when creating new customer tickets.',
@@ -3464,13 +3501,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'cust_pkg-always_show_location',
-    'section'     => 'packages',
-    'description' => "Always display package locations, even when they're all the default service address.",
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'cust_pkg-group_by_location',
     'section'     => 'packages',
     'description' => "Group packages by location.",
@@ -3566,13 +3596,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'voip-cust_email_csv_cdr',
-    'section'     => 'deprecated',
-    'description' => 'Deprecated, see voip-cdr_email_attach instead.  Used to enable the per-customer option for including CDR information as a CSV attachment on emailed invoices.',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'voip-cdr_email_attach',
     'section'     => 'telephony',
     'description' => 'Enable the per-customer option for including CDR information as an attachment on emailed invoices.',
@@ -3626,6 +3649,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'invoice-all_pkg_addresses',
+    'section'     => 'invoicing',
+    'description' => 'Show all package addresses on invoices, even the default.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'invoice-unitprice',
     'section'     => 'invoicing',
     'description' => 'Enable unit pricing on invoices and quantities on packages.',
@@ -3915,6 +3945,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'cust_main_note-require_class',
+    'section'     => 'customer_fields',
+    'description' => 'Require customer note classes for customer notes',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'cust_main-ticket_statuses',
     'section'     => 'ticketing',
     'description' => 'Show tickets with these statuses on the customer view page.',
@@ -4163,6 +4200,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'cust_main-require_classnum',
+    'section'     => 'customer_fields',
+    'description' => 'Customer class is required: require customer class for all customer records.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'cust_main-check_unique',
     'section'     => 'customer_fields',
     'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
@@ -4195,21 +4239,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'referral_credit_type',
-    '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.',
-    reason_type_options('R'),
-  },
-
-  # was only used to negate invoices during signup when card was declined, now we just void
-  {
-    'key'         => 'signup_credit_type',
-    'section'     => 'deprecated', #self-service?
-    'description' => 'The group to use for new, automatically generated credit reasons resulting from signup and self-service declines.',
-    reason_type_options('R'),
-  },
-
-  {
     'key'         => 'prepayment_discounts-credit_type',
     'section'     => 'billing',
     'description' => 'Enables the offering of prepayment discounts and establishes the credit reason type.',
@@ -4265,6 +4294,7 @@ and customer address. Include units.',
     'section'     => 'invoice_balances',
     'description' => 'Text for the label of the total previous balance, when it is shown separately. Defaults to "Previous Balance".',
     'type'        => 'text',
+    'per_locale'  => 1,
   },
 
   {
@@ -4272,6 +4302,7 @@ and customer address. Include units.',
     'section'     => 'invoice_balances',
     'description' => 'Text for the label of the total of new charges, when it is shown separately. If invoice_show_prior_due_date is enabled, the due date of current charges will be appended. Defaults to "Total New Charges".',
     'type'        => 'text',
+    'per_locale'  => 1,
   },
 
   {
@@ -4417,6 +4448,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'tax_district_taxname',
+    'section'     => 'taxation',
+    'description' => 'The tax name to display on the invoice for district sales taxes. Defaults to "Tax".',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'company_latitude',
     'section'     => 'taxation',
     'description' => 'For Avalara taxation, your company latitude (-90 through 90)',
@@ -4989,6 +5027,13 @@ and customer address. Include units.',
 #  },
 
   {
+    'key'         => 'cdr-skip_duplicate_rewrite',
+    'section'     => 'telephony',
+    'description' => 'Use the freeside-cdrrewrited daemon to prevent billing CDRs with a src, dst and calldate identical to an existing CDR',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'cdr-charged_party_rewrite',
     '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*.',
@@ -5024,6 +5069,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'cdr-userfield_dnis_rewrite',
+    'section'     => 'telephony',
+    'description' => 'If the CDR userfield contains "DNIS=" followed by a sequence of digits, use that as the destination number for the call.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'cdr-intl_to_domestic_rewrite',
     'section'     => 'telephony',
     'description' => 'Strip the "011" international prefix from CDR destination numbers if the rest of the number is 7 digits or shorter, and so probably does not contain a country code.',
@@ -5155,13 +5207,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'tax-cust_exempt-groups-require_individual_nums',
-    'section'     => 'deprecated',
-    'description' => 'Deprecated: see tax-cust_exempt-groups-number_requirement',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'tax-cust_exempt-groups-num_req',
     'section'     => 'taxation',
     'description' => 'When using tax-cust_exempt-groups, control whether individual tax exemption numbers are required for exemption from different taxes.',
@@ -5400,8 +5445,8 @@ and customer address. Include units.',
 
   {
     'key'         => 'note-classes',
-    'section'     => 'customer_fields',
-    'description' => 'Use customer note classes',
+    'section'     => 'deprecated',
+    'description' => 'Use customer note classes (now automatically used if classes are defined)',
     'type'        => 'select',
     'select_hash' => [
                        0 => 'Disabled',
@@ -5481,8 +5526,8 @@ and customer address. Include units.',
 
   {
     'key'         => 'cust_bill-latex_lineitem_maxlength',
-    'section'     => 'invoicing',
-    'description' => 'Truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin.  Defaults to 50.  ',
+    'section'     => 'deprecated',
+    'description' => 'With old invoice_latex template, truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin.  (With current invoice_latex template, this is handled internally in the template itself instead.)',
     'type'        => 'text',
   },
 
@@ -5516,14 +5561,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'ie-compatibility_mode',
-    'section'     => 'UI',
-    'description' => "Compatibility mode META tag for Internet Explorer, used on the customer view page.  Not necessary in normal operation unless custom content (notes, cust_main-custom_link) is included on customer view that is incompatibile with newer IE verisons.",
-    'type'        => 'select',
-    'select_enum' => [ '', '7', 'EmulateIE7', '8', 'EmulateIE8' ],
-  },
-
-  {
     'key'         => 'disable_payauto_default',
     'section'     => 'payments',
     'description' => 'Disable the "Charge future payments to this (card|check) automatically" checkbox from defaulting to checked.',
@@ -5538,13 +5575,6 @@ and customer address. Include units.',
   },
   
   {
-    'key'         => 'svc_broadband-require-nw-coordinates',
-    'section'     => 'deprecated',
-    'description' => 'Deprecated; see geocode-require_nw_coordinates instead',
-    'type'        => 'checkbox',
-  },
-  
-  {
     'key'         => 'cust-edit-alt-field-order',
     'section'     => 'customer_fields',
     'description' => 'An alternate ordering of fields for the New Customer and Edit Customer screens.',
@@ -5634,6 +5664,13 @@ and customer address. Include units.',
       'rate_low'  => 'Lowest rate first',
     ],
   },
+
+  {
+    'key'         => 'cdr-lrn_lookup',
+    'section'     => 'telephony',
+    'description' => 'Look up LRNs of destination numbers for exact matching to the terminating carrier.  This feature requires a Freeside support contract for paid access to the central NPAC database; see <a href ="#support-key">support-key</a>.',
+    'type'        => 'checkbox',
+  },
   
   {
     'key'         => 'brand-agent',