{{-- Flash --}} @if (session()->has('message')) @endif {{-- ═══ STAT CARDS ═══ --}} @php $allPivots = collect(); foreach ($accounts as $acc) { foreach ($acc->currencies as $cur) { $allPivots->push(['code' => $cur->code, 'symbol' => $cur->symbol, 'balance' => $cur->pivot->balance]); } } $balanceByCurrency = $allPivots->groupBy('code')->map(fn($group) => [ 'symbol' => $group->first()['symbol'], 'total' => $group->sum('balance'), ])->sortKeys(); @endphp
Total cuentas

{{ $accounts->total() }}

@foreach($balanceByCurrency as $code => $info)
Saldo {{ $code }}

{{ $info['symbol'] }} {{ number_format($info['total'], 2, ',', '.') }}

@endforeach
{{-- ═══ TOOLBAR ═══ --}}
{{-- ═══ TABLE ═══ --}}
@if($accounts->count() == 0)

No hay cuentas registradas.

@else
@foreach($accounts as $account) @endforeach
# Nombre Saldos Cuenta por defecto Acciones
{{ $account->id }} {{ $account->name }} @foreach($account->currencies as $cur)
{{ $cur->code }} {{ $cur->symbol }} {{ number_format($cur->pivot->balance, 2, ',', '.') }}
@endforeach @if($account->currencies->isEmpty()) @endif
@if($account->is_default_mercadopago) MercadoPago @endif @if($account->is_default_stripe) Stripe @endif @if(!$account->is_default_mercadopago && !$account->is_default_stripe) @endif
{{ $accounts->links() }}
@endif
{{-- ═══════════════════════════════════════════════════ --}} {{-- MODAL: Crear / Editar Cuenta --}} {{-- ═══════════════════════════════════════════════════ --}} @if($showModal)
@endif {{-- ═══════════════════════════════════════════════════ --}} {{-- MODAL: Confirmar eliminar cuenta --}} {{-- ═══════════════════════════════════════════════════ --}} @if($confirmingDelete)
@endif