summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg/global_Mixin.pm
blob: 2318c3e6168c71df0e78559ef50a2b4640f2fe2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package FS::part_pkg::global_Mixin;

use strict;
use vars qw(%info);

use Tie::IxHash;
tie my %a2billing_types, 'Tie::IxHash', (
  0 => 'Prepaid',
  1 => 'Postpaid',
);

tie my %a2billing_simultaccess, 'Tie::IxHash', (
  0 => 'Disabled',
  1 => 'Enabled',
);

%info = (
  'disabled' => 1,
  'fields' => {
    'setup_fee' => { 
      'name' => 'Setup fee for this package',
      'default' => 0,
    },
    'recur_fee' => { 
      'name' => 'Recurring fee for this package',
      'default' => 0,
    },
    'unused_credit_cancel' => {
      'name' => 'Credit the customer for the unused portion of service at '.
                 'cancellation',
      'type' => 'checkbox',
    },
    'unused_credit_suspend' => {
      'name' => 'Credit the customer for the unused portion of service when '.
                'suspending',
      'type' => 'checkbox',
    },
    'unused_credit_change' => {
      'name' => 'Credit the customer for the unused portion of service when '.
                'changing packages',
      'type' => 'checkbox',
    },
    'delay_cancel' => {
      'name' => 'Automatically suspend for one day before cancelling',
      'type' => 'checkbox',
    },

    # miscellany--maybe put this in a separate module?

    'a2billing_tariff' => {
      'name'        => 'A2Billing tariff group ID',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      }
    },
    'a2billing_type' => {
      'name'        => 'A2Billing card type',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      },
      'type'        => 'select',
      'select_options' => \%a2billing_types,
    },
    'a2billing_simultaccess' => {
      'name'        => 'A2Billing Simultaneous Access',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      },
      'type'        => 'select',
      'select_options' => \%a2billing_simultaccess,
    },  
    'a2billing_carrier_cost_min' => {
      'name'        => 'A2Billing inbound carrier cost',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      },
    },
   'a2billing_carrer_initblock_offp' => {
      'name'        => 'A2Billing inbound carrier min duration',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      },
    },
    'a2billing_carrier_increment_offp' => {
      'name'        => 'A2Billing inbound carrier billing block',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      },
    },
    'a2billing_retail_cost_min_offp' => {
      'name'        => 'A2Billing inbound retail cost',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      },
    },
    'a2billing_retail_initblock_offp' => {
      'name'        => 'A2Billing inbound retail min duration',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
      },
    },
    'a2billing_retail_increment_offp' => {
      'name'        => 'A2Billing inbound retail billing block',
      'display_if'  => sub {
        FS::part_export->count("exporttype = 'a2billing'") > 0;
     },
   },

 },
  'fieldorder' => [ qw(
    setup_fee
    recur_fee
    unused_credit_cancel
    unused_credit_suspend
    unused_credit_change
    delay_cancel

    a2billing_tariff
    a2billing_type
    a2billing_simultaccess
    a2billing_carrier_cost_min
    a2billing_carrer_initblock_offp
    a2billing_carrier_increment_offp
    a2billing_retail_cost_min_offp
    a2billing_retail_initblock_offp
    a2billing_retail_increment_offp
  )],
);

1;