die "$me error combining ".$self->csv->error_input."\n"
if !$status;
- my $rated_price = $cdr->rated_price;
- $rated_price = 0 if $cdr->freesidestatus eq 'no-charge';
+ my $object = $self->{inbound} ? $cdr->cdr_termination(1) : $cdr;
+ my $price = $object->rated_price if $object;
+ $price = 0 if $cdr->freesidestatus eq 'no-charge';
FS::cust_bill_pkg_detail->new( {
- 'amount' => $rated_price,
+ 'amount' => $price,
'classnum' => $cdr->rated_classnum,
'duration' => $cdr->rated_seconds,
'regionname' => $cdr->rated_regionname,
my $cdr = shift;
my $object = $self->{inbound} ? $cdr->cdr_termination(1) : $cdr;
my $sec = $object->rated_seconds if $object;
+ $sec ||= 0;
# XXX termination objects don't have rated_granularity so this may
# result in inbound CDRs being displayed as min/sec when they shouldn't.
# Should probably fix this.