@section('title', __('Split Financial Report'))
@if ($isSandbox)
{{ __('Sandbox environment — values are test data.') }}
@endif {{-- ============ como o dinheiro flui ============ --}}

{{ __('How the money flows') }}

  1. {{ __('The client pays (PIX or card); Asaas splits at the source: the driver share goes to the driver subaccount, the platform share stays in the main account.') }}
  2. {{ __('Asaas releases the money after the settlement period:') }} PIX D+{{ $pixDays }} · {{ __('Card') }} D+{{ $cardDays }}
  3. {{ __('The automatic payout job then transfers each driver subaccount balance to the driver PIX (CPF).') }} {{ __('Frequency') }}: {{ __(ucfirst($payoutFrequency)) }} · {{ __('Next run') }}: {{ $nextPayout->format('d/m/Y H:i') }} @if ($lastRun) · {{ __('Last run') }}: {{ $lastRun }} @endif
{{-- ============ régua de números (mesmo padrão da Central) ============ --}}

{{ $balance === null ? '·' : 'R$ ' . number_format($balance, 2, ',', '.') }}

{{ __('Platform balance (Asaas)') }}

R$ {{ number_format($summary['gross'], 2, ',', '.') }}

{{ __('Gross received') }}

R$ {{ number_format($summary['fee'], 2, ',', '.') }}

{{ __('Asaas fees') }}

R$ {{ number_format($summary['driver'], 2, ',', '.') }}

{{ __('Drivers') }}

R$ {{ number_format($summary['platform'], 2, ',', '.') }}

{{ __('Platform') }}

{{ $summary['paidCount'] }} {{ __('Paid') }} · {{ $summary['pendingCount'] }} {{ __('Pending') }}

{{ __('Orders') }}

{{-- ============ filtros ============ --}}
{{-- ============ pedido a pedido ============ --}}

{{ __('Per-order breakdown') }}

@forelse ($rows as $r) @empty @endforelse
{{ __('Date') }} {{ __('Order') }} {{ __('Driver') }} {{ __('Method') }} {{ __('Gross') }} {{ __('Asaas fee') }} {{ __('Net') }} {{ __('Driver') }} {{ __('Platform') }} {{ __('Status') }} {{ __('Release') }}
{{ $r->order->created_at->format('d/m H:i') }} #{{ $r->order->code }} {{ optional($r->order->driver)->name ?: '·' }} {{ $r->methodLabel }} R$ {{ number_format($r->gross, 2, ',', '.') }} - R$ {{ number_format($r->fee, 2, ',', '.') }} R$ {{ number_format($r->net, 2, ',', '.') }} R$ {{ number_format($r->driverAmt, 2, ',', '.') }} ({{ rtrim(rtrim(number_format($r->share, 2, ',', '.'), '0'), ',') }}%) R$ {{ number_format($r->platformAmt, 2, ',', '.') }} @if ($r->paid) {{ __('Paid') }} @else {{ __('Pending') }} @endif @if (!$r->paid) · @elseif ($r->released) {{ __('Available') }} @else {{ $r->release->format('d/m/Y') }} @endif
{{ __('No split orders in this period.') }}
{{-- ============ repasses aos motoristas ============ --}}

{{ __('Driver payouts (transfers)') }}

{{ __('Every automatic transfer from a driver subaccount to the driver PIX (CPF) is recorded here.') }}

@if ($payouts->isEmpty())

{{ __('No payouts recorded yet.') }}

@else
@foreach ($payouts as $p) @endforeach
{{ __('Date') }} {{ __('Driver') }} {{ __('Amount') }} {{ __('Status') }} Transfer ID
{{ \Illuminate\Support\Carbon::parse($p->created_at)->format('d/m/Y H:i') }} {{ $p->driver_name ?: ('#' . $p->driver_id) }} R$ {{ number_format($p->amount, 2, ',', '.') }} @if ($p->status === 'created') {{ __('Sent') }} @else {{ __('Failed') }} @endif {{ $p->transfer_id ?: '·' }}
@endif