fix UI bugs in accountcode billing implementation, RT12181
[freeside.git] / FS / FS / cust_bill.pm
index 3f94796..1f6af40 100644 (file)
@@ -2832,8 +2832,10 @@ sub print_generic {
     if ($conf->exists('voip-cust_accountcode_cdr') && $cust_main->accountcode_cdr) {
       my ($accountcode_section, $accountcode_lines) =
         $self->_items_accountcode_cdr($escape_function_nonbsp,$format);
-      push @{$late_sections}, $accountcode_section;
-      push @detail_items, @$accountcode_lines;
+      if ( scalar(@$accountcode_lines) ) {
+          push @{$late_sections}, $accountcode_section;
+          push @detail_items, @$accountcode_lines;
+      }
     }
   }else{
     push @sections, { 'description' => '', 'subtotal' => '' };