X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FReportGenerator.pm;h=e23bf77865ccbb189ca537770ad36a3d3c8440cd;hb=91ee6cb28c37fe07d001da04808f9c49e1959502;hp=6c61acbc0a992acf4564aac7dfc0f2eb25d10160;hpb=76c486e3bf157e844b0cf11828d55dae2cb7e439;p=kivitendo-erp.git diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 6c61acbc0..e23bf7786 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -1,7 +1,6 @@ package SL::ReportGenerator; -#use strict; - +use Data::Dumper; use Encode; use IO::Wrap; use List::Util qw(max); @@ -338,7 +337,7 @@ sub prepare_html_content { next; } - my $col = $row->{$col_name}; + my $col = $row->{$col_name} || { data => [] }; $col->{CELL_ROWS} = [ ]; foreach my $i (0 .. scalar(@{ $col->{data} }) - 1) { push @{ $col->{CELL_ROWS} }, { @@ -513,7 +512,7 @@ sub generate_pdf_content { my $col_idx = 0; foreach my $col_name (@visible_columns) { my $col = $row->{$col_name}; - push @{ $data_row }, $self->_decode_text(join("\n", @{ $col->{data} })); + push @{ $data_row }, $self->_decode_text(join("\n", @{ $col->{data} || [] })); $column_props[$col_idx]->{justify} = 'right' if ($col->{align} eq 'right'); @@ -762,7 +761,7 @@ sub generate_csv_content { next; } - my $num_output = ($col->{colspan} && ($col->{colspan} > 1)) ? $col->{colspan} : 1; + my $num_output = ($row->{$col}{colspan} && ($row->{$col}->{colspan} > 1)) ? $row->{$col}->{colspan} : 1; $skip_next = $num_output - 1; push @data, join($eol, map { s/\r?\n/$eol/g; $_ } @{ $row->{$col}->{data} });