bulk provisioning via ftp and SOAP #5202
[freeside.git] / FS / FS / Conf.pm
index 4def462..cb53ef7 100644 (file)
@@ -8,6 +8,7 @@ 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);
@@ -91,6 +92,7 @@ sub _usecompat {
   $compat->$method(@_);
 }
 
+# needs a non _ name, called externally by config-view now (and elsewhere?)
 sub _config {
   my($self,$name,$agentnum)=@_;
   my $hashref = { 'name' => $name };
@@ -334,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);
@@ -363,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; "
@@ -380,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;
 }
 
@@ -447,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.freeside.biz/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,
   );
@@ -479,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
@@ -569,8 +575,11 @@ worry that config_items is freeside-specific and icky.
 
   {
     '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',
   },
 
@@ -617,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)',
@@ -671,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 )],
   },
 
@@ -803,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,
   },
 
   {
@@ -810,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,
   },
 
   {
@@ -831,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,
   },
 
   {
@@ -838,6 +864,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     'description' => 'Footer for LaTeX typeset PostScript invoices.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -845,6 +872,7 @@ worry that config_items is freeside-specific and icky.
     'section'     => 'billing',
     'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
     'type'        => 'textarea',
+    'per_agent'   => 1,
   },
 
   {
@@ -859,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,
   },
 
   {
@@ -1124,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,
   },
 
   {
@@ -1168,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',
@@ -1344,7 +1381,7 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'selfservice_server-base_url',
     'section'     => '',
-    'description' => 'Base URL for the self-service web interface - necessary for special provisioning widgets to find their way.',
+    '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',
   },
 
@@ -1472,7 +1509,14 @@ worry that config_items is freeside-specific and icky.
   {
     'key'         => 'enable_taxproducts',
     'section'     => 'billing',
-    'description' => 'Enable per-package mapping to new style tax classes',
+    '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',
   },
 
@@ -1627,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.',
@@ -2037,7 +2099,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).',
+    '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',
   },
 
@@ -2171,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.',
@@ -2289,7 +2358,7 @@ worry that config_items is freeside-specific and icky.
     'key'         => 'logo.eps',
     'section'     => 'billing',  #? 
     'description' => 'Company logo for printed and PDF invoices, in EPS format.',
-    'type'        => 'binary',
+    'type'        => 'image',
     'per_agent'   => 1, #XXX as above, kinda
   },
 
@@ -2471,6 +2540,13 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    '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.',
@@ -2595,6 +2671,23 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    '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.",
@@ -2644,12 +2737,97 @@ worry that config_items is freeside-specific and icky.
   },
 
   {
+    '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;
+