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 'name' => 'Base charge plus charge per-hour from the session monitor',
13 'setup_fee' => { 'name' => 'Setup fee for this package',
16 'recur_flat' => { 'name' => 'Base recurring fee for this package',
19 'unused_credit' => { 'name' => 'Credit the customer for the unused portion'.
20 ' of service at cancellation',
23 'recur_included_hours' => { 'name' => 'Hours included',
26 'recur_hourly_charge' => { 'name' => 'Additional charge per hour',
30 'fieldorder' => [ 'setup_fee', 'recur_flat', 'unused_credit', 'recur_included_hours', 'recur_hourly_charge' ],
31 #'setup' => 'what.setup_fee.value',
32 #'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;\'',
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_flat') + $hours * $self->option('recur_hourly_charge');
48 qw( setup_fee recur_fee recur_hourly_charge );
52 my($self, $cust_pkg) = @_;
53 $self->option('recur_flat');