X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcdr.pm;h=190ffe2b5cb016eee377913f446e2a36ae7ae96a;hp=1507dde957987e78de63c68dee7d3a5609b53311;hb=392d0c1164bf5d222826164195502906252ba2dd;hpb=fdb9aecd3c4bcaef6f13becbe209e7cd7475204b diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index 1507dde95..190ffe2b5 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -573,6 +573,14 @@ my %export_names = ( 'name' => 'Default with description field as destination', 'invoice_header' => 'Caller,Date,Time,Number,Destination,Duration,Price', }, + 'sum_duration' => { + 'name' => 'Summary (one line per service, with duration)', + 'invoice_header' => 'Caller,Calls,Minutes,Price', + }, + 'sum_count' => { + 'name' => 'Summary (one line per service, with count)', + 'invoice_header' => 'Caller,Messages,Price', + }, ); my %export_formats = (); @@ -622,6 +630,19 @@ sub export_formats { #sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE ], + 'sum_duration' => [ + # for summary formats, the CDR is a fictitious object containing the + # total billsec and the phone number of the service + 'src', + sub { my($cdr, %opt) = @_; $opt{count} }, + sub { my($cdr, %opt) = @_; int($opt{seconds}/60).'m' }, + sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, + ], + 'sum_count' => [ + 'src', + sub { my($cdr, %opt) = @_; $opt{count} }, + sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, + ], 'basic' => [ sub { time2str('%d %b - %I:%M %p', shift->calldate_unix) }, 'dst', @@ -672,6 +693,8 @@ sub export_formats { =item downstream_csv OPTION => VALUE ... +Returns a string of formatted call details for display on an invoice. + Options: format