@extends("client.layouts.app") @section("title", __("client.funds.title")) @section("content")

{{ __('client.nav.add_funds') }}

{{ __('client.funds.subtitle') }}

@php $credit = $accountCredit ?? 0; @endphp
{{ __('client.funds.current_credit') }}
{{ money_fmt($credit) }}
{{ __('client.funds.available_credit_desc') }}
{{ __('client.funds.select_amount') }}
@if($errors->any())
    @foreach($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif
@csrf @php // The customer pays in the billing currency; the balance is // kept in the shop currency. Limits and presets follow the // rate so 5 of one currency is never mistaken for 5 of another. $converted = ($exchangeRate ?? null) !== null; $symbol = function ($c) { if (! $c) return '$'; if (trim((string) $c->prefix) !== '') return $c->prefix; if (trim((string) $c->suffix) !== '') return trim((string) $c->suffix); return $c->code; }; $shopSymbol = $symbol($shopCurrency); $sign = $converted ? $symbol($billingCurrency) : $shopSymbol; $signCurrency = $converted ? $billingCurrency : $shopCurrency; $signIsPrefix = $signCurrency && trim((string) $signCurrency->prefix) !== ''; $presets = collect([10, 25, 50, 100, 250, 500])->map(fn ($v) => $converted ? funds_round_preset($v * $exchangeRate) : $v)->unique()->values(); $minimum = $converted ? funds_round_preset(5 * $exchangeRate) : 5; $maximum = $converted ? funds_round_preset(10000 * $exchangeRate) : 10000; @endphp
@foreach($presets as $preset) @endforeach
@if($signIsPrefix) {{ $sign }} @endif @if(! $signIsPrefix) {{ $sign }} @endif
{{ number_format($minimum, 0, ',', '.') }} {{ $sign }} – {{ number_format($maximum, 0, ',', '.') }} {{ $sign }}
@if($converted) {{-- Conversion box: the customer pays in one currency and the services are priced in another; how much balance they get and at which rate has to be visible before they pay. --}}
{{ __('client.funds.you_will_receive') }} {{ $shopSymbol }}0.00
1 {{ $shopCurrency->code }} = {{ number_format($exchangeRate, 4, ',', '.') }} {{ $billingCurrency->code }} @if($rateSource) · {{ $rateSource }}@if($rateDate) {{ $rateDate }}@endif @if($rateBulletin) ({{ __('client.funds.bulletin') }} {{ $rateBulletin }})@endif @endif
{{ __('client.funds.rate_notice') }}
@endif
@section("scripts") @endsection @endsection