add skip_dcontext_suffix to skip CDRs with dcontext ending in a definable string...
[freeside.git] / FS / FS / part_pkg / usage_Mixin.pm
1 package FS::part_pkg::usage_Mixin;
2
3 use strict;
4 use vars qw( %info );
5 use FS::UI::bytecount;
6
7 # Field definitions for time and data usage, other than CDRs.
8
9 %info = (
10   'disabled' => 1,
11   'fields' => {
12     'seconds'       => { 'name' => 'Time limit for this package',
13                          'default' => '',
14                          'check' => sub { shift =~ /^\d*$/ },
15                        },
16     'upbytes'       => { 'name' => 'Upload limit for this package',
17                          'default' => '',
18                          'check' => sub { shift =~ /^\d*$/ },
19                          'format' => \&FS::UI::bytecount::display_bytecount,
20                          'parse' => \&FS::UI::bytecount::parse_bytecount,
21                        },
22     'downbytes'     => { 'name' => 'Download limit for this package',
23                          'default' => '',
24                          'check' => sub { shift =~ /^\d*$/ },
25                          'format' => \&FS::UI::bytecount::display_bytecount,
26                          'parse' => \&FS::UI::bytecount::parse_bytecount,
27                        },
28     'totalbytes'    => { 'name' => 'Transfer limit for this package',
29                          'default' => '',
30                          'check' => sub { shift =~ /^\d*$/ },
31                          'format' => \&FS::UI::bytecount::display_bytecount,
32                          'parse' => \&FS::UI::bytecount::parse_bytecount,
33                        },
34     'recharge_amount'       => { 'name' => 'Cost of recharge for this package',
35                          'default' => '',
36                          'check' => sub { shift =~ /^\d*(\.\d{2})?$/ },
37                        },
38     'recharge_seconds'      => { 'name' => 'Recharge time for this package',
39                          'default' => '',
40                          'check' => sub { shift =~ /^\d*$/ },
41                        },
42     'recharge_upbytes'      => { 'name' => 'Recharge upload for this package',
43                          'default' => '',
44                          'check' => sub { shift =~ /^\d*$/ },
45                          'format' => \&FS::UI::bytecount::display_bytecount,
46                          'parse' => \&FS::UI::bytecount::parse_bytecount,
47                        },
48     'recharge_downbytes'    => { 'name' => 'Recharge download for this package',
49                          'default' => '',
50                          'check' => sub { shift =~ /^\d*$/ },
51                          'format' => \&FS::UI::bytecount::display_bytecount,
52                          'parse' => \&FS::UI::bytecount::parse_bytecount,
53                        },
54     'recharge_totalbytes'   => { 'name' => 'Recharge transfer for this package',
55                          'default' => '',
56                          'check' => sub { shift =~ /^\d*$/ },
57                          'format' => \&FS::UI::bytecount::display_bytecount,
58                          'parse' => \&FS::UI::bytecount::parse_bytecount,
59                        },
60     'usage_rollover' => { 'name' => 'Allow usage from previous period to roll '.
61                                     ' over into current period',
62                           'type' => 'checkbox',
63                         },
64     'recharge_reset' => { 'name' => 'Reset usage to these values on manual '.
65                                     'package recharge',
66                           'type' => 'checkbox',
67                         },
68   },
69   'fieldorder' => [ qw( seconds upbytes downbytes totalbytes
70                         recharge_amount recharge_seconds recharge_upbytes
71                         recharge_downbytes recharge_totalbytes 
72                         usage_rollover recharge_reset ) ],
73 );
74
75 1;