From 98a59d3e5f8bcb062e1a442f4cb1fbb5d0cca793 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 13 Jun 2016 17:31:34 +0200 Subject: [PATCH] Refactoring: BankTransaction MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit minimalen aufgeräumt. Alte Copy&Paste doppelte Checks an der Stelle entfernt, die ich gelesen und verstanden habe. --- SL/Controller/BankTransaction.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 0d609959d..d83039f39 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -405,7 +405,7 @@ sub action_save_invoices { $amount_of_transaction -= $sign * $invoice->open_amount; $bank_transaction->invoice_amount($bank_transaction->invoice_amount + $invoice->open_amount); } else { - $amount_of_transaction += $sign * $invoice->open_amount if (!$invoice->is_sales); + $amount_of_transaction += $sign * $invoice->open_amount; $bank_transaction->invoice_amount($bank_transaction->invoice_amount - $invoice->open_amount); } # ... and then pay the invoice @@ -420,8 +420,7 @@ sub action_save_invoices { amount => $amount_of_transaction, payment_type => $payment_type, transdate => $bank_transaction->transdate->to_kivitendo); - $bank_transaction->invoice_amount($bank_transaction->amount) if $invoice->is_sales; - $bank_transaction->invoice_amount($bank_transaction->amount) if !$invoice->is_sales; + $bank_transaction->invoice_amount($bank_transaction->amount); $amount_of_transaction = 0; } -- 2.20.1