1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 14:42:42 +01:00

Fix for JSON payment import

This commit is contained in:
Hillel Coren 2016-11-28 10:56:59 +02:00
parent 5de414ee4d
commit f94146fb5e

View File

@ -171,9 +171,10 @@ class ImportService
} }
foreach ($jsonInvoice['payments'] as $jsonPayment) { foreach ($jsonInvoice['payments'] as $jsonPayment) {
$jsonPayment['client_id'] = $jsonPayment['client'] = $client->id; // TODO: change to client_id once views are updated $jsonPayment['invoice_id'] = $invoice->public_id;
$jsonPayment['invoice_id'] = $jsonPayment['invoice'] = $invoice->id; // TODO: change to invoice_id once views are updated
if (EntityModel::validate($jsonPayment, ENTITY_PAYMENT) === true) { if (EntityModel::validate($jsonPayment, ENTITY_PAYMENT) === true) {
$jsonPayment['client_id'] = $client->id;
$jsonPayment['invoice_id'] = $invoice->id;
$payment = $this->paymentRepo->save($jsonPayment); $payment = $this->paymentRepo->save($jsonPayment);
$this->addSuccess($payment); $this->addSuccess($payment);
} else { } else {