@php $statusMeta = [ 'in_use' => ['label' => __('In use'), 'color' => 'emerald'], 'in_storage' => ['label' => __('In storage'), 'color' => 'sky'], 'under_repair' => ['label' => __('Under repair'), 'color' => 'amber'], 'retired' => ['label' => __('Retired'), 'color' => 'slate'], 'disposed' => ['label' => __('Disposed'), 'color' => 'rose'], ]; $tonePill = [ 'up' => 'bg-emerald-50 text-emerald-700', 'down' => 'bg-rose-50 text-rose-700', 'muted' => 'bg-slate-100 text-slate-500', ]; @endphp
{{-- Header --}} {{ __('Export') }} @if ($canManage) {{ __('Import') }} {{ __('New Asset') }} @endif @if ($canResetData) @endif {{-- KPI cards (money cards are absent for users who may not see values) --}}
@foreach ($kpis as $kpi)

{{ $kpi['label'] }}

{{ $kpi['value'] }}

{{ $kpi['sub']['text'] }}
@endforeach
{{-- Register table --}} {{-- Toolbar --}}
{{-- Bulk action bar --}} @if ($canDelete && count($selected) > 0)

{{ __(':count selected', ['count' => count($selected)]) }}

@endif {{-- Table --}}
@if ($canDelete) @endif @if ($canSeeValues) @endif @forelse ($assets as $asset) @php $meta = $statusMeta[$asset->status] ?? ['label' => ucfirst($asset->status), 'color' => 'slate']; @endphp @if ($canDelete) @endif @if ($canSeeValues) @endif @empty @endforelse
0 && count($selected) >= $assets->count()) class="rounded border-slate-300 text-indigo-600 focus:ring-indigo-500" /> {{ __('Asset') }} {{ __('Category') }} {{ __('Status') }} {{ __('Location') }} {{ __('Assigned To') }}{{ __('Value') }}{{ __('Purchased') }} {{ __('Actions') }}
@if ($asset->images->isNotEmpty()) {{ $asset->name }} @else @endif

{{ $asset->asset_tag ?: ($asset->serial_number ? __('SN: :sn', ['sn' => $asset->serial_number]) : '—') }} @if ($asset->last_verified_at) · {{ __('checked :when', ['when' => $asset->last_verified_at->timezone(config('app.display_timezone'))->format('M Y')]) }} @endif

{{ $asset->category ?: '—' }}
{{ $meta['label'] }} {{-- The last count could not find it. Loud, and it stays loud until somebody writes it off or finds it. --}} @if ($asset->last_verification_result === 'missing') {{ __('Not found') }} @endif
{{ $asset->location ?: '—' }} {{ $asset->assigned_to ?: '—' }} @php $val = $asset->current_value ?? $asset->purchase_cost; @endphp {{ $val !== null ? $asset->currency_code . ' ' . number_format((float) $val, 2) : '—' }} {{ $asset->purchase_date ? $asset->purchase_date->format('j M Y') : '—' }}
@if ($canUpdate && ! $asset->isDisposed()) @endif @if ($canManage) @endif @if ($canDelete) @endif @if (! $canManage && ! $canDelete && ! $canUpdate) — @endif
@if ($canManage && $search === '' && $categoryFilter === '' && $statusFilter === '') {{ __('New Asset') }} @endif
{{-- Pagination --}}
{{ $assets->links() }}
{{-- Create / Edit modal --}} {{ $editingId ? __('Edit Asset') : __('New Asset') }}
@if ($canSeeValues)
@php $payAccounts = $fundAccounts->where('currency_code', strtoupper($currency_code)); @endphp

@if ($payAccounts->isEmpty()) {{ __('No active :cur account. Leave blank, or add one under Treasury.', ['cur' => strtoupper($currency_code) ?: __('matching')]) }} @else {{ __('Deducts the cost from this account as a capital purchase (shows in cash-flow, not the P&L, depreciation is the only profit impact).') }} @endif

@endif
{{-- Depreciation (straight-line) --}}

{{ __('Depreciation (straight-line)') }}

@if ($canSeeValues)
@endif
{{-- Images --}}

{{ __('Attach photos, receipts or serial-plate close-ups (max 5MB each).') }}

@if ($editingId && $editingImages->isNotEmpty())
@foreach ($editingImages as $image)
{{ $image->original_name }}
@endforeach
@endif {{-- Staged uploads preview --}} @if (count($newImages))
@foreach ($newImages as $i => $img) @if (is_object($img) && method_exists($img, 'temporaryUrl'))
@endif @endforeach
@endif
{{ __('Cancel') }} {{ __('Save') }}
{{-- Read-only detail popup: every captured field, including the sheet columns hidden from the table. --}} {{ $viewingAsset?->name ?? __('Asset details') }} @if ($viewingAsset) @php $a = $viewingAsset; $vmeta = $statusMeta[$a->status] ?? ['label' => ucfirst($a->status), 'color' => 'slate']; $cur = $a->currency_code ?: ''; $money = fn ($v) => $v !== null && $v !== '' ? trim($cur . ' ' . number_format((float) $v, 2)) : '—'; $dash = fn ($v) => filled($v) ? $v : '—'; $depLabel = ['straight_line' => __('Straight-line'), 'reducing_balance' => __('Reducing balance')][$a->depreciation_method] ?? $a->depreciation_method; @endphp {{-- Header strip: tag, category, status --}}
@if ($a->asset_tag) {{ $a->asset_tag }} @endif @if ($a->category) {{ $a->category }} @endif {{ $vmeta['label'] }}
{{-- Image gallery --}} @if ($a->images->isNotEmpty())
@foreach ($a->images as $img) {{ $a->name }} @endforeach
@endif {{-- Money headline cards --}} @if ($canSeeValues)
@foreach ([ [__('Net Book Value'), $money($a->current_value), 'text-slate-900'], [__('Purchase Cost'), $money($a->purchase_cost), 'text-slate-900'], [__('Annual Deprn'), $money($a->annual_depreciation), 'text-slate-900'], [__('Deprn to Date'), $money($a->accumulated_depreciation), 'text-slate-900'], ] as $card)

{{ $card[0] }}

{{ $card[1] }}

@endforeach
@endif {{-- Full field grid --}}
@foreach ([ [__('Serial Number'), $dash($a->serial_number)], [__('Condition'), $dash($a->condition)], [__('Location'), $dash($a->location)], [__('Assigned To'), $dash($a->assigned_to)], [__('Supplier'), $dash($a->supplier?->name)], [__('Supplier / Source'), $dash($a->source)], ...($canSeeValues ? [[__('Paid From'), $a->paidFromAccount ? $a->paidFromAccount->name . ' (' . $a->paidFromAccount->currency_code . ')' : '—']] : []), [__('Date Purchased'), $a->purchase_date?->format('j M Y') ?? '—'], [__('Warranty Expiry'), $a->warranty_expiry?->format('j M Y') ?? '—'], [__('Useful Life'), $a->useful_life_years !== null ? ((float) $a->useful_life_years) . ' ' . __('years') : '—'], ...($canSeeValues ? [ [__('Residual Value'), $money($a->residual_value)], [__('Depreciation Method'), $dash($depLabel)], ] : []), [__('Currency'), $dash($a->currency_code)], [__('COA Code'), $dash($a->coa_code)], ] as $field)
{{ $field[0] }}
{{ $field[1] }}
@endforeach
{{-- Disposal block --}} @if ($a->isDisposed()) @php $gl = $a->disposalGainLoss(); @endphp

{{ __('Disposal') }}

{{ __('Method') }}
{{ \App\Models\Asset::DISPOSAL_METHODS[$a->disposal_method] ?? $a->disposal_method ?? '—' }}
{{ __('Date') }}
{{ $a->disposed_on?->format('j M Y') ?? '—' }}
@if ($canSeeValues)
{{ __('Proceeds') }}
{{ $money($a->disposal_proceeds) }}
{{ __('Gain / Loss') }}
{{ $money($gl) }}
@endif
@if ($a->disposal_notes)

{{ $a->disposal_notes }}

@endif
@endif {{-- Notes --}} @if ($a->notes)

{{ __('Notes / Condition') }}

{{ $a->notes }}

@endif {{-- Meta footer --}}

{{ __('Added :date', ['date' => $a->created_at?->format('j M Y')]) }}@if ($a->recorder) · {{ __('by :name', ['name' => $a->recorder->name]) }}@endif

@endif
{{ __('Close') }} @if ($canManage) {{ __('Edit') }} @endif
{{-- Log-cost modal (maintenance / repair / improvement) --}} {{ __('Log Asset Cost') }}

{{ __('Record maintenance, a repair or an improvement on') }} {{ $costAssetName }}. {{ __('This is logged as an expense and paid from the chosen account.') }}

@if ($costType === 'improvement') @endif
{{ __('Cancel') }} {{ __('Record Cost') }}
{{-- Dispose modal --}} {{ __('Dispose Asset') }}

{{ __('Take') }} {{ $disposeAssetName }} {{ __('off the books. Selling records the proceeds as income; the rest are non-cash write-offs.') }}

@if ($dispose_method === 'sold')
@endif
{{ __('Cancel') }} {{ __('Confirm Disposal') }}
{{-- Import modal --}} {{ __('Import Asset Register') }}

{{ __('Sync straight from the Google Sheet, or upload your Asset Register as a CSV / Excel (.xlsx) file. Columns are matched automatically (ID, Asset Name, Category, Date Purchased, Supplier / Source, Cost, Useful Life, Residual Value, Annual Deprn, Deprn to Date, Net Book Value, Notes / Condition, COA Code) and the register is found on any tab. Rows are matched to existing assets by their ID, so re-importing updates rather than duplicates.') }}

{{-- Google Sheets one-click sync --}}
{{ __('Sync now') }} {{ __('Syncing…') }}

{{ __('The sheet must be shared as "Anyone with the link → Viewer".') }}

@if ($importResult)
{{ $importResult['created'] }} {{ __('added') }} {{ $importResult['updated'] }} {{ __('updated') }} {{ $importResult['skipped'] }} {{ __('skipped') }}
@if (! empty($importResult['errors']))
    @foreach ($importResult['errors'] as $error)
  • {{ $error }}
  • @endforeach
@endif
@endif
{{ $importResult ? __('Close') : __('Cancel') }} {{ __('Import') }}
{{-- Reset-all confirmation modal --}} @if ($canResetData) {{ __('Reset asset register') }}

{{ __('This permanently deletes every asset in this workspace.') }}

{{ __('All assets and their photos are removed and cannot be recovered. Maintenance costs and disposal proceeds already recorded in Treasury are kept, but unlinked from the deleted assets.') }}

{{ __('Cancel') }}
@endif