@section('title', __('My Earning'))
@php $hasOutstandingCurrentAccount = (float) ($managerWalletBalance ?? 0) < 0; $remainingSettlementAmount = max(0, round((float) ($settlementDueAmount ?? 0) - (float) ($pendingSettlementAmount ?? 0), 2)); $storeBalanceLabel = $hasOutstandingCurrentAccount ? __('Outstanding amount to settle') : __('Current Account'); $storeBalanceAmount = $hasOutstandingCurrentAccount ? $remainingSettlementAmount : (float) ($managerWalletBalance ?? 0.00); @endphp

{{ __('Payment Actions') }}

@if ($hasOutstandingCurrentAccount && $remainingSettlementAmount > 0) {{ __('Your store has an amount pending with the platform. Use the button to inform the payment and upload the proof.') }} @else {{ __('Open your payout history and settlement area from here.') }} @endif

@if (($supportsSettlementFlow ?? false) && $remainingSettlementAmount > 0) {{ __('Inform Payment') }} @else {{ __('My Payouts') }} @endif
@include('livewire.partials.store_settlement_schedule', [ 'settlementSchedule' => $settlementSchedule ?? [], 'remainingSettlementAmount' => $remainingSettlementAmount, 'pendingSettlementAmount' => $pendingSettlementAmount ?? 0, ]) @include('livewire.partials.store_settlement_transfer_details', [ 'transferDetails' => $settlementSchedule['transfer_details'] ?? [], ]) @if (!($canRequestPayout ?? true))

{{ __('Payout request blocked. Your current account is negative. Please settle your account first.') }}

{{ __('Outstanding amount to settle') }}: {{ currencyFormat($remainingSettlementAmount) }}

@if (($pendingSettlementAmount ?? 0) > 0)

{{ __('Settlement already under review') }}: {{ currencyFormat($pendingSettlementAmount ?? 0) }}

@endif
@endif

{{ __("Vendor") }}: {{ $earning->vendor->name ?? '' }}

{{ __("Amount") }}: {{ currencyFormat($earning->amount ?? 0.00) }}

{{ __("Updated At") }}: {{ $earning->formatted_updated_date ?? '' }}


@if ($canRequestPayout ?? true) @elseif (($supportsSettlementFlow ?? false) && $remainingSettlementAmount > 0) {{ __('Inform Payment') }}

{{ __('Open the settlement form to inform the amount paid and upload the payment proof.') }}

@else {{ __('My Payouts') }} @endif

{{ $storeBalanceLabel }}: {{ currencyFormat($storeBalanceAmount) }}

@if ($hasOutstandingCurrentAccount)

{{ __('Payout request blocked because your current account is negative.') }}

{{ __('Outstanding amount to settle') }}: {{ currencyFormat($remainingSettlementAmount) }}

@if (($pendingSettlementAmount ?? 0) > 0)

{{ __('Settlement already under review') }}: {{ currencyFormat($pendingSettlementAmount ?? 0) }}

@endif @endif
@if (($supportsSettlementFlow ?? false) && $remainingSettlementAmount > 0) {{ __('Submit Settlement') }} @else {{ __('My Payouts') }} @endif

{{ __('Pay') }} {{ Str::ucfirst(Str::singular($type ?? '')) }}