Spalte "Transfertyp" auch bei CSV- und PDF-Export ausgeben.
[kivitendo-erp.git] / bin / mozilla / rp.pl
index 62abf66..5099c89 100644 (file)
@@ -52,10 +52,6 @@ require "bin/mozilla/reportgenerator.pl";
 # should there be any missing vars, declare them globally
 use strict;
 
-1;
-
-# end of main
-
 # this is for our long dates
 # $locale->text('January')
 # $locale->text('February')
@@ -158,9 +154,9 @@ sub report {
 
   # get departments
   $form->all_departments(\%myconfig);
-  if (@{ $form->{all_departments} }) {
+  if (@{ $form->{all_departments} || [] }) {
     $form->{selectdepartment} = "<option>\n";
-    map { $form->{selectdepartment} .= "<option>$_->{description}--$_->{id}\n" } @{ $form->{all_departments} };
+    map { $form->{selectdepartment} .= "<option>$_->{description}--$_->{id}\n" } @{ $form->{all_departments} || [] };
   }
 
   my $department = qq|
@@ -1300,7 +1296,7 @@ sub generate_trial_balance {
   RP->trial_balance(\%myconfig, \%$form, 'beginning_balances' => 1);
 
 
-  $form->{rowcount} = scalar @{ $form->{TB} };
+  $form->{rowcount} = scalar @{ $form->{TB} || [] };
   $form->{title} = sprintf($locale->text('Trial balance between %s and %s'), $form->{fromdate}, $form->{todate});
 
   my @columns = (
@@ -2772,3 +2768,4 @@ sub generate_bwa {
   $main::lxdebug->leave_sub();
 }
 
+1;