From: Jan Büren Date: Fri, 1 Mar 2019 14:04:06 +0000 (+0100) Subject: BankTransaction: weniger im Controller rechnen -> ausgelagert in Objekt X-Git-Tag: release-3.5.4~119 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d2e078315810c382a8f8d331849fceedbcc7dda7;p=kivitendo-erp.git BankTransaction: weniger im Controller rechnen -> ausgelagert in Objekt s.a. Commit davor. Redundanzen hier direkt vorbeugen. --- 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',