projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b7a6c44
)
make CDR invoice details appear chronologically on invoices, for voip_cdr, RT10960
author
levinse
<levinse>
Fri, 14 Jan 2011 20:08:17 +0000
(20:08 +0000)
committer
levinse
<levinse>
Fri, 14 Jan 2011 20:08:17 +0000
(20:08 +0000)
FS/FS/part_pkg/voip_cdr.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/voip_cdr.pm
b/FS/FS/part_pkg/voip_cdr.pm
index
8384c8c
..
fea38c1
100644
(file)
--- a/
FS/FS/part_pkg/voip_cdr.pm
+++ b/
FS/FS/part_pkg/voip_cdr.pm
@@
-387,6
+387,8
@@
sub calc_usage {
); # $last_bill, $$sdate )
$options{'by_svcnum'} = 1 if $svc_field eq 'svcnum';
); # $last_bill, $$sdate )
$options{'by_svcnum'} = 1 if $svc_field eq 'svcnum';
+ my @invoice_details_sort;
+
foreach my $cdr (
$svc_x->get_cdrs( %options )
) {
foreach my $cdr (
$svc_x->get_cdrs( %options )
) {
@@
-748,7
+750,7
@@
sub calc_usage {
warn " adding details on charge to invoice: [ ".
join(', ', @{$call_details} ). " ]"
if ( $DEBUG && ref($call_details) );
warn " adding details on charge to invoice: [ ".
join(', ', @{$call_details} ). " ]"
if ( $DEBUG && ref($call_details) );
- push @
$details, $call_details; #\@call_details,
+ push @
invoice_details_sort, [ $call_details, $cdr->calldate_unix ];
}
# if the customer flag is on, call "downstream_csv" or something
}
# if the customer flag is on, call "downstream_csv" or something
@@
-766,6
+768,11
@@
sub calc_usage {
}
} # $cdr
}
} # $cdr
+
+ my @sorted_invoice_details = sort { @{$a}[1] <=> @{$b}[1] } @invoice_details_sort;
+ foreach my $sorted_call_detail ( @sorted_invoice_details ) {
+ push @$details, @{$sorted_call_detail}[0];
+ }
} # $cust_svc
} # $cust_svc