mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes when importing invoices with associated payments. Ensure we use the correct applied amount
This commit is contained in:
parent
ff9539a1b8
commit
951e460c5a
@ -39,7 +39,7 @@ class StorePaymentRequest extends Request
|
|||||||
public function prepareForValidation()
|
public function prepareForValidation()
|
||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
nlog($input);
|
||||||
$invoices_total = 0;
|
$invoices_total = 0;
|
||||||
$credits_total = 0;
|
$credits_total = 0;
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ class BaseImport
|
|||||||
$payment_data['invoices'] = [
|
$payment_data['invoices'] = [
|
||||||
[
|
[
|
||||||
'invoice_id' => $invoice->id,
|
'invoice_id' => $invoice->id,
|
||||||
'amount' => $payment_data['amount'] ?? null,
|
'amount' => min($invoice->amount, $payment_data['amount']) ?? null,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user