- if ($form->{description}) {
- $href .= "&description=".$form->escape($form->{description});
- $callback .= "&description=".$form->escape($form->{description},1);
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Description')." : $form->{description}";
- }
- if ($form->{notes}) {
- $href .= "¬es=".$form->escape($form->{notes});
- $callback .= "¬es=".$form->escape($form->{notes},1);
- $option .= "\n<br>" if $option;
- $option .= $locale->text('Notes')." : $form->{notes}";
- }
-
- if ($form->{datefrom}) {
- $href .= "&datefrom=$form->{datefrom}";
- $callback .= "&datefrom=$form->{datefrom}";
- $option .= "\n<br>" if $option;
- $option .= $locale->text('From')." ".$locale->date(\%myconfig, $form->{datefrom}, 1);
- }
- if ($form->{dateto}) {
- $href .= "&dateto=$form->{dateto}";
- $callback .= "&dateto=$form->{dateto}";
- if ($form->{datefrom}) {
- $option .= " ";
- } else {
- $option .= "\n<br>" if $option;
- }
- $option .= $locale->text('Bis')." ".$locale->date(\%myconfig, $form->{dateto}, 1);
+
+ my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
+ print URL $callback;
+ close URL;
+
+ $form->{l_credit_accno} = 'Y';
+ $form->{l_debit_accno} = 'Y';
+ $form->{l_credit_tax} = 'Y';
+ $form->{l_debit_tax} = 'Y';
+# $form->{l_gldate} = 'Y'; # Spalte mit gldate immer anzeigen
+ $form->{l_credit_tax_accno} = 'Y';
+ $form->{l_datesort} = 'Y';
+ $form->{l_debit_tax_accno} = 'Y';
+ $form->{l_balance} = $form->{accno} ? 'Y' : '';
+
+ my %column_defs = (
+ 'id' => { 'text' => $locale->text('ID'), },
+ 'transdate' => { 'text' => $locale->text('Invoice Date'), },
+ 'gldate' => { 'text' => $locale->text('Booking Date'), },
+ 'reference' => { 'text' => $locale->text('Reference'), },
+ 'source' => { 'text' => $locale->text('Source'), },
+ 'description' => { 'text' => $locale->text('Description'), },
+ 'notes' => { 'text' => $locale->text('Notes'), },
+ 'debit' => { 'text' => $locale->text('Debit'), },
+ 'debit_accno' => { 'text' => $locale->text('Debit Account'), },
+ 'credit' => { 'text' => $locale->text('Credit'), },
+ 'credit_accno' => { 'text' => $locale->text('Credit Account'), },
+ 'debit_tax' => { 'text' => $locale->text('Debit Tax'), },
+ 'debit_tax_accno' => { 'text' => $locale->text('Debit Tax Account'), },
+ 'credit_tax' => { 'text' => $locale->text('Credit Tax'), },
+ 'credit_tax_accno' => { 'text' => $locale->text('Credit Tax Account'), },
+ 'balance' => { 'text' => $locale->text('Balance'), },
+ 'projectnumbers' => { 'text' => $locale->text('Project Numbers'), },
+ 'employee' => { 'text' => $locale->text('Employee'), },
+ );
+
+ foreach my $name (qw(id transdate gldate reference description debit_accno credit_accno debit_tax_accno credit_tax_accno)) {
+ my $sortname = $name =~ m/accno/ ? 'accno' : $name;
+ my $sortdir = $sortname eq $form->{sort} ? 1 - $form->{sortdir} : $form->{sortdir};
+ $column_defs{$name}->{link} = $callback . "&sort=$sortname&sortdir=$sortdir";