more helpful message, hopefully, RT#39368
[freeside.git] / FS / FS / part_pkg / global_Mixin.pm
1 package FS::part_pkg::global_Mixin;
2
3 use strict;
4 use vars qw(%info);
5
6 use Tie::IxHash;
7 tie my %a2billing_types, 'Tie::IxHash', (
8   0 => 'Prepaid',
9   1 => 'Postpaid',
10 );
11
12 tie my %a2billing_simultaccess, 'Tie::IxHash', (
13   0 => 'Disabled',
14   1 => 'Enabled',
15 );
16
17 %info = (
18   'disabled' => 1,
19   'fields' => {
20     'setup_fee' => { 
21       'name' => 'Setup fee for this package',
22       'default' => 0,
23     },
24     'recur_fee' => { 
25       'name' => 'Recurring fee for this package',
26       'default' => 0,
27     },
28     'unused_credit_cancel' => {
29       'name' => 'Credit the customer for the unused portion of service at '.
30                  'cancellation',
31       'type' => 'checkbox',
32     },
33     'unused_credit_suspend' => {
34       'name' => 'Credit the customer for the unused portion of service when '.
35                 'suspending',
36       'type' => 'checkbox',
37     },
38     'unused_credit_change' => {
39       'name' => 'Credit the customer for the unused portion of service when '.
40                 'changing packages',
41       'type' => 'checkbox',
42     },
43     'delay_cancel' => {
44       'name' => 'Automatic suspension period before cancelling (configuration setting part_pkg-delay_cancel-days)',
45       'type' => 'checkbox',
46     },
47
48     # miscellany--maybe put this in a separate module?
49
50     'a2billing_tariff' => {
51       'name'        => 'A2Billing tariff group ID',
52       'display_if'  => sub {
53         FS::part_export->count("exporttype = 'a2billing'") > 0;
54       }
55     },
56     'a2billing_type' => {
57       'name'        => 'A2Billing card type',
58       'display_if'  => sub {
59         FS::part_export->count("exporttype = 'a2billing'") > 0;
60       },
61       'type'        => 'select',
62       'select_options' => \%a2billing_types,
63     },
64     'a2billing_simultaccess' => {
65       'name'        => 'A2Billing Simultaneous Access',
66       'display_if'  => sub {
67         FS::part_export->count("exporttype = 'a2billing'") > 0;
68       },
69       'type'        => 'select',
70       'select_options' => \%a2billing_simultaccess,
71     },  
72     'a2billing_carrier_cost_min' => {
73       'name'        => 'A2Billing inbound carrier cost',
74       'display_if'  => sub {
75         FS::part_export->count("exporttype = 'a2billing'") > 0;
76       },
77     },
78    'a2billing_carrer_initblock_offp' => {
79       'name'        => 'A2Billing inbound carrier min duration',
80       'display_if'  => sub {
81         FS::part_export->count("exporttype = 'a2billing'") > 0;
82       },
83     },
84     'a2billing_carrier_increment_offp' => {
85       'name'        => 'A2Billing inbound carrier billing block',
86       'display_if'  => sub {
87         FS::part_export->count("exporttype = 'a2billing'") > 0;
88       },
89     },
90     'a2billing_retail_cost_min_offp' => {
91       'name'        => 'A2Billing inbound retail cost',
92       'display_if'  => sub {
93         FS::part_export->count("exporttype = 'a2billing'") > 0;
94       },
95     },
96     'a2billing_retail_initblock_offp' => {
97       'name'        => 'A2Billing inbound retail min duration',
98       'display_if'  => sub {
99         FS::part_export->count("exporttype = 'a2billing'") > 0;
100       },
101     },
102     'a2billing_retail_increment_offp' => {
103       'name'        => 'A2Billing inbound retail billing block',
104       'display_if'  => sub {
105         FS::part_export->count("exporttype = 'a2billing'") > 0;
106      },
107    },
108
109  },
110   'fieldorder' => [ qw(
111     setup_fee
112     recur_fee
113     unused_credit_cancel
114     unused_credit_suspend
115     unused_credit_change
116     delay_cancel
117
118     a2billing_tariff
119     a2billing_type
120     a2billing_simultaccess
121     a2billing_carrier_cost_min
122     a2billing_carrer_initblock_offp
123     a2billing_carrier_increment_offp
124     a2billing_retail_cost_min_offp
125     a2billing_retail_initblock_offp
126     a2billing_retail_increment_offp
127   )],
128 );
129
130 1;