Die summen Abfrage erzeugt auch Werte ohne pos_ustva (category)
Diese brauchen nicht weiter verarbeitet zu werden.
   $sth->execute || $form->dberror($query);
 
   while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
-    # Bug 365 solved?!
+    next unless $ref->{$category};
     $ref->{amount} *= -1;
     $form->{ $ref->{$category} } += $ref->{amount};
   }
 
 
   } else  # Outputformat for generic output
   {
-
+    die ("not used anymore");
     $form->{USTVA} = [];
-
     if ( $form->{format} eq 'generic') { # Formatierungen für HTML Ausgabe
 
       my $rec_ref = {};
   $form->{templates} = "doc" if ( $form->{type} eq 'help' );
 
   if ($form->{format} eq 'generic'){
-
+    die ("not used anymore");
     $form->header();
 
     my $template_ref = {
     print($form->parse_html_template('ustva/generic_taxreport', $template_ref));
 
   } elsif ( $form->{format} eq 'elstertaxbird' ) {
+   die ("not used anymore");
    $form->parse_template(\%myconfig);
   } else
   {