- if ($form->{l_subtotal_subsort} eq 'Y') {
- push @{ $row_set }, create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, 'listsubsortsubtotal', $ar->{ $form->{'subsort'} }) ;
- push @{ $row_set }, insert_empty_row() if $form->{l_parts} and $addemptylines;
- };
+ $report->add_data(create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, $form->{l_parts} ? 'listsubtotal' : undef, $ar->{ $form->{'subsort'} }));
+ $report->add_data({ %empty_row }) if $form->{l_parts} and $addemptylines;