+ push @options, $period;
+
+ my @columns = qw(transdate reference description gegenkonto debit credit ustkonto ustrate);
+ my %column_defs = (
+ 'transdate' => { 'text' => $locale->text('Date'), },
+ 'reference' => { 'text' => $locale->text('Reference'), },
+ 'description' => { 'text' => $locale->text('Description'), },
+ 'debit' => { 'text' => $locale->text('Debit'), },
+ 'credit' => { 'text' => $locale->text('Credit'), },
+ 'gegenkonto' => { 'text' => $locale->text('Gegenkonto'), },
+ 'ustkonto' => { 'text' => $locale->text('USt-Konto'), },
+ 'ustrate' => { 'text' => $locale->text('Satz %'), },
+ );
+ my %column_alignment = map { $_ => 'right' } qw(debit credit);
+
+ @custom_headers = ();
+ # Zeile 1:
+ push @custom_headers, [
+ { 'text' => 'Letzte Buchung', },
+ { 'text' => 'EB-Wert', },
+ { 'text' => 'Saldo alt', 'colspan' => 2, },
+ { 'text' => 'Jahresverkehrszahlen alt', 'colspan' => 2, },
+ { 'text' => '', 'colspan' => 2, },
+ ];
+ push @custom_headers, [
+ { 'text' => $form->{last_transaction}, },
+ { 'text' => $eb_string, },
+ { 'text' => $saldo_old, 'colspan' => 2, },
+ { 'text' => $form->format_amount(\%myconfig, abs($form->{old_balance_debit}), 2) . " S", },
+ { 'text' => $form->format_amount(\%myconfig, $form->{old_balance_credit}, 2) . " H", },
+ { 'text' => '', 'colspan' => 2, },
+ ];
+ # Zeile 2:
+ push @custom_headers, [
+ { 'text' => $locale->text('Date'), },
+ { 'text' => $locale->text('Reference'), },
+ { 'text' => $locale->text('Description'), },
+ { 'text' => $locale->text('Gegenkonto'), },
+ { 'text' => $locale->text('Debit'), },
+ { 'text' => $locale->text('Credit'), },
+ { 'text' => $locale->text('USt-Konto'), },
+ { 'text' => $locale->text('Satz %'), },
+ ];
+
+
+
+ my @hidden_variables = qw(accno fromdate todate description accounttype l_heading l_subtotal department projectnumber project_id sort);
+
+ my $link = build_std_url('action=list_transactions', grep { $form->{$_} } @hidden_variables);
+ map { $column_defs{$_}->{link} = $link . "&sort=$_" } qw(transdate reference description);
+
+ $form->{callback} = $link . '&sort=' . E($form->{sort});
+
+ my $report = SL::ReportGenerator->new(\%myconfig, $form);
+ $report->set_custom_headers(@custom_headers);
+
+ $report->set_options('top_info_text' => join("\n", @options),
+ 'output_format' => 'HTML',
+ 'title' => $form->{title},
+ 'attachment_basename' => $locale->text('list_of_transactions') . strftime('_%Y%m%d', localtime time),
+ 'std_column_visibility' => 1,
+ );
+ $report->set_options_from_form();
+
+ $report->set_columns(%column_defs);
+ $report->set_column_order(@columns);
+
+ $report->set_export_options('list_transactions', @hidden_variables);
+
+ $report->set_sort_indicator($form->{sort}, 1);
+
+ $column_defs->{balance}->{visible} = $form->{accno} ? 1 : 0;
+
+ my $ml = ($form->{category} =~ /(A|E)/) ? -1 : 1;
+
+
+ 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} }) {
+
+ foreach (qw(debit credit)) {
+ $subtotals{$_} += $ca->{$_};
+ $totals{$_} += $ca->{$_};
+ $ca->{$_} = $form->format_amount(\%myconfig, $ca->{$_}, 2) if ($ca->{$_} != 0);
+ }