X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr.pm;h=65ca50b29e18c61a73d447797d63d9b47d57a0f6;hb=a2253aacd9b6c142236fb800f1c74b04510000f9;hp=478dcff6bfeb55e9350afa35a2de27ce921f41e4;hpb=c6815d4041610785099c820df097326a70c8ce41;p=freeside.git diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index 478dcff6b..65ca50b29 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -525,6 +525,10 @@ my %export_names = ( 'invoice_header' => "Date,Time,Called From,Destination,Duration,Price", #"Date,Time,Name,Called From,Destination,Duration,Price", }, + 'basic' => { + 'name' => 'Basic', + 'invoice_header' => "Date/Time,Called Number,Min/Sec,Price", + }, 'default' => { 'name' => 'Default', 'invoice_header' => 'Date,Time,Number,Destination,Duration,Price', @@ -548,8 +552,7 @@ sub export_formats { my $conf = new FS::Conf; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; - # This is now smarter, and shows the call duration in the - # largest units that accurately reflect the granularity. + # call duration in the largest units that accurately reflect the granularity my $duration_sub = sub { my($cdr, %opt) = @_; my $sec = $opt{seconds} || $cdr->billsec; @@ -558,7 +561,9 @@ sub export_formats { return '1 call'; } elsif ( $opt{granularity} == 60 ) {#full minutes - return sprintf("%.0fm",$sec/60); + my $min = int($sec/60); + $min++ if $sec%60; + return $min.'m'; } else { #anything else return sprintf("%dm %ds", $sec/60, $sec%60); @@ -585,6 +590,12 @@ sub export_formats { #sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE ], + 'basic' => [ + sub { time2str('%d %b - %I:%M %p', shift->calldate_unix) }, + 'dst', + $duration_sub, + sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE + ], 'default' => [ #DATE