X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fprepaid.pm;h=cff165a5d53d5d32d0ed1b21e6060426f17ca7ee;hb=4ad8b72c0dde10d4907298277181ddfaa99dafb6;hp=5e7d2baae4c9b5ef7f40e6b2bb3faeed28769705;hpb=c160bc6f05b17d8084addc4d638ebc908c9ec0e6;p=freeside.git diff --git a/FS/FS/part_pkg/prepaid.pm b/FS/FS/part_pkg/prepaid.pm index 5e7d2baae..cff165a5d 100644 --- a/FS/FS/part_pkg/prepaid.pm +++ b/FS/FS/part_pkg/prepaid.pm @@ -1,22 +1,48 @@ package FS::part_pkg::prepaid; use strict; -use vars qw(@ISA %info); +use vars qw(@ISA %info %recur_action); +use Tie::IxHash; use FS::part_pkg::flat; @ISA = qw(FS::part_pkg::flat); +tie %recur_action, 'Tie::IxHash', + 'suspend' => 'suspend', + 'cancel' => 'cancel', +; + +tie my %overlimit_action, 'Tie::IxHash', + 'overlimit' => 'Default overlimit processing', + 'cancel' => 'Cancel', +; + %info = ( 'name' => 'Prepaid, flat rate', + #'name' => 'Prepaid (no automatic recurring)', #maybe use it here too + 'shortname' => 'Prepaid, no automatic cycle', 'fields' => { - 'setup_fee' => { 'name' => 'One-time setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Initial and recharge fee for this package', - 'default' => 0, - } + 'setup_fee' => { 'name' => 'One-time setup fee for this package', + 'default' => 0, + }, + 'recur_fee' => { 'name' => 'Initial and recharge fee for this package', + 'default' => 0, + }, + 'recur_action' => { 'name' => 'Action to take upon reaching end of prepaid preiod', + 'type' => 'select', + 'select_options' => \%recur_action, + }, + %FS::part_pkg::flat::usage_fields, + 'overlimit_action' => { 'name' => 'Action to take upon reaching a usage limit.', + 'type' => 'select', + 'select_options' => \%overlimit_action, + }, + #XXX if you set overlimit_action to 'cancel', should also have the ability + # to select a reason }, - 'fieldorder' => [ 'setup_fee', 'recur_fee', ], + 'fieldorder' => [ qw( setup_fee recur_fee recur_action ), + @FS::part_pkg::flat::usage_fieldorder, 'overlimit_action', + ], 'weight' => 25, );