From a9b511738f516fb5f4e89ebb9f7bd7da2d8b5753 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 20 Nov 2019 08:43:05 +0200 Subject: [PATCH] Import currency fix --- app/Ninja/Repositories/ClientRepository.php | 2 +- database/seeds/CurrenciesSeeder.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Ninja/Repositories/ClientRepository.php b/app/Ninja/Repositories/ClientRepository.php index 10d8de1421a8..9a44397103d5 100644 --- a/app/Ninja/Repositories/ClientRepository.php +++ b/app/Ninja/Repositories/ClientRepository.php @@ -103,7 +103,7 @@ class ClientRepository extends BaseRepository } // convert currency code to id - if (isset($data['currency_code'])) { + if (isset($data['currency_code']) && $data['currency_code']) { $currencyCode = strtolower($data['currency_code']); $currency = Cache::get('currencies')->filter(function ($item) use ($currencyCode) { return strtolower($item->code) == $currencyCode; diff --git a/database/seeds/CurrenciesSeeder.php b/database/seeds/CurrenciesSeeder.php index 945a961381db..1e89ec7fe5c6 100644 --- a/database/seeds/CurrenciesSeeder.php +++ b/database/seeds/CurrenciesSeeder.php @@ -110,9 +110,9 @@ class CurrenciesSeeder extends Seeder ['name' => 'Azerbaijan Manat', 'code' => 'AZN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Bosnia and Herzegovina Convertible Mark', 'code' => 'BAM', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Belarusian Ruble', 'code' => 'BYN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], - ['name' => 'Moldovan Leu', 'code' => '', 'symbol' => 'MDL', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], - ['name' => 'Kazakhstani Tenge', 'code' => '', 'symbol' => 'KZT', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], - ['name' => 'Gibraltar Pound', 'code' => '', 'symbol' => 'GIP', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['name' => 'Moldovan Leu', 'code' => 'MDL', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['name' => 'Kazakhstani Tenge', 'code' => 'KZT', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['name' => 'Gibraltar Pound', 'code' => 'GIP', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ]; foreach ($currencies as $currency) {