1 package FS::part_pkg::usage_Mixin;
7 # Field definitions for time and data usage, other than CDRs.
12 'seconds' => { 'name' => 'Time limit for this package',
14 'check' => sub { shift =~ /^\d*$/ },
16 'upbytes' => { 'name' => 'Upload limit for this package',
18 'check' => sub { shift =~ /^\d*$/ },
19 'format' => \&FS::UI::bytecount::display_bytecount,
20 'parse' => \&FS::UI::bytecount::parse_bytecount,
22 'downbytes' => { 'name' => 'Download limit for this package',
24 'check' => sub { shift =~ /^\d*$/ },
25 'format' => \&FS::UI::bytecount::display_bytecount,
26 'parse' => \&FS::UI::bytecount::parse_bytecount,
28 'totalbytes' => { 'name' => 'Transfer limit for this package',
30 'check' => sub { shift =~ /^\d*$/ },
31 'format' => \&FS::UI::bytecount::display_bytecount,
32 'parse' => \&FS::UI::bytecount::parse_bytecount,
34 'recharge_amount' => { 'name' => 'Cost of recharge for this package',
36 'check' => sub { shift =~ /^\d*(\.\d{2})?$/ },
38 'recharge_seconds' => { 'name' => 'Recharge time for this package',
40 'check' => sub { shift =~ /^\d*$/ },
42 'recharge_upbytes' => { 'name' => 'Recharge upload for this package',
44 'check' => sub { shift =~ /^\d*$/ },
45 'format' => \&FS::UI::bytecount::display_bytecount,
46 'parse' => \&FS::UI::bytecount::parse_bytecount,
48 'recharge_downbytes' => { 'name' => 'Recharge download for this package',
50 'check' => sub { shift =~ /^\d*$/ },
51 'format' => \&FS::UI::bytecount::display_bytecount,
52 'parse' => \&FS::UI::bytecount::parse_bytecount,
54 'recharge_totalbytes' => { 'name' => 'Recharge transfer for this package',
56 'check' => sub { shift =~ /^\d*$/ },
57 'format' => \&FS::UI::bytecount::display_bytecount,
58 'parse' => \&FS::UI::bytecount::parse_bytecount,
60 'usage_rollover' => { 'name' => 'Allow usage from previous period to roll '.
61 ' over into current period',
64 'recharge_reset' => { 'name' => 'Reset usage to these values on manual '.
69 'fieldorder' => [ qw( seconds upbytes downbytes totalbytes
70 recharge_amount recharge_seconds recharge_upbytes
71 recharge_downbytes recharge_totalbytes
72 usage_rollover recharge_reset ) ],