X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fdetail_format.pm;h=b072ff58d561830759b92201f79e0b1f0edae436;hb=c2f7d8ba623194ad1fae37b231b2e29b33d05674;hp=2417b3aca4091c49a52157d7e009a03aa07fa39b;hpb=f32ff6851340686b53a757dc56dc3c8831b50395;p=freeside.git diff --git a/FS/FS/detail_format.pm b/FS/FS/detail_format.pm index 2417b3aca..b072ff58d 100644 --- a/FS/FS/detail_format.pm +++ b/FS/FS/detail_format.pm @@ -34,19 +34,19 @@ a subclass. OPTIONS may contain: -- buffer: an arrayref to store details into. This may avoid the need for - a large copy operation at the end of processing. However, since - summary formats will produce nothing until the end of processing, - C must be called after all CDRs have been appended. +- buffer: an arrayref to store details into. This may avoid the need for a +large copy operation at the end of processing. However, since summary formats +will produce nothing until the end of processing, C must be called +after all CDRs have been appended. -- inbound: a flag telling the formatter to format CDRs for display to - the receiving party, rather than the originator. In this case, the - L object will be fetched and its values used for - rated_price, rated_seconds, rated_minutes, and svcnum. This can be - changed with the C method. +- inbound: a flag telling the formatter to format CDRs for display to the +receiving party, rather than the originator. In this case, the +L object will be fetched and its values used for +rated_price, rated_seconds, rated_minutes, and svcnum. This can be changed +with the C method. -- locale: a locale string to use for static text and date formats. This - is optional. +- locale: a locale string to use for static text and date formats. This is +optional. =cut @@ -84,6 +84,8 @@ sub new { =head1 METHODS +=over 4 + =item inbound VALUE Set/get the 'inbound' flag. @@ -96,6 +98,19 @@ sub inbound { $self->{inbound}; } +=item phonenum VALUE + +Set/get the locally meaningful phone number. This is used to tag call details +for presentation on certain kinds of invoices. + +=cut + +sub phonenum { + my $self = shift; + $self->{phonenum} = shift if @_; + $self->{phonenum}; +} + =item append CDRS Takes any number of call detail records (as L objects), @@ -170,6 +185,9 @@ rated_regionname => regionname accountcode => accountcode startdate => startdate +'phonenum' is set to the internal C value set on the formatter +object. + It then calls C on the CDR to obtain a list of detail columns, formats them as a CSV string, and stores that in the 'detail' field. @@ -198,6 +216,7 @@ sub single_detail { 'startdate' => $cdr->startdate, 'format' => 'C', 'detail' => $self->csv->string, + 'phonenum' => $self->phonenum, }); }