sub set_charged_party {
my $self = shift;
- unless ( $self->charged_party ) {
+ my $conf = new FS::Conf;
- my $conf = new FS::Conf;
+ unless ( $self->charged_party ) {
if ( $conf->exists('cdr-charged_party-accountcode') && $self->accountcode ){
}
+ my $prefix = $conf->config('cdr-charged_party-truncate_prefix');
+ my $prefix_len = length($prefix);
+ my $trunc_len = $conf->config('cdr-charged_party-truncate_length');
+
+ $self->charged_party( substr($self->charged_party, 0, $trunc_len) )
+ if $prefix_len && $trunc_len
+ && substr($self->charged_party, 0, $prefix_len) eq $prefix;
+
}
=item set_status_and_rated_price STATUS [ RATED_PRICE ]