have the UI use full country names, and state names outside the US...
[freeside.git] / FS / FS / Conf.pm
index e21e583..6be6db5 100644 (file)
@@ -95,6 +95,21 @@ sub config {
   }
 }
 
+=item config_binary KEY
+
+Returns the exact scalar value for key.
+
+=cut
+
+sub config_binary {
+  my($self,$file)=@_;
+  my($dir)=$self->dir;
+  my $fh = new IO::File "<$dir/$file" or return;
+  local $/;
+  my $content = <$fh>;
+  $content;
+}
+
 =item exists KEY
 
 Returns true if the specified key exists, even if the corresponding value
@@ -209,6 +224,31 @@ sub config_items {
         new FS::ConfItem {
                            'key'         => $basename,
                            'section'     => 'billing',
+                           'description' => 'Alternate HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
+                           'type'        => 'textarea',
+                         }
+      } glob($self->dir. '/invoice_html_*')
+  ),
+  ( map { 
+        my $basename = basename($_);
+        $basename =~ /^(.*)$/;
+        $basename = $1;
+        ($latexname = $basename ) =~ s/latex/html/;
+        new FS::ConfItem {
+                           'key'         => $basename,
+                           'section'     => 'billing',
+                           'description' => "Alternate Notes section for HTML invoices.  Defaults to the same data in $latexname if not specified.",
+                           'type'        => 'textarea',
+                         }
+      } glob($self->dir. '/invoice_htmlnotes_*')
+  ),
+  ( map { 
+        my $basename = basename($_);
+        $basename =~ /^(.*)$/;
+        $basename = $1;
+        new FS::ConfItem {
+                           'key'         => $basename,
+                           'section'     => 'billing',
                            'description' => 'Alternate LaTeX template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
                            'type'        => 'textarea',
                          }
@@ -351,6 +391,13 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'business-onlinepayment-email-override',
+    'section'     => 'billing',
+    'description' => 'Email address used instead of customer email address when submitting a BOP transaction.',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'bsdshellmachines',
     'section'     => 'deprecated',
     'description' => '<b>DEPRECATED</b>, add a <i>bsdshell</i> <a href="../browse/part_export.cgi">export</a> instead.  Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
@@ -465,7 +512,7 @@ httemplate/docs/config.html
   {
     'key'         => 'erpcdmachines',
     'section'     => 'deprecated',
-    'description' => '<b>DEPRECATED</b>, ERPCD is no longer supported.  Used to be ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
+    'description' => '<b>DEPRECATED</b>, ERPCD is no longer supported.  Used to be ERPCD authentication machines, one per line.  This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
     'type'        => 'textarea',
   },
 
@@ -533,9 +580,38 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'invoice_html',
+    'section'     => 'billing',
+    'description' => 'Optional HTML template for invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
+
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'invoice_htmlnotes',
+    'section'     => 'billing',
+    'description' => 'Notes section for HTML invoices.  Defaults to the same data in invoice_latexnotes if not specified.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'invoice_htmlfooter',
+    'section'     => 'billing',
+    'description' => 'Footer for HTML invoices.  Defaults to the same data in invoice_latexfooter if not specified.',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'invoice_htmlreturnaddress',
+    'section'     => 'billing',
+    'description' => 'Return address for HTML invoices.  Defaults to the same data in invoice_latexreturnaddress if not specified.',
+    'type'        => 'textarea',
+  },
+
+  {
     'key'         => 'invoice_latex',
     'section'     => 'billing',
-    'description' => 'Optional LaTeX template for typeset PostScript invoices.',
+    'description' => 'Optional LaTeX template for typeset PostScript invoices.  See the <a href="../docs/billing.html">billing documentation</a> for details.',
     'type'        => 'textarea',
   },
 
@@ -554,6 +630,13 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'invoice_latexreturnaddress',
+    'section'     => 'billing',
+    'description' => 'Return address for LaTeX typeset PostScript invoices.',
+    'type'        => 'textarea',
+  },
+
+  {
     'key'         => 'invoice_latexsmallfooter',
     'section'     => 'billing',
     'description' => 'Optional small footer for multi-page LaTeX typeset PostScript invoices.',
@@ -585,7 +668,7 @@ httemplate/docs/config.html
 
   {
     'key'         => 'invoice_send_receipts',
-    'section'     => 'deprecated',q
+    'section'     => 'deprecated',
     'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
     'type'        => 'checkbox',
   },
@@ -593,7 +676,7 @@ httemplate/docs/config.html
   {
     'key'         => 'payment_receipt_email',
     'section'     => 'billing',
-    'description' => 'Template file for payment receipts.',
+    '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>',
     'type'        => 'textarea',
   },
 
@@ -640,7 +723,7 @@ httemplate/docs/config.html
     'editlist_parts' => [ { type=>'text' },
                           { type=>'immutable', value=>'IN' },
                           { type=>'select',
-                            select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS)} },
+                            select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
                           { type=> 'text' }, ],
   },
 
@@ -967,6 +1050,13 @@ httemplate/docs/config.html
     'type'        => 'checkbox',
   },
 
+  { 
+    'key'         => 'username-percent',
+    'section'     => 'username',
+    'description' => 'Allow the percent character (%) in usernames.',
+    'type'        => 'checkbox',
+  },
+
   {
     'key'         => 'username_policy',
     'section'     => 'deprecated',
@@ -1112,6 +1202,13 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'backend-realtime',
+    'section'     => '',
+    'description' => 'Run billing for backend signups immediately.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'declinetemplate',
     'section'     => 'billing',
     'description' => 'Template file for credit card decline emails.',
@@ -1168,9 +1265,16 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'require_taxclasses',
+    'section'     => 'billing',
+    'description' => 'Require a taxclass to be entered for every package',
+    '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/doc/MJD/Text-Template-1.42/Template.pm">Text::Template</a> documentation for details on the template substitution language.  The following variables are available: <code>$username</code>, <code>$password</code>, <code>$first</code>, <code>$last</code> and <code>$pkg</code>.',
+    '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>',
     'type'        => 'textarea',
   },
 
@@ -1197,11 +1301,19 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'payby',
+    'section'     => 'billing',
+    'description' => 'Available payment types.',
+    'type'        => 'selectmultiple',
+    'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ],
+  },
+
+  {
     'key'         => 'payby-default',
     'section'     => 'UI',
     'description' => 'Default payment type.  HIDE disables display of billing information and sets customers to BILL.',
     'type'        => 'select',
-    'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL COMP HIDE) ],
+    'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ],
   },
 
   {
@@ -1366,16 +1478,37 @@ httemplate/docs/config.html
   {
     'key'         => 'ticket_system',
     'section'     => '',
-    'description' => 'Ticketing system integraiton.  <b>RT_Internal</b> uses the built-in RT ticketing system (use <code>make create-rt</code> to create the necessary tables).  <b>RT_Libs</b> uses the built-in RT libraries to access an RT installation in a separate database (local or remote).  <b>RT_External</b> uses raw SQL access (and eventually RT\'s XML interface and RTx::Atom?) to access an 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="../docs/install-rt">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_Libs RT_External) ],
+    'select_enum' => [ '', qw(RT_Internal RT_External) ],
   },
 
   {
     'key'         => 'ticket_system-default_queueid',
     'section'     => '',
-    'description' => 'Default queue number used when creating new customer tickets.',
-    'type'        => 'text',
+    'description' => 'Default queue used when creating new customer tickets.',
+    'type'        => 'select-sub',
+    'options_sub' => sub {
+                           my $conf = new FS::Conf;
+                           if ( $conf->config('ticket_system') ) {
+                             eval "use FS::TicketSystem;";
+                             die $@ if $@;
+                             FS::TicketSystem->queues();
+                           } else {
+                             ();
+                           }
+                         },
+    'option_sub'  => sub { 
+                           my $conf = new FS::Conf;
+                           if ( $conf->config('ticket_system') ) {
+                             eval "use FS::TicketSystem;";
+                             die $@ if $@;
+                             FS::TicketSystem->queue(shift);
+                           } else {
+                             '';
+                           }
+                         },
   },
 
   {
@@ -1400,6 +1533,21 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'ticket_system-rt_external_datasrc',
+    'section'     => '',
+    'description' => 'With external RT integration, the DBI data source for the external RT installation, for example, <code>DBI:Pg:user=rt_user;password=rt_word;host=rt.example.com;dbname=rt</code>',
+    'type'        => 'text',
+
+  },
+
+  {
+    'key'         => 'ticket_system-rt_external_url',
+    'section'     => '',
+    'description' => 'With external RT integration, the URL for the external RT installation, for example, <code>https://rt.example.com/rt</code>',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'company_name',
     'section'     => 'required',
     'description' => 'Your company name',
@@ -1414,6 +1562,20 @@ httemplate/docs/config.html
   },
 
   {
+    'key'         => 'cc-void',
+    'section'     => 'billing',
+    'description' => 'Enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'unvoid',
+    'section'     => 'billing',
+    'description' => 'Enable unvoiding of voided payments',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'address2-search',
     'section'     => 'UI',
     'description' => 'Enable a "Unit" search box which searches the second address field',
@@ -1433,6 +1595,106 @@ httemplate/docs/config.html
     'select_enum' => [ 'Cache::SharedMemoryCache', 'Cache::FileCache', ], # '_Database' ],
   },
 
+  {
+    'key'         => 'hylafax',
+    'section'     => '',
+    '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'         => 'svc_acct-usage_suspend',
+    'section'     => 'billing',
+    'description' => 'Suspends the package an account belongs to when svc_acct.seconds is decremented to 0 or below (accounts with an empty seconds value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'svc_acct-usage_unsuspend',
+    'section'     => 'billing',
+    'description' => 'Unuspends the package an account belongs to when svc_acct.seconds is incremented from 0 or below to a positive value (accounts with an empty seconds value are ignored).  Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'cust-fields',
+    'section'     => 'UI',
+    'description' => 'Which customer fields to display on reports',
+    'type'        => 'select',
+    'select_enum' => [
+      'Customer: Last, First</b> or</i> Company (Last, First)</b>',
+      'Cust# | Customer: custnum | Last, First or Company (Last, First)',
+      'Name | Company: Last, First | Company',
+      'Cust# | Name | Company: custnum | Last, First | Company',
+      '(bill) Customer | (service) Customer: Last, First or Company (Last, First) | (same for service address if present)',
+      'Cust# | (bill) Customer | (service) Customer:  custnum | Last, First or Company (Last, First) | (same for service address if present)',
+      '(bill) Name | (bill) Company | (service) Name | (service) Company: Last, First | Company | (same for service address if present)',
+      'Cust# | (bill) Name | (bill) Company | (service) Name | (service) Company: custnum | Last, First | Company | (same for service address if present)',
+    ],
+  },
+
+  {
+    'key'         => 'cust_pkg-display_times',
+    'section'     => 'UI',
+    'description' => 'Display full timestamps (not just dates) for customer packages.  Useful if you are doing real-time things like hourly prepaid.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'svc_acct-edit_uid',
+    'section'     => 'shell',
+    'description' => 'Allow UID editing.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'svc_acct-edit_gid',
+    'section'     => 'shell',
+    'description' => 'Allow GID editing.',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'zone-underscore',
+    'section'     => 'BIND',
+    'description' => 'Allow underscores in zone names.  As underscores are illegal characters in zone names, this option is not recommended.',
+    'type'        => 'checkbox',
+  },
+
+  #these should become per-user...
+  {
+    'key'         => 'vonage-username',
+    'section'     => '',
+    'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
+    'type'        => 'text',
+  },
+  {
+    'key'         => 'vonage-password',
+    'section'     => '',
+    'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
+    'type'        => 'text',
+  },
+  {
+    'key'         => 'vonage-fromnumber',
+    'section'     => '',
+    'description' => 'Vonage Click2Call number (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'echeck-nonus',
+    'section'     => 'billing',
+    'description' => 'Disable ABA-format account checking for Electronic Check payment info',
+    'type'        => 'checkbox',
+  },
+
+  {
+    'key'         => 'voip-cust_cdr_spools',
+    'section'     => '',
+    'description' => 'Enable the per-customer option for individual CDR spools.',
+    'type'        => 'checkbox',
+  },
+
 );
 
 1;