From: Jan Büren Date: Mon, 13 Jun 2016 15:31:34 +0000 (+0200) Subject: Refactoring: BankTransaction X-Git-Tag: release-3.4.1~57 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=98a59d3e5f8bcb062e1a442f4cb1fbb5d0cca793;p=kivitendo-erp.git Refactoring: BankTransaction minimalen aufgeräumt. Alte Copy&Paste doppelte Checks an der Stelle entfernt, die ich gelesen und verstanden habe. --- 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; }