From f94146fb5ed6819390b33b751279fde41d857d72 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 28 Nov 2016 10:56:59 +0200 Subject: [PATCH] Fix for JSON payment import --- app/Services/ImportService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index eb03ea768d..bb80ba8403 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -171,9 +171,10 @@ class ImportService } foreach ($jsonInvoice['payments'] as $jsonPayment) { - $jsonPayment['client_id'] = $jsonPayment['client'] = $client->id; // TODO: change to client_id once views are updated - $jsonPayment['invoice_id'] = $jsonPayment['invoice'] = $invoice->id; // TODO: change to invoice_id once views are updated + $jsonPayment['invoice_id'] = $invoice->public_id; if (EntityModel::validate($jsonPayment, ENTITY_PAYMENT) === true) { + $jsonPayment['client_id'] = $client->id; + $jsonPayment['invoice_id'] = $invoice->id; $payment = $this->paymentRepo->save($jsonPayment); $this->addSuccess($payment); } else {