@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Asset depreciation report')) @include('admin.asset.partials.page_styles') @section('content') @php $exportParams = array_filter([ 'year' => $filters['year'] ?? $year, 'month' => $filters['month'] ?? $month, 'method' => $filters['method'] ?? null, 'branch_id' => $filters['branch_id'] ?? null, 'search' => $filters['search'] ?? null, ], fn ($v) => $v !== null && $v !== ''); @endphp

{{ __('Asset depreciation report') }}

{{ __('Filter posted depreciation, run monthly posting, and export the filtered ledger.') }}

@canany(['Asset-export', 'Asset-report']) {{ __('Export Excel') }} @endcanany
@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif
{{ number_format((float)($stats['period_amount'] ?? 0), 2) }}
{{ __('Depreciation (filtered)') }}
{{ $stats['period_count'] ?? 0 }}
{{ __('Entries (filtered)') }}
{{ $stats['eligible'] ?? 0 }}
{{ __('Assets with method set') }}
@can('Asset-report')
{{ __('Run depreciation') }}
@csrf

{{ __('Already-posted periods are skipped. Assets without a method or already disposed are ignored.') }}

@endcan
{{ __('Depreciation ledger') }}
@if($entries->total() > 0) {{ $entries->firstItem() }}–{{ $entries->lastItem() }} {{ __('of') }} {{ $entries->total() }} @endif
{{ __('Reset') }} @canany(['Asset-export', 'Asset-report']) @endcanany
@forelse($entries as $row) @empty @endforelse @if($entries->total() > 0) @endif
{{ __('Period') }} {{ __('Asset') }} {{ __('Branch') }} {{ __('Method') }} {{ __('Opening') }} {{ __('Depreciation') }} {{ __('Closing') }} {{ __('Posted by') }}
{{ $row->periodLabel() }} {{ $row->asset?->name ?? '—' }}
{{ $row->asset?->identity ?: $row->asset?->code }}
{{ $row->asset?->branch?->name ?? '—' }} {{ $row->methodLabel() }} {{ number_format((float)$row->opening_book_value, 2) }} {{ number_format((float)$row->depreciation_amount, 2) }} {{ number_format((float)$row->closing_book_value, 2) }} {{ $row->poster?->name ?? '—' }}
{{ __('No depreciation entries for these filters.') }}
{{ __('Filtered total') }} {{ number_format((float)($stats['period_amount'] ?? 0), 2) }}
{{ $entries->links() }}
@endsection @section('script') @include('admin.asset.partials.scripts') @endsection