status) disabled="disabled" @endif @php $accountId = $account['import_account']->id; $configuredValue = $configuration->getAccounts()[$accountId] ?? null; $allAccounts = $configuration->getAccounts(); $mappedTo = $account['mapped_to'] ?? null; // Check if account should be checked: // 1. If configured explicitly (any non-null value including 0 for "create new") // 2. If no configuration exists yet - use sensible defaults $shouldCheck = false; if ($configuredValue !== null && $configuredValue !== '') { // Explicitly configured (including 0 for "create new") $shouldCheck = true; } elseif (empty($allAccounts)) { // No configuration yet - use sensible defaults // Check if there's an automatic mapping $shouldCheck = true; // if ($mappedTo !== null) { // $shouldCheck = true; // Auto-mapped accounts should be checked // } else { // $shouldCheck = true; // Default to checked for user convenience // } } @endphp @if($shouldCheck) checked="checked" @endif />
@if(isset($account['import_account']->balance))
{{ number_format((float)$account['import_account']->balance, 2) }} {{ $account['import_account']->currency ?? '' }} @if(isset($account['import_account']->balance_date) && $account['import_account']->balance_date) ({{ date('M j, Y', (int)$account['import_account']->balance_date) }}) @endif
@endif @if(isset($account['import_account']->available_balance) && $account['import_account']->available_balance !== ($account['import_account']->balance ?? null))
{{ number_format((float)$account['import_account']->available_balance, 2) }} {{ $account['import_account']->currency ?? '' }}
@endif
{{ $account['import_account']->id ?? 'N/A' }} @if('disabled' === $account['import_account']->status) Disabled @endif
{{-- Display 'mapped_to' if available --}} {{-- Display 'extra' fields if any --}} @php $extraData = (array)($account['import_account']->extra ?? []); @endphp @if(count($extraData) > 0)
@foreach($extraData as $key => $item) @if(!empty($item) && is_scalar($item))
{{ ucfirst(str_replace(['_', '-'], ' ', $key)) }}: {{ $item }}
@endif @endforeach
@endif