1 package FS::part_pkg::sesmon_hour;
4 use vars qw(@ISA %info);
5 #use FS::Record qw(qsearch qsearchs);
6 use FS::part_pkg::flat;
8 @ISA = qw(FS::part_pkg::flat);
11 'disabled' => 1, #internal session db deprecated (or at least on hold)
12 'name' => 'Base charge plus charge per-hour from the session monitor',
13 'shortname' => 'Session monitor (per-hour)',
14 'inherit_fields' => [ 'global_Mixin' ],
16 'recur_included_hours' => { 'name' => 'Hours included',
19 'recur_hourly_charge' => { 'name' => 'Additional charge per hour',
23 'fieldorder' => [ 'recur_included_hours', 'recur_hourly_charge' ],
24 #'setup' => 'what.setup_fee.value',
25 #'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;\'',
31 my $str = $self->SUPER::price_info;
32 $str .= " plus usage" if $str;
37 my($self, $cust_pkg ) = @_;
39 my $hours = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 3600;
40 $hours -= $self->option('recur_included_hours');
41 $hours = 0 if $hours < 0;
43 $self->option('recur_fee') + $hours * $self->option('recur_hourly_charge');
47 sub can_discount { 0; }
50 qw( setup_fee recur_fee recur_hourly_charge );
54 my($self, $cust_pkg) = @_;
55 $self->option('recur_fee');