'instead of a detailed list',
'type' => 'checkbox',
},
- 'no_prorate' => { 'name' => 'Don\'t prorate recurring fees on services '.
- 'active for a partial month',
- 'type' => 'checkbox',
- },
},
'fieldorder' => [ 'svc_setup_fee', 'svc_recur_fee',
'summarize_svcs', 'no_prorate' ],
my $svc_recur_fee = $self->option('svc_recur_fee');
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
- $str .= " , bulk" if $str;
+ $str .= ", bulk " if $str;
$str .= ": $money_char" . $svc_setup_fee . " one-time per service"
if $svc_setup_fee;
$str .= ", " if ($svc_setup_fee && $svc_recur_fee);
#some false laziness-ish w/agent.pm... not a lot
sub calc_recur {
- my($self, $cust_pkg, $sdate, $details ) = @_;
+ my($self, $cust_pkg, $sdate, $details, $param ) = @_;
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
foreach my $cust_svc ( $self->_bulk_cust_svc( $cust_pkg, $sdate ) ) {
my @label = $cust_svc->label_long( $$sdate, $last_bill );
- die "fatal: no label found, wtf?" unless scalar(@label); #?
+ die "fatal: no label found for svcnum ". $cust_svc->svcnum
+ unless scalar(@label); #?
my $svc_details = $label[0]. ': '. $label[1]. ': ';
$part_svc_label{$cust_svc->svcpart} ||= $label[0];
}
}
- sprintf('%.2f', $self->base_recur($cust_pkg, $sdate) + $total_svc_charge );
-}
+ my $charge = $self->base_recur($cust_pkg, $sdate) + $total_svc_charge;
-sub can_discount { 0; }
+ $param->{'override_charges'} = $total_svc_charge / $self->freq;
+ my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
+
+ sprintf('%.2f', $charge - $discount );
+}
sub hide_svc_detail { 1; }