diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index e0e9a4cd1cee..b76051abe1c8 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -423,7 +423,6 @@ class AccountController extends BaseController 'timezones' => Cache::get('timezones'), 'dateFormats' => Cache::get('dateFormats'), 'datetimeFormats' => Cache::get('datetimeFormats'), - 'currencies' => Cache::get('currencies'), 'title' => trans('texts.localization'), 'weekdays' => Utils::getTranslatedWeekdayNames(), 'months' => Utils::getMonthOptions(), diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index a9e4d9ae02b9..766f8cdb2615 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -191,7 +191,6 @@ class ClientController extends BaseController 'data' => Input::old('data'), 'account' => Auth::user()->account, 'sizes' => Cache::get('sizes'), - 'currencies' => Cache::get('currencies'), 'customLabel1' => Auth::user()->account->custom_client_label1, 'customLabel2' => Auth::user()->account->custom_client_label2, ]; diff --git a/app/Http/Controllers/ExpenseController.php b/app/Http/Controllers/ExpenseController.php index 0d4fec92c364..1940a26f3d97 100644 --- a/app/Http/Controllers/ExpenseController.php +++ b/app/Http/Controllers/ExpenseController.php @@ -289,14 +289,6 @@ class ExpenseController extends BaseController return [ 'data' => Input::old('data'), 'account' => Auth::user()->account, - 'sizes' => Cache::get('sizes'), - 'paymentTerms' => Cache::get('paymentTerms'), - 'industries' => Cache::get('industries'), - 'currencies' => Cache::get('currencies'), - 'languages' => Cache::get('languages'), - 'countries' => Cache::get('countries'), - 'customLabel1' => Auth::user()->account->custom_vendor_label1, - 'customLabel2' => Auth::user()->account->custom_vendor_label2, 'categories' => ExpenseCategory::whereAccountId(Auth::user()->account_id)->withArchived()->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->whereIsInclusive(false)->orderBy('name')->get(), 'isRecurring' => false, diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index b883f6f4742f..d8232b426439 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -305,7 +305,6 @@ class InvoiceController extends BaseController 'account' => Auth::user()->account->load('country'), 'products' => Product::scope()->orderBy('product_key')->get(), 'taxRateOptions' => $taxRateOptions, - 'currencies' => Cache::get('currencies'), 'sizes' => Cache::get('sizes'), 'invoiceDesigns' => InvoiceDesign::getDesigns(), 'invoiceFonts' => Cache::get('fonts'), diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index 35ccb47fd75d..7e8458597aa9 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -100,14 +100,10 @@ class QuoteController extends BaseController 'account' => $account, 'products' => Product::scope()->orderBy('product_key')->get(), 'taxRateOptions' => $account->present()->taxRateOptions, - 'countries' => Cache::get('countries'), 'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->orderBy('name')->get(), - 'currencies' => Cache::get('currencies'), 'sizes' => Cache::get('sizes'), 'paymentTerms' => Cache::get('paymentTerms'), - 'languages' => Cache::get('languages'), - 'industries' => Cache::get('industries'), 'invoiceDesigns' => InvoiceDesign::getDesigns(), 'invoiceFonts' => Cache::get('fonts'), 'invoiceLabels' => Auth::user()->account->getInvoiceLabels(), diff --git a/app/Http/Controllers/RecurringExpenseController.php b/app/Http/Controllers/RecurringExpenseController.php index 2f72077466b9..3e512b751e7c 100644 --- a/app/Http/Controllers/RecurringExpenseController.php +++ b/app/Http/Controllers/RecurringExpenseController.php @@ -115,14 +115,6 @@ class RecurringExpenseController extends BaseController return [ 'data' => Input::old('data'), 'account' => Auth::user()->account, - 'sizes' => Cache::get('sizes'), - 'paymentTerms' => Cache::get('paymentTerms'), - 'industries' => Cache::get('industries'), - 'currencies' => Cache::get('currencies'), - 'languages' => Cache::get('languages'), - 'countries' => Cache::get('countries'), - 'customLabel1' => Auth::user()->account->custom_vendor_label1, - 'customLabel2' => Auth::user()->account->custom_vendor_label2, 'categories' => ExpenseCategory::whereAccountId(Auth::user()->account_id)->withArchived()->orderBy('name')->get(), 'taxRates' => TaxRate::scope()->whereIsInclusive(false)->orderBy('name')->get(), 'isRecurring' => true, diff --git a/app/Http/Controllers/VendorController.php b/app/Http/Controllers/VendorController.php index 828cb9f542ba..654a725a7bb3 100644 --- a/app/Http/Controllers/VendorController.php +++ b/app/Http/Controllers/VendorController.php @@ -151,7 +151,6 @@ class VendorController extends BaseController return [ 'data' => Input::old('data'), 'account' => Auth::user()->account, - 'currencies' => Cache::get('currencies'), ]; } diff --git a/app/Http/ViewComposers/TranslationComposer.php b/app/Http/ViewComposers/TranslationComposer.php index ff2dc954199f..89f3fb267049 100644 --- a/app/Http/ViewComposers/TranslationComposer.php +++ b/app/Http/ViewComposers/TranslationComposer.php @@ -2,6 +2,7 @@ namespace App\Http\ViewComposers; +use Str; use Cache; use Illuminate\View\View; @@ -44,5 +45,11 @@ class TranslationComposer })->sortBy(function ($lang) { return $lang->name; })); + + $view->with('currencies', Cache::get('currencies')->each(function ($currency) { + $currency->name = trans('texts.currency_' . Str::slug($currency->name, '_')); + })->sortBy(function ($currency) { + return $currency->name; + })); } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 1f3386326ab2..d10b98116375 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2321,6 +2321,75 @@ $LANG = array( 'refund_subject' => 'Refund Processed', 'refund_body' => 'You have been processed a refund of :amount for invoice :invoice_number.', + 'currency_us_dollar' => 'US Dollar', + 'currency_british_pound' => 'British Pound', + 'currency_euro' => 'Euro', + 'currency_south_african_rand' => 'South African Rand', + 'currency_danish_krone' => 'Danish Krone', + 'currency_israeli_shekel' => 'Israeli Shekel', + 'currency_swedish_krona' => 'Swedish Krona', + 'currency_kenyan_shilling' => 'Kenyan Shilling', + 'currency_canadian_dollar' => 'Canadian Dollar', + 'currency_philippine_peso' => 'Philippine Peso', + 'currency_indian_rupee' => 'Indian Rupee', + 'currency_australian_dollar' => 'Australian Dollar', + 'currency_singapore_dollar' => 'Singapore Dollar', + 'currency_norske_kroner' => 'Norske Kroner', + 'currency_new_zealand_dollar' => 'New Zealand Dollar', + 'currency_vietnamese_dong' => 'Vietnamese Dong', + 'currency_swiss_franc' => 'Swiss Franc', + 'currency_guatemalan_quetzal' => 'Guatemalan Quetzal', + 'currency_malaysian_ringgit' => 'Malaysian Ringgit', + 'currency_brazilian_real' => 'Brazilian Real', + 'currency_thai_baht' => 'Thai Baht', + 'currency_nigerian_naira' => 'Nigerian Naira', + 'currency_argentine_peso' => 'Argentine Peso', + 'currency_bangladeshi_taka' => 'Bangladeshi Taka', + 'currency_united_arab_emirates_dirham' => 'United Arab Emirates Dirham', + 'currency_hong_kong_dollar' => 'Hong Kong Dollar', + 'currency_indonesian_rupiah' => 'Indonesian Rupiah', + 'currency_mexican_peso' => 'Mexican Peso', + 'currency_egyptian_pound' => 'Egyptian Pound', + 'currency_colombian_peso' => 'Colombian Peso', + 'currency_west_african_franc' => 'West African Franc', + 'currency_chinese_renminbi' => 'Chinese Renminbi', + 'currency_rwandan_franc' => 'Rwandan Franc', + 'currency_tanzanian_shilling' => 'Tanzanian Shilling', + 'currency_netherlands_antillean_guilder' => 'Netherlands Antillean Guilder', + 'currency_trinidad_and_tobago_dollar' => 'Trinidad and Tobago Dollar', + 'currency_east_caribbean_dollar' => 'East Caribbean Dollar', + 'currency_ghanaian_cedi' => 'Ghanaian Cedi', + 'currency_bulgarian_lev' => 'Bulgarian Lev', + 'currency_aruban_florin' => 'Aruban Florin', + 'currency_turkish_lira' => 'Turkish Lira', + 'currency_romanian_new_leu' => 'Romanian New Leu', + 'currency_croatian_kuna' => 'Croatian Kuna', + 'currency_saudi_riyal' => 'Saudi Riyal', + 'currency_japanese_yen' => 'Japanese Yen', + 'currency_maldivian_rufiyaa' => 'Maldivian Rufiyaa', + 'currency_costa_rican_colón' => 'Costa Rican Colón', + 'currency_pakistani_rupee' => 'Pakistani Rupee', + 'currency_polish_zloty' => 'Polish Zloty', + 'currency_sri_lankan_rupee' => 'Sri Lankan Rupee', + 'currency_czech_koruna' => 'Czech Koruna', + 'currency_uruguayan_peso' => 'Uruguayan Peso', + 'currency_namibian_dollar' => 'Namibian Dollar', + 'currency_tunisian_dinar' => 'Tunisian Dinar', + 'currency_russian_ruble' => 'Russian Ruble', + 'currency_mozambican_metical' => 'Mozambican Metical', + 'currency_omani_rial' => 'Omani Rial', + 'currency_ukrainian_hryvnia' => 'Ukrainian Hryvnia', + 'currency_macanese_pataca' => 'Macanese Pataca', + 'currency_taiwan_new_dollar' => 'Taiwan New Dollar', + 'currency_dominican_peso' => 'Dominican Peso', + 'currency_chilean_peso' => 'Chilean Peso', + 'currency_icelandic_króna' => 'Icelandic Króna', + 'currency_papua_new_guinean_kina' => 'Papua New Guinean Kina', + 'currency_jordanian_dinar' => 'Jordanian Dinar', + 'currency_myanmar_kyat' => 'Myanmar Kyat', + 'currency_peruvian_sol' => 'Peruvian Sol', + + ); return $LANG; diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index ec4437c8d5b2..9f5a271a332d 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -622,7 +622,7 @@ {!! Former::select('client[country_id]') ->label(trans('texts.country_id')) ->addOption('','')->addGroupClass('country_select') - ->fromQuery(Cache::get('countries'), 'name', 'id')->data_bind("dropdown: country_id") !!} + ->fromQuery($countries, 'name', 'id')->data_bind("dropdown: country_id") !!}