my %msg_template_options = (
'type' => 'select-sub',
- 'options_sub' => sub { require FS::Record;
- require FS::agent;
- require FS::msg_template;
- map { $_->msgnum, $_->msgname }
- qsearch('msg_template', { disabled => '' });
- },
- 'option_sub' => sub { require FS::msg_template;
+ 'options_sub' => sub {
+ my @templates = qsearch({
+ 'table' => 'msg_template',
+ 'hashref' => { 'disabled' => '' },
+ 'extra_sql' => ' AND '.
+ $FS::CurrentUser::CurrentUser->agentnums_sql(null => 1),
+ });
+ map { $_->msgnum, $_->msgname } @templates;
+ },
+ 'option_sub' => sub {
my $msg_template = FS::msg_template->by_key(shift);
$msg_template ? $msg_template->msgname : ''
},
+ 'per_agent' => 1,
);
+my $_gateway_name = sub {
+ my $g = shift;
+ return '' if !$g;
+ ($g->gateway_username . '@' . $g->gateway_module);
+};
+
+my %payment_gateway_options = (
+ 'type' => 'select-sub',
+ 'options_sub' => sub {
+ my @gateways = qsearch({
+ 'table' => 'payment_gateway',
+ 'hashref' => { 'disabled' => '' },
+ });
+ map { $_->gatewaynum, $_gateway_name->($_) } @gateways;
+ },
+ 'option_sub' => sub {
+ my $gateway = FS::payment_gateway->by_key(shift);
+ $_gateway_name->($gateway);
+ },
+);
#Billing (81 items)
#Invoicing (50 items)
'section' => 'invoicing',
'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 20', 'Net 30', 'Net 45', 'Net 60', 'Net 90' ],
+ 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 20', 'Net 21', 'Net 30', 'Net 45', 'Net 60', 'Net 90' ],
},
{
'section' => 'notification',
'description' => 'Send payment receipts.',
'type' => 'checkbox',
+ 'per_agent' => 1,
},
{
'cust_pay' => 'When payment is made.',
'cust_bill_pay_pkg' => 'When payment is applied.',
],
+ 'per_agent' => 1,
},
{
'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
},
+ {
+ 'key' => 'selfservice-payment_gateway',
+ 'section' => 'self-service',
+ 'description' => 'Force the use of this payment gateway for self-service.',
+ %payment_gateway_options,
+ },
+
{
'key' => 'selfservice-save_unchecked',
'section' => 'self-service',
'svc_pbx' => 'PBX (svc_pbx)',
],
},
+
+ {
+ 'key' => 'signup_server-prepaid-template-custnum',
+ 'section' => 'self-service',
+ 'description' => 'When the signup server is used with prepaid cards and customer info is not required for signup, the contact/address info will be copied from this customer, if specified',
+ 'type' => 'text',
+ },
{
'key' => 'selfservice_server-base_url',
'section' => 'notification',
'description' => 'Enable emailing of credit card and electronic check decline notices.',
'type' => 'checkbox',
+ 'per_agent' => 1,
},
{
'section' => 'notification',
'description' => 'List of error messages that should not trigger email decline notices, one per line.',
'type' => 'textarea',
+ 'per_agent' => 1,
},
{
'section' => 'notification',
'description' => 'Enable emailing of cancellation notices. Make sure to select the template in the cancel_msgnum option.',
'type' => 'checkbox',
+ 'per_agent' => 1,
},
{
'type' => 'text',
},
+ {
+ 'key' => 'selfservice_server-login_svcpart',
+ 'section' => 'self-service',
+ 'description' => 'If specified, only allow the specified svcparts to login to self-service.',
+ 'type' => 'select-part_svc',
+ 'multiple' => 1,
+ },
+
+ {
+ 'key' => 'selfservice-recent-did-age',
+ 'section' => 'self-service',
+ 'description' => 'If specified, defines "recent", in number of seconds, for "Download recently allocated DIDs" in self-service.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'selfservice_server-view-wholesale',
+ 'section' => 'self-service',
+ 'description' => 'If enabled, use a wholesale package view in the self-service.',
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'selfservice-agent_signup',
'section' => 'self-service',
},
},
+ {
+ 'key' => 'selfservice-agent_login',
+ 'section' => 'self-service',
+ 'description' => 'Allow agent login via self-service.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'selfservice-self_suspend_reason',
+ 'section' => 'self-service',
+ 'description' => 'Suspend reason when customers suspend their own packages. Set to nothing to disallow self-suspension.',
+ 'type' => 'select-sub',
+ 'options_sub' => sub { require FS::Record;
+ require FS::reason;
+ my $type = qsearchs('reason_type',
+ { class => 'S' })
+ or return ();
+ map { $_->reasonnum => $_->reason }
+ FS::Record::qsearch('reason',
+ { reason_type => $type->typenum }
+ );
+ },
+ 'option_sub' => sub { require FS::Record;
+ require FS::reason;
+ my $reason = FS::Record::qsearchs(
+ 'reason', { 'reasonnum' => shift }
+ );
+ $reason ? $reason->reason : '';
+ },
+
+ 'per_agent' => 1,
+ },
+
{
'key' => 'card_refund-days',
'section' => 'billing',
'type' => 'checkbox',
},
+ {
+ 'key' => 'cust_pkg-group_by_location',
+ 'section' => 'UI',
+ 'description' => "Group packages by location.",
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'cust_pkg-show_fcc_voice_grade_equivalent',
'section' => 'UI',
'type' => 'textarea',
},
+ {
+ 'key' => 'batchconfig-td_eft1464',
+ 'section' => 'billing',
+ 'description' => 'Configuration for TD Bank EFT1464 batching, five lines: 1. Originator ID, 2. Datacenter Code, 3. Short name, 4. Long name, 5. Returned payment branch number, 6. Returned payment account, 7. Transaction code.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'batch-manual_approval',
+ 'section' => 'billing',
+ 'description' => 'Allow manual batch closure, which will approve all payments that do not yet have a status. This is not advised, but is needed for payment processors that provide a report of rejected rather than approved payments.',
+ 'type' => 'checkbox',
+ },
+
{
'key' => 'payment_history-years',
'section' => 'UI',
'type' => 'select',
'select_hash' => [
'' => 'Numeric only',
+ '\d{7}' => 'Numeric only, exactly 7 digits',
'ww?d+' => 'Numeric with one or two letter prefix',
],
},
'description' => 'Maximum length of the phone service "Name" field (svc_phone.phone_name). Sometimes useful to limit this (to 15?) when exporting as Caller ID data.',
'type' => 'text',
},
+
+ {
+ 'key' => 'svc_phone-lnp',
+ 'section' => '',
+ 'description' => 'Enables Number Portability features for svc_phone',
+ 'type' => 'checkbox',
+ },
{
'key' => 'default_phone_countrycode',
'type' => 'checkbox',
},
+ {
+ 'key' => 'svc_acct-cf_privatekey-message',
+ 'section' => '',
+ 'description' => 'For internal use: HTML displayed when cf_privatekey field is set.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'menu-prepend_links',
+ 'section' => 'UI',
+ 'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'cust_main-external_links',
+ 'section' => 'UI',
+ 'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)". The URL will have custnum appended.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'svc_phone-did-summary',
+ 'section' => 'invoicing',
+ 'description' => 'Enable DID activity summary for past 30 days on invoices, showing # DIDs activated/deactivated/ported-in/ported-out and total minutes usage',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'opensips_gwlist',
+ 'section' => 'opensips',
+ 'description' => 'For svc_phone OpenSIPS dr_rules export, gwlist column value, per-agent',
+ 'type' => 'text',
+ 'per_agent' => 1,
+ 'agentonly' => 1,
+ },
+
+ {
+ 'key' => 'opensips_description',
+ 'section' => 'opensips',
+ 'description' => 'For svc_phone OpenSIPS dr_rules export, description column value, per-agent',
+ 'type' => 'text',
+ 'per_agent' => 1,
+ 'agentonly' => 1,
+ },
+
+ {
+ 'key' => 'opensips_route',
+ 'section' => 'opensips',
+ 'description' => 'For svc_phone OpenSIPS dr_rules export, routeid column value, per-agent',
+ 'type' => 'text',
+ 'per_agent' => 1,
+ 'agentonly' => 1,
+ },
+
{ key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },