X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fca.pl;h=229e43004c24b4e5671f244c4dd39e0a9e2ce9e1;hb=e436a6b05600897aed8c5420d44bf4e1b39cb74f;hp=497ee6157483da95df7ec11567853eef6be8bd73;hpb=ec022a581e19d03e34ae31e7ba53ee4dde66ea73;p=kivitendo-erp.git diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl index 497ee6157..229e43004 100644 --- a/bin/mozilla/ca.pl +++ b/bin/mozilla/ca.pl @@ -37,7 +37,7 @@ use POSIX qw(strftime); use SL::CA; use SL::ReportGenerator; -require "bin/mozilla/report_generator.pl"; +require "bin/mozilla/reportgenerator.pl"; 1; @@ -299,6 +299,7 @@ sub list_transactions { my $idx = 0; my %totals = ( 'debit' => 0, 'credit' => 0 ); my %subtotals = ( 'debit' => 0, 'credit' => 0 ); + my ($previous_index, $row_set); foreach my $ca (@{ $form->{CA} }) { $form->{balance} += $ca->{amount}; @@ -320,9 +321,20 @@ sub list_transactions { }; } - $row->{reference}->{link} = build_std_url("script=$ca->{module}.pl", 'action=edit', 'id=' . E($ca->{id}), 'callback'); + if ($ca->{index} ne $previous_index) { + $report->add_data($row_set) if ($row_set); - $report->add_data($row); + $row_set = [ ]; + $previous_index = $ca->{index}; + + $row->{reference}->{link} = build_std_url("script=$ca->{module}.pl", 'action=edit', 'id=' . E($ca->{id}), 'callback'); + + } else { + map { $row->{$_}->{data} = '' } qw(reference description); + $row->{transdate}->{data} = '' if ($form->{sort} eq 'transdate'); + } + + push @{ $row_set }, $row; if (($form->{l_subtotal} eq 'Y') && (($idx == scalar @{ $form->{CA} } - 1)