X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=e8417ff69d9a9258363aac8592fd6ca95d5a1a49;hb=e3dffa23a03cd9f88946ceb78bc75ada29bc013a;hp=471f216bade72709a3bc3cbbfac60af90be2a249;hpb=64852c30f3025d1aafa3c9d5c81f6b20dddd1a36;p=freeside.git diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 471f216ba..e8417ff69 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -10,6 +10,7 @@ use FS::part_pkg; %info = ( 'name' => 'Flat rate (anniversary billing)', + 'shortname' => 'Anniversary', 'fields' => { 'setup_fee' => { 'name' => 'Setup fee for this package', 'default' => 0, @@ -26,40 +27,49 @@ use FS::part_pkg; }, 'seconds' => { 'name' => 'Time limit for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, }, 'upbytes' => { 'name' => 'Upload limit for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, 'format' => \&FS::UI::bytecount::display_bytecount, 'parse' => \&FS::UI::bytecount::parse_bytecount, }, 'downbytes' => { 'name' => 'Download limit for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, 'format' => \&FS::UI::bytecount::display_bytecount, 'parse' => \&FS::UI::bytecount::parse_bytecount, }, 'totalbytes' => { 'name' => 'Transfer limit for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, 'format' => \&FS::UI::bytecount::display_bytecount, 'parse' => \&FS::UI::bytecount::parse_bytecount, }, 'recharge_amount' => { 'name' => 'Cost of recharge for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*(\.\d{2})?$/ }, }, 'recharge_seconds' => { 'name' => 'Recharge time for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, }, 'recharge_upbytes' => { 'name' => 'Recharge upload for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, 'format' => \&FS::UI::bytecount::display_bytecount, 'parse' => \&FS::UI::bytecount::parse_bytecount, }, 'recharge_downbytes' => { 'name' => 'Recharge download for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, 'format' => \&FS::UI::bytecount::display_bytecount, 'parse' => \&FS::UI::bytecount::parse_bytecount, }, 'recharge_totalbytes' => { 'name' => 'Recharge transfer for this package', 'default' => '', + 'check' => sub { shift =~ /^\d*$/ }, 'format' => \&FS::UI::bytecount::display_bytecount, 'parse' => \&FS::UI::bytecount::parse_bytecount, }, @@ -67,12 +77,16 @@ use FS::part_pkg; ' over into current period', 'type' => 'checkbox', }, + 'recharge_reset' => { 'name' => 'Reset usage to these values on manual '. + 'package recharge', + 'type' => 'checkbox', + }, }, 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'seconds', 'upbytes', 'downbytes', 'totalbytes', 'recharge_amount', 'recharge_seconds', 'recharge_upbytes', 'recharge_downbytes', 'recharge_totalbytes', - 'usage_rollover', 'externalid' ], + 'usage_rollover', 'recharge_reset', 'externalid' ], 'weight' => 10, );