X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fprepaid.pm;h=50f908c6d1de7cdc747c7246f5f4c974bdc64eda;hb=b7cf1606a66cca95e3540f803ffa66d223f23a40;hp=d309d453f5be3ca5cbdd927c08a61e58031b8664;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/FS/FS/part_pkg/prepaid.pm b/FS/FS/part_pkg/prepaid.pm index d309d453f..50f908c6d 100644 --- a/FS/FS/part_pkg/prepaid.pm +++ b/FS/FS/part_pkg/prepaid.pm @@ -12,21 +12,34 @@ tie %recur_action, 'Tie::IxHash', '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', + 'inherit_fields' => [ 'usage_Mixin', 'global_Mixin' ], '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, - }, - 'recur_action' => { 'name' => 'Action to take upon reaching end of prepaid preiod', + 'recur_action' => { 'name' => 'Action to take upon reaching end of prepaid period', 'type' => 'select', 'select_options' => \%recur_action, }, + '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 + + # do we need to disable these? + map { $_ => { 'disabled' => 1 } } ( + qw(recharge_amount recharge_seconds recharge_upbytes recharge_downbytes + recharge_totalbytes usage_rollover recharge_reset) ), }, - 'fieldorder' => [ 'setup_fee', 'recur_fee', 'recur_action', ], + 'fieldorder' => [ qw( recur_action overlimit_action ) ], 'weight' => 25, );