X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fdetail_format.pm;h=88cc02f83deca63a491ed3ba8980d4f67ba66424;hb=40432379f04f6206b8e9a76a80c592887c60f10c;hp=144aaa75f85484e105c63655ef782aa7988bf5e6;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/FS/FS/detail_format.pm b/FS/FS/detail_format.pm index 144aaa75f..88cc02f83 100644 --- a/FS/FS/detail_format.pm +++ b/FS/FS/detail_format.pm @@ -171,8 +171,12 @@ sub single_detail { die "$me error combining ".$self->csv->error_input."\n" if !$status; + 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' => $cdr->rated_price, + 'amount' => $price, 'classnum' => $cdr->rated_classnum, 'duration' => $cdr->rated_seconds, 'regionname' => $cdr->rated_regionname, @@ -231,6 +235,7 @@ sub duration { 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. @@ -250,6 +255,7 @@ sub price { my $cdr = shift; my $object = $self->{inbound} ? $cdr->cdr_termination(1) : $cdr; my $price = $object->rated_price if $object; + $price = '0.00' if $object->freesidestatus eq 'no-charge'; length($price) ? $self->money_char . $price : ''; }