X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcdr.pm;h=b3cceb4aab5e4dc12471f59c2e598d3b75513dd8;hp=775c79114a9fc4b06b18021a05fe3dce034a56e7;hb=fa572d76cce0784de0bc15939e6eaf8e06f3f8f6;hpb=2b2dd969f3c18751afc583ad1e836ab8e6f73b5d diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index 775c79114..b3cceb4aa 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(); } @@ -541,6 +546,9 @@ sub parse_number { my $field = $options{column} || 'dst'; my $intl = $options{international_prefix} || '011'; + # Still, don't break anyone's CDR rating if they have an empty string in + # there. Require an explicit statement that there's no prefix. + $intl = '' if lc($intl) eq 'none'; my $countrycode = ''; my $number = $self->$field();