X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=0ba6cdfed7be6cd5a9e3e85f88279affa259c335;hp=1f6af40b4beafa258c60875f81dfd419b5d57374;hb=f6036d1338eb1df0fa5c58d358e52d770a7e0330;hpb=f7baea86e2cbb33697aed8287bc32d744accf662 diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 1f6af40b4..0ba6cdfed 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -4151,7 +4151,6 @@ sub _items_accountcode_cdr { 'description' => 'Usage by Account Code', 'post_total' => '', 'summarized' => '', - 'total_generator' => sub { '' }, 'header' => '', }; my @lines; @@ -4188,6 +4187,7 @@ sub _items_accountcode_cdr { ext_description => [], }; + $section->{'amount'} += $amount; $accountcodes{$accountcode}{'amount'} += $amount; $accountcodes{$accountcode}{calls}++; $accountcodes{$accountcode}{duration} += $detail->duration; @@ -4202,7 +4202,9 @@ sub _items_accountcode_cdr { push @lines, $l; } - return ($section,\@lines); + my @sorted_lines = sort { $a->{'description'} <=> $b->{'description'} } @lines; + + return ($section,\@sorted_lines); } sub _items_svc_phone_sections {