X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fsesmon_hour.pm;h=e608d551060a5af11ef842a7ad4515d7f4872f2a;hb=ad7f49821d40ffd099a45acc32ba91e0e211aede;hp=b80fac3e40b70817df93bcebd0973dbcfa7585a7;hpb=673b9a458d9138523026963df6fa3b4683e09bae;p=freeside.git diff --git a/FS/FS/part_pkg/sesmon_hour.pm b/FS/FS/part_pkg/sesmon_hour.pm index b80fac3e4..e608d5510 100644 --- a/FS/FS/part_pkg/sesmon_hour.pm +++ b/FS/FS/part_pkg/sesmon_hour.pm @@ -9,13 +9,14 @@ use FS::part_pkg::flat; %info = ( 'name' => 'Base charge plus charge per-hour from the session monitor', + 'shortname' => 'Session monitor (per-hour)', 'fields' => { 'setup_fee' => { 'name' => 'Setup fee for this package', 'default' => 0, }, - 'recur_flat' => { 'name' => 'Base monthly charge for this package', - 'default' => 0, - }, + 'recur_fee' => { 'name' => 'Base recurring fee for this package', + 'default' => 0, + }, 'unused_credit' => { 'name' => 'Credit the customer for the unused portion'. ' of service at cancellation', 'type' => 'checkbox', @@ -27,9 +28,9 @@ use FS::part_pkg::flat; 'default' => 0, }, }, - 'fieldorder' => [ 'setup_fee', 'recur_flat', 'unused_credit', 'recur_included_hours', 'recur_hourly_charge' ], + 'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'recur_included_hours', 'recur_hourly_charge' ], #'setup' => 'what.setup_fee.value', - #'recur' => '\'my $hours = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; \' + what.recur_flat.value + \' + \' + what.recur_hourly_charge.value + \' * $hours;\'', + #'recur' => '\'my $hours = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; \' + what.recur_fee.value + \' + \' + what.recur_hourly_charge.value + \' * $hours;\'', 'weight' => 80, ); @@ -40,17 +41,19 @@ sub calc_recur { $hours -= $self->option('recur_included_hours'); $hours = 0 if $hours < 0; - $self->option('recur_flat') + $hours * $self->option('recur_hourly_charge'); + $self->option('recur_fee') + $hours * $self->option('recur_hourly_charge'); } +sub can_discount { 0; } + sub is_free_options { qw( setup_fee recur_fee recur_hourly_charge ); } sub base_recur { my($self, $cust_pkg) = @_; - $self->option('recur_flat'); + $self->option('recur_fee'); } 1;