X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr.pm;h=8ccf7af63dce2bfede1515f5bbcca5e9860f03ab;hb=091e39d6952f3ae61b4993b19643fec6e4a52979;hp=1a36660996f18389771280d0bb4a5b1fac7d9a86;hpb=289958e5f402e896e561e6911081b9cd36c4c098;p=freeside.git diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index 1a3666099..8ccf7af63 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -216,6 +216,7 @@ sub table_info { #'upstream_rateplanid' => '', #'ratedetailnum' => '', 'rated_price' => 'Rated price', + 'rated_cost' => 'Rated cost', #'distance' => '', #'islocal' => '', #'calltypenum' => '', @@ -468,7 +469,9 @@ Sets the status and rated price. Available options are: inbound, rated_pretty_dst, rated_regionname, rated_seconds, rated_minutes, rated_granularity, rated_ratedetailnum, -rated_classnum, rated_ratename. +rated_classnum, rated_ratename. If rated_ratedetailnum is provided, +will also set a recalculated L in the rated_cost field +after the other fields are set (does not work with inbound.) If there is an error, returns the error, otherwise returns false. @@ -506,6 +509,8 @@ sub set_status_and_rated_price { qw( pretty_dst regionname seconds minutes granularity ratedetailnum classnum ratename ); $self->svcnum($svcnum) if $svcnum; + $self->rated_cost($self->rate_cost) if $opt{'rated_ratedetailnum'}; + return $self->replace(); } @@ -1463,7 +1468,7 @@ as keys (for use with part_pkg::voip_cdr) and "pretty" format names as values. sub invoice_formats { map { ($_ => $export_names{$_}->{'name'}) } grep { $export_names{$_}->{'invoice_header'} } - keys %export_names; + sort keys %export_names; } =item invoice_header FORMAT