From 4c5a5ef941bc2fa800dcb3303532f16fc088b066 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 9 Mar 2017 11:55:11 +0200 Subject: [PATCH] CSV import improvements --- app/Services/ImportService.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index 3409277cd485..5d32feacf09a 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -462,7 +462,7 @@ class ImportService if ($resource = $paymentTransformer->transform($row)) { $data = $this->fractal->createData($resource)->toArray(); - $data['amount'] = min($data['amount'], $row->amount); + $data['amount'] = min($data['amount'], Utils::parseFloat($row->amount)); if (Payment::validate($data) === true) { $this->paymentRepo->save($data); } @@ -824,8 +824,7 @@ class ImportService $this->maps['client'][$name] = $client->id; $this->maps['client_ids'][$client->public_id] = $client->id; } - - if ($name = strtolower(trim($client->getDisplayName()))) { + if ($name = strtolower(trim($client->contacts[0]->email))) { $this->maps['client'][$name] = $client->id; $this->maps['client_ids'][$client->public_id] = $client->id; }