X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCA.pm;h=76d2b320a5580cb202d3f9beb4be9ee2a27d411a;hb=0a4891e33e1ee05dd0363d985fb1a2205e25c63c;hp=089bcdc19e5b9ee1fddcda82ce9216d77d5ce319;hpb=cbebaf93b5864f5314ccee0ebc0a235d2d58b662;p=kivitendo-erp.git diff --git a/SL/CA.pm b/SL/CA.pm index 089bcdc19..76d2b320a 100644 --- a/SL/CA.pm +++ b/SL/CA.pm @@ -347,7 +347,9 @@ sub all_transactions { $union = qq|UNION ALL|; } - $query .= qq|ORDER BY | . $form->{sort}; + my $sort = grep({ $form->{sort} eq $_ } qw(transdate reference description)) ? $form->{sort} : 'transdate'; + + $query .= qq|ORDER BY $sort|; $sth = prepare_execute_query($form, $dbh, $query, @values); $form->{CA} = []; @@ -370,6 +372,8 @@ sub all_transactions { $ca->{debit} = 0; } + $ca->{index} = join "--", map { $ca->{$_} } qw(id reference description); + push(@{ $form->{CA} }, $ca); }