From 0a25d5a4019fabab620cae0ff7a0a713d132d2fa Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 18 Jun 2007 14:47:05 +0000 Subject: [PATCH] =?utf8?q?Buchungsliste:=201.=20$form->{sort}=20nicht=20oh?= =?utf8?q?ne=20=C3=9Cberpr=C3=BCfung=20in=20einem=20SQL-Query=20benutzen.?= =?utf8?q?=202.=20Nur=20dann=20mehrere=20Zeilen=20zusammenfassen,=20wenn?= =?utf8?q?=20auch=20ihre=20ID=20=C3=BCbereinstimmen=20(was=20vermutlich=20?= =?utf8?q?nie=20der=20Fall=20sein=20wird,=20aber=20anders=20ist=20es=20sch?= =?utf8?q?licht=20falsch,=20weil=20dann=20Buchungen=20zusammengefasst=20we?= =?utf8?q?rden=20k=C3=B6nnen,=20die=20zu=20unterschiedlichen=20Belegen=20g?= =?utf8?q?eh=C3=B6ren).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/CA.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/CA.pm b/SL/CA.pm index b4680ad7a..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,7 +372,7 @@ sub all_transactions { $ca->{debit} = 0; } - $ca->{index} = $ca->{reference}.$ca->{description}; + $ca->{index} = join "--", map { $ca->{$_} } qw(id reference description); push(@{ $form->{CA} }, $ca); -- 2.20.1