Revision aa949f27
Von Jan Büren vor mehr als 8 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
397 | 397 |
last; |
398 | 398 |
} |
399 | 399 |
# pay invoice or go to the next bank transaction if the amount is not sufficiently high |
400 |
if ($invoice->amount_open <= $amount_of_transaction) {
|
|
400 |
if ($invoice->open_amount <= $amount_of_transaction) {
|
|
401 | 401 |
$invoice->pay_invoice(chart_id => $bank_transaction->local_bank_account->chart_id, |
402 | 402 |
trans_id => $invoice->id, |
403 |
amount => $invoice->amount_open,
|
|
403 |
amount => $invoice->open_amount,
|
|
404 | 404 |
payment_type => $payment_type, |
405 | 405 |
transdate => $bank_transaction->transdate->to_kivitendo); |
406 | 406 |
if ($invoice->is_sales) { |
407 |
$amount_of_transaction -= $sign * $invoice->amount_open;
|
|
408 |
$bank_transaction->invoice_amount($bank_transaction->invoice_amount + $invoice->amount_open);
|
|
407 |
$amount_of_transaction -= $sign * $invoice->open_amount;
|
|
408 |
$bank_transaction->invoice_amount($bank_transaction->invoice_amount + $invoice->open_amount);
|
|
409 | 409 |
} else { |
410 |
$amount_of_transaction += $sign * $invoice->amount_open if (!$invoice->is_sales);
|
|
411 |
$bank_transaction->invoice_amount($bank_transaction->invoice_amount - $invoice->amount_open);
|
|
410 |
$amount_of_transaction += $sign * $invoice->open_amount if (!$invoice->is_sales);
|
|
411 |
$bank_transaction->invoice_amount($bank_transaction->invoice_amount - $invoice->open_amount);
|
|
412 | 412 |
} |
413 | 413 |
} else { |
414 | 414 |
$invoice->pay_invoice(chart_id => $bank_transaction->local_bank_account->chart_id, |
Auch abrufbar als: Unified diff
Feature Kontoauszug verbuchen - nur maximal offene Beträge
amount_open -> open_amount - richtige Helper-Funktion aufrufen