communigate provisioning phase 2: add svc_domain.trailer -> communigate TrailerText...
[freeside.git] / FS / FS / part_pkg / prepaid.pm
1 package FS::part_pkg::prepaid;
2
3 use strict;
4 use vars qw(@ISA %info %recur_action);
5 use Tie::IxHash;
6 use FS::part_pkg::flat;
7
8 @ISA = qw(FS::part_pkg::flat);
9
10 tie %recur_action, 'Tie::IxHash',
11   'suspend' => 'suspend',
12   'cancel'  => 'cancel',
13 ;
14
15 tie my %overlimit_action, 'Tie::IxHash',
16   'overlimit' => 'Default overlimit processing',
17   'cancel'    => 'Cancel',
18 ;
19
20 %info = (
21   'name' => 'Prepaid, flat rate',
22   #'name' => 'Prepaid (no automatic recurring)', #maybe use it here too
23   'shortname' => 'Prepaid, no automatic cycle',
24   'fields' => {
25     'setup_fee'   =>  { 'name' => 'One-time setup fee for this package',
26                         'default' => 0,
27                       },
28     'recur_fee'   =>  { 'name' => 'Initial and recharge fee for this package',
29                         'default' => 0,
30                       },
31     'recur_action' => { 'name' => 'Action to take upon reaching end of prepaid preiod',
32                         'type' => 'select',
33                         'select_options' => \%recur_action,
34                       },
35     %FS::part_pkg::flat::usage_fields,
36     'overlimit_action' => { 'name' => 'Action to take upon reaching a usage limit.',
37                             'type' => 'select',
38                             'select_options' => \%overlimit_action,
39                       },
40     #XXX if you set overlimit_action to 'cancel', should also have the ability
41     # to select a reason
42   },
43   'fieldorder' => [ qw( setup_fee recur_fee recur_action ),
44                     @FS::part_pkg::flat::usage_fieldorder, 'overlimit_action',
45                   ],
46   'weight' => 25,
47 );
48
49 sub is_prepaid {
50   1;
51 }
52
53 1;
54