diff --git a/app/Ninja/Repositories/AccountRepository.php b/app/Ninja/Repositories/AccountRepository.php index 06386d90f915..db63b93d82ad 100644 --- a/app/Ninja/Repositories/AccountRepository.php +++ b/app/Ninja/Repositories/AccountRepository.php @@ -60,6 +60,7 @@ class AccountRepository $account->ip = Request::getClientIp(); $account->account_key = strtolower(str_random(RANDOM_KEY_LENGTH)); $account->company_id = $company->id; + $account->currency_id = DEFAULT_CURRENCY; // Set default language/currency based on IP if (\Cache::get('currencies')) { diff --git a/database/seeds/UserTableSeeder.php b/database/seeds/UserTableSeeder.php index a83cbbcde67a..f0837cb3888c 100644 --- a/database/seeds/UserTableSeeder.php +++ b/database/seeds/UserTableSeeder.php @@ -31,6 +31,7 @@ class UserTableSeeder extends Seeder 'city' => $faker->city, 'state' => $faker->state, 'postal_code' => $faker->postcode, + 'currency_id' => DEFAULT_CURRENCY, 'country_id' => Country::all()->random()->id, 'account_key' => strtolower(str_random(RANDOM_KEY_LENGTH)), 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), diff --git a/resources/views/accounts/localization.blade.php b/resources/views/accounts/localization.blade.php index 0ef75a1fa773..ce2c427df37a 100644 --- a/resources/views/accounts/localization.blade.php +++ b/resources/views/accounts/localization.blade.php @@ -27,7 +27,6 @@
{!! Former::select('currency_id') - ->addOption('','') ->fromQuery($currencies, 'name', 'id') ->onchange('updateCurrencyCodeRadio()') !!} {!! Former::radios('show_currency_code')->radios([ diff --git a/resources/views/clients/edit.blade.php b/resources/views/clients/edit.blade.php index 70a924d66f58..8bcf02696dad 100644 --- a/resources/views/clients/edit.blade.php +++ b/resources/views/clients/edit.blade.php @@ -187,7 +187,7 @@
{!! Former::select('currency_id')->addOption('','') - ->placeholder($account->currency ? $account->currency->name : '') + ->placeholder($account->currency ? trans('texts.currency_'.Str::slug($account->currency->name, '_')) : '') ->fromQuery($currencies, 'name', 'id') !!} {!! Former::select('language_id')->addOption('','') ->placeholder($account->language ? trans('texts.lang_'.$account->language->name) : '') diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 7ff14fbdf28a..9d9628025d16 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -714,14 +714,14 @@ {!! Former::select('client[currency_id]')->addOption('','') - ->placeholder($account->currency ? $account->currency->name : '') + ->placeholder($account->currency ? trans('texts.currency_'.Str::slug($account->currency->name, '_')) : '') ->label(trans('texts.currency_id')) ->data_bind('value: currency_id') ->fromQuery($currencies, 'name', 'id') !!} {!! Former::select('client[language_id]')->addOption('','') - ->placeholder($account->language ? $account->language->name : '') + ->placeholder($account->language ? trans('texts.lang_'.$account->language->name) : '') ->label(trans('texts.language_id')) ->data_bind('value: language_id') ->fromQuery($languages, 'name', 'id') !!} @@ -1225,7 +1225,7 @@ } @endif */ - + @if ( ! $account->live_preview) return; @endif