X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1eaf497886107c359dbc2a185f4bede9b7e7f6ea..40d52f50:/bin/mozilla/rp.pl diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 4a548595b..6c8562b46 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -1759,8 +1759,8 @@ sub aging { if ($previous_ctid != $ref->{ctid}) { $row->{statement}->{raw_data} = - $cgi->hidden('-name' => "customer_id_${row_idx}", '-value' => $ref->{ctid}) - . $cgi->checkbox('-name' => "statement_${row_idx}", '-value' => 1, '-label' => '', 'checked' => $ref->{checked}); + $cgi->hidden('-name' => "customer_id_" . ($row_idx + 1), '-value' => $ref->{ctid}) + . $cgi->checkbox('-name' => "statement_" . ($row_idx + 1), '-value' => 1, '-label' => '', 'checked' => $ref->{checked}); $row->{ct}->{data} = $ref->{name}; $row_idx++; @@ -2346,6 +2346,8 @@ sub list_payments { $option = $locale->text('Department') . " : $department"; } + report_generator_set_default_sort('transdate', 1); + RP->payments(\%myconfig, \%$form); my @hidden_variables = qw(account title department reference source memo fromdate todate @@ -2365,14 +2367,17 @@ sub list_payments { ); my %column_alignment = ('paid' => 'right'); - map { $column_defs{$_}->{link} = $href . "&sort=$_" } grep { $_ ne 'paid' } @columns; + foreach my $name (grep { $_ ne 'paid' } @columns) { + my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; + $column_defs{$name}->{link} = $href . "&sort=${name}&sortdir=$sortdir"; + } my @options; if ($form->{fromdate}) { - push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{fromdate}, 1); + push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{fromdate}, 1); } if ($form->{todate}) { - push @options, $locale->text('bis') . " " . $locale->date(\%myconfig, $form->{todate}, 1); + push @options, $locale->text('bis') . " " . $locale->date(\%myconfig, $form->{todate}, 1); } my $report = SL::ReportGenerator->new(\%myconfig, $form); @@ -2392,7 +2397,7 @@ sub list_payments { $report->set_export_options('list_payments', @hidden_variables); - $report->set_sort_indicator($form->{sort}, 1); + $report->set_sort_indicator($form->{sort}, $form->{sortdir}); my $total_paid = 0;