This commit was generated by cvs2svn to compensate for changes in r11022,
[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   'inherit_fields' => [ 'usage_Mixin', 'global_Mixin' ],
25   'fields' => {
26     'recur_action' => { 'name' => 'Action to take upon reaching end of prepaid preiod',
27                         'type' => 'select',
28                         'select_options' => \%recur_action,
29                       },
30     'overlimit_action' => { 'name' => 'Action to take upon reaching a usage limit.',
31                             'type' => 'select',
32                             'select_options' => \%overlimit_action,
33                       },
34     #XXX if you set overlimit_action to 'cancel', should also have the ability
35     # to select a reason
36     
37     # do we need to disable these?
38     map { $_ => { 'disabled' => 1 } } (
39       qw(recharge_amount recharge_seconds recharge_upbytes recharge_downbytes
40       recharge_totalbytes usage_rollover recharge_reset) ),
41   },
42   'fieldorder' => [ qw( recur_action overlimit_action ) ],
43   'weight' => 25,
44 );
45
46 sub is_prepaid {
47   1;
48 }
49
50 1;
51