Refactoring: BankTransaction
authorJan Büren <jan@kivitendo-premium.de>
Mon, 13 Jun 2016 15:31:34 +0000 (17:31 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Mon, 13 Jun 2016 15:31:34 +0000 (17:31 +0200)
minimalen aufgeräumt. Alte Copy&Paste doppelte Checks
an der Stelle entfernt, die ich gelesen und verstanden habe.

SL/Controller/BankTransaction.pm

index 0d60995..d83039f 100644 (file)
@@ -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;
       }