@extends('panel.layout.settings') @section('title', __('Finance Management')) @section('titlebar_actions', '') @section('settings')
1 {{ __('User Information') }}
2 {{ __('Manage Subscription') }}
@if ($sub !== null) @endif
@csrf
3 {{ __('Token Pack') }}
@if ($app_is_demo) {{ __('Save') }} @else @endif
{{-- Section 4: Shared Credit Management --}} @if ($user->isSharedCreditUser() || setting('shared_credit_system_enabled'))
4 {{ __('Shared Credit') }}

{{ __('Current Balance') }}

{{ number_format($user->shared_credits, 2) }}

{{ $user->credit_system_type === 'shared' ? __('Shared') : __('Separated') }}
{{-- Adjust Balance --}}
@csrf
{{ __('Apply') }}
{{-- Change Credit Type --}}
@csrf @method('PUT')
{{ __('Update') }}
{{-- Recent Transactions --}} @if ($user->isSharedCreditUser()) @php $recentTransactions = $user->sharedCreditTransactions()->latest()->limit(10)->get(); @endphp @if ($recentTransactions->isNotEmpty())
{{ __('Date') }} {{ __('Action') }} {{ __('Amount') }} {{ __('Balance') }} @foreach ($recentTransactions as $tx) {{ $tx->created_at->format('Y-m-d H:i') }} {{ __(str_replace('_', ' ', ucfirst($tx->action_type))) }} {{ $tx->amount >= 0 ? '+' : '' }}{{ number_format($tx->amount, 2) }} {{ number_format($tx->balance_after, 2) }} @endforeach
@endif @endif @endif @endsection @push('script') @endpush