From d2e078315810c382a8f8d331849fceedbcc7dda7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 1 Mar 2019 15:04:06 +0100 Subject: [PATCH] BankTransaction: weniger im Controller rechnen -> ausgelagert in Objekt s.a. Commit davor. Redundanzen hier direkt vorbeugen. --- SL/Controller/BankTransaction.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 2b338318f..7c94f3c0d 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -563,9 +563,7 @@ sub save_single_bank_transaction { my $worker = sub { my $bt_id = $data{bank_transaction_id}; my $sign = $bank_transaction->amount < 0 ? -1 : 1; - my $amount_of_transaction = $sign * $bank_transaction->amount; - my $assigned_amount = $sign * $bank_transaction->invoice_amount; - my $not_assigned_amount = $amount_of_transaction - $assigned_amount; + my $not_assigned_amount = $bank_transaction->not_assigned_amount; my $payment_received = $bank_transaction->amount > 0; my $payment_sent = $bank_transaction->amount < 0; @@ -614,7 +612,7 @@ sub save_single_bank_transaction { $n_invoices++ ; - if (!$amount_of_transaction && $invoice->open_amount) { + if (!$not_assigned_amount && $invoice->open_amount) { return { %data, result => 'error', -- 2.20.1