From: Moritz Bunkus Date: Tue, 3 Sep 2019 11:35:27 +0000 (+0200) Subject: BankTransaction: Sortierungscode vereinfacht X-Git-Tag: release-3.5.6.1~494 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c6db89309a11fe86cedd0533e167db8b4f66754d;p=kivitendo-erp.git BankTransaction: Sortierungscode vereinfacht --- diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 844dad521..36494038d 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -230,11 +230,8 @@ sub action_list { # sort bank transaction proposals by quality (score) of proposal if ($::form->{sort_by} && $::form->{sort_by} eq 'proposal') { - if ($::form->{sort_dir}) { - $bank_transactions = [ sort { $a->{agreement} <=> $b->{agreement} } @{ $bank_transactions } ]; - } else { - $bank_transactions = [ sort { $b->{agreement} <=> $a->{agreement} } @{ $bank_transactions } ]; - } + my $dir = $::form->{sort_dir} ? 1 : -1; + $bank_transactions = [ sort { ($a->{agreement} <=> $b->{agreement}) * $dir } @{ $bank_transactions } ]; } # for testing with t/bank/banktransaction.t :