X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fsesmon_minute.pm;h=9c8dfd1b7c42b3fa73179682717f1f2dd5ab0555;hb=51fa32c6d1d22d4b78afd4bf12e307fbdacc6062;hp=6af7c0870337b7fa26e269e0d78d3d8cb0ee6a34;hpb=673b9a458d9138523026963df6fa3b4683e09bae;p=freeside.git diff --git a/FS/FS/part_pkg/sesmon_minute.pm b/FS/FS/part_pkg/sesmon_minute.pm index 6af7c0870..9c8dfd1b7 100644 --- a/FS/FS/part_pkg/sesmon_minute.pm +++ b/FS/FS/part_pkg/sesmon_minute.pm @@ -9,17 +9,9 @@ use FS::part_pkg::flat; %info = ( 'name' => 'Base charge plus charge per-minute from the session monitor', + 'shortname' => 'Session monitor (per-minute)', + 'inherit_fields' => [ 'global_Mixin' ], 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_flat' => { 'name' => 'Base monthly charge for this package', - 'default' => 0, - }, - 'unused_credit' => { 'name' => 'Credit the customer for the unused portion'. - ' of service at cancellation', - 'type' => 'checkbox', - }, 'recur_included_min' => { 'name' => 'Minutes included', 'default' => 0, }, @@ -27,9 +19,9 @@ use FS::part_pkg::flat; 'default' => 0, }, }, - 'fieldorder' => [ 'setup_fee', 'recur_flat', 'unused_credit', 'recur_included_min', 'recur_minly_charge' ], + 'fieldorder' => [ 'recur_included_min', 'recur_minly_charge' ], #'setup' => 'what.setup_fee.value', - #'recur' => '\'my $min = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 60 - \' + what.recur_included_min.value + \'; $min = 0 if $min < 0; \' + what.recur_flat.value + \' + \' + what.recur_minly_charge.value + \' * $min;\'', + #'recur' => '\'my $min = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 60 - \' + what.recur_included_min.value + \'; $min = 0 if $min < 0; \' + what.recur_fee.value + \' + \' + what.recur_minly_charge.value + \' * $min;\'', 'weight' => 80, ); @@ -40,16 +32,18 @@ sub calc_recur { $min -= $self->option('recur_included_min'); $min = 0 if $min < 0; - $self->option('recur_flat') + $min * $self->option('recur_minly_charge'); + $self->option('recur_fee') + $min * $self->option('recur_minly_charge'); } +sub can_discount { 0; } + sub is_free_options { qw( setup_fee recur_fee recur_minly_charge ); } sub base_recur { my($self, $cust_pkg) = @_; - $self->option('recur_flat'); + $self->option('recur_fee'); } 1;