2dad511acaf46875f44a35751c96919ca8eb70f0
[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 %info = (
13   'disabled' => 1,
14   'fields' => {
15     'setup_fee' => { 
16       'name' => 'Setup fee for this package',
17       'default' => 0,
18     },
19     'recur_fee' => { 
20       'name' => 'Recurring fee for this package',
21       'default' => 0,
22     },
23     'unused_credit_cancel' => {
24       'name' => 'Credit the customer for the unused portion of service at '.
25                  'cancellation',
26       'type' => 'checkbox',
27     },
28     'unused_credit_suspend' => {
29       'name' => 'Credit the customer for the unused portion of service when '.
30                 'suspending',
31       'type' => 'checkbox',
32     },
33     'unused_credit_change' => {
34       'name' => 'Credit the customer for the unused portion of service when '.
35                 'changing packages',
36       'type' => 'checkbox',
37     },
38
39     # miscellany--maybe put this in a separate module?
40
41     'a2billing_tariff' => {
42       'name'        => 'A2Billing tariff group ID',
43       'display_if'  => sub {
44         FS::part_export->count("exporttype = 'a2billing'") > 0;
45       }
46     },
47     'a2billing_type' => {
48       'name'        => 'A2Billing card type',
49       'display_if'  => sub {
50         FS::part_export->count("exporttype = 'a2billing'") > 0;
51       },
52       'type'        => 'select',
53       'select_options' => \%a2billing_types,
54     },
55
56   },
57   'fieldorder' => [ qw(
58     setup_fee
59     recur_fee
60     unused_credit_cancel
61     unused_credit_suspend
62     unused_credit_change
63
64     a2billing_tariff
65     a2billing_type
66   )],
67 );
68
69 1;