@extends('admin.layouts.app') @section('title', __('admin.currencies.title')) @section('content') {{-- Rates are per US dollar (Currency::BASE): say so with one of the shop's own currencies as the example, so what to type is obvious. --}} @php $exampleCurrency = $currencies->sortByDesc('is_default')->first(fn ($c) => ! $c->isBase() && (float) $c->rate > 0); $exampleRate = $exampleCurrency ? rtrim(rtrim(number_format((float) $exampleCurrency->rate, 5, '.', ','), '0'), '.') : '130'; $exampleCode = $exampleCurrency->code ?? 'KES'; @endphp
{{ __('admin.currencies.rates_notice_title') }}
{{ __('admin.currencies.rates_notice', ['rate' => $exampleRate, 'code' => $exampleCode]) }}
{{-- Customers choosing their currency (CustomerCurrency) and the daily rate update (pnlcs:currency-update). The books stay in the default currency either way. --}}
{{ __('admin.currencies.settings_title') }}
@csrf
@csrf
@if($customerChoice && $currencies->count() < 2)
{{ __('admin.currencies.customer_choice_needs_two') }}
@endif

{{ __('admin.currencies.default_switch_hint') }}

@foreach($currencies as $currency) @endforeach
{{ __('common.table.code') }}{{ __('common.table.name') }}{{ __('admin.currencies.prefix') }}{{ __('admin.currencies.suffix') }}{{ __('admin.currencies.rate_per_usd') }}{{ __('admin.currencies.clients') }}{{ __('admin.currencies.default') }}{{ __('common.table.actions') }}
{{ $currency->code }} {{ $currency->prefix }} {{ $currency->prefix }} {{ $currency->suffix ?? '' }} @if($currency->isBase())1 USD ({{ __('admin.currencies.base') }})@else 1 USD = {{ rtrim(rtrim(number_format((float) $currency->rate, 5, '.', ','), '0'), '.') }} {{ $currency->code }}@endif {{ (int) ($clientsPerCurrency[$currency->id] ?? 0) }} @if($currency->is_default){{ __('admin.currencies.default') }}@endif @unless($currency->is_default)
@csrf
@endunless @if(!$currency->is_default)
@csrf @method('DELETE')
@endif
@endsection