X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FConf.pm;h=3921afdaa90b2aeca25749de69640ecba6773535;hp=728a2136bc1691ed172a6c19a17b65e9d6f7f3bb;hb=32db3ad86bcf04e4f34705a396b718061d333f20;hpb=ec5603ae351d4ed8e4873dcd20bf71f8a4d549bb diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 728a2136b..3921afdaa 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -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); @@ -97,7 +98,7 @@ sub _config { $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); } @@ -108,7 +109,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 ) { @@ -146,7 +151,11 @@ 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)); } @@ -326,7 +335,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); @@ -355,7 +364,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; " @@ -372,22 +382,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; } @@ -471,7 +483,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 @@ -556,6 +568,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'billing', 'description' => 'Template file for billing method expiration alerts. See the billing documentation for details.', 'type' => 'textarea', + 'per-agent' => 1, }, { @@ -608,6 +621,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 Business::OnlinePayment. Evaluated as a double-quoted perl string, with the following variables available: $agent (the agent name), and $pkgs (a comma-separated list of packages for which these charges apply)', @@ -731,6 +755,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)', @@ -756,6 +787,15 @@ 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, }, { @@ -866,6 +906,13 @@ worry that config_items is freeside-specific and icky. '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', @@ -1445,6 +1492,13 @@ worry that config_items is freeside-specific and icky. }, { + '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 Text::Template documentation for details on the template substitution language. The following variables are available', @@ -1538,8 +1592,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', }, @@ -1658,6 +1712,13 @@ worry that config_items is freeside-specific and icky. }, { + '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.', @@ -1680,6 +1741,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).', @@ -1778,6 +1847,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 }, { @@ -1785,6 +1855,7 @@ worry that config_items is freeside-specific and icky. 'section' => 'required', 'description' => 'Your company address', 'type' => 'textarea', + 'per_agent' => 1, }, { @@ -1801,9 +1872,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 referred customer's recurring fee (irregardless of frequency).", + 'section' => 'deprecated', + 'description' => "Used to enable one-time referral credits in the amount of one month referred customer's recurring fee (irregardless of frequency). Replace with a billing event on appropriate packages.", 'type' => 'checkbox', }, @@ -1816,12 +1894,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.', @@ -1858,6 +1987,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.', @@ -1909,7 +2045,14 @@ 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).', 'type' => 'checkbox', }, @@ -1947,13 +2090,37 @@ worry that config_items is freeside-specific and icky. }, { - 'key' => 'batch-enable', + '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.', @@ -2127,15 +2294,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', + 'description' => 'Company logo for printed and PDF invoices, in EPS format.', 'type' => 'binary', + 'per_agent' => 1, #XXX as above, kinda }, { @@ -2205,7 +2375,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', }, @@ -2244,8 +2414,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; @@ -2294,7 +2464,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', @@ -2351,12 +2521,171 @@ worry that config_items is freeside-specific and icky. }, { + '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' => '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_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.', + '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', + }, + ); 1;