@extends('layouts.app')
@section('title', __('Fixed Assets'))
@section('content')<div class="row g-3"><div class="col-lg-4"><div class="card"><div class="card-body p-4"><h6>{{ __('Add Fixed Asset') }}</h6><form method="POST" action="{{ route('assets.store') }}">@csrf<input name="asset_code" class="form-control mb-2" placeholder="{{ __('Asset Code') }} (auto)"><input name="name" class="form-control mb-2" placeholder="{{ __('Asset Name') }}" required><input name="category" class="form-control mb-2" placeholder="{{ __('Category') }}"><input name="acquisition_date" type="date" class="form-control mb-2" value="{{ now()->toDateString() }}"><input name="acquisition_cost" type="number" step="0.01" class="form-control mb-2" placeholder="{{ __('Acquisition Cost') }}" required><input name="accumulated_depreciation" type="number" step="0.01" value="0" class="form-control mb-2" placeholder="{{ __('Depreciation') }}"><input name="residual_value" type="number" step="0.01" value="0" class="form-control mb-2" placeholder="{{ __('Residual Value') }}"><select name="currency_code" class="form-select mb-2">@foreach($currencies as $currency)<option value="{{ $currency->code }}" @selected($currency->is_default)>{{ $currency->code }}</option>@endforeach</select><button class="btn btn-success w-100">{{ __('Save Asset') }}</button></form></div></div></div><div class="col-lg-8"><div class="card"><div class="card-body"><table class="table"><thead><tr><th>{{ __('Code') }}</th><th>{{ __('Asset') }}</th><th>{{ __('Cost') }}</th><th>{{ __('Depreciation') }}</th><th>{{ __('Net Value') }}</th></tr></thead><tbody>@foreach($assets as $asset)<tr><td>{{ $asset->asset_code }}</td><td>{{ $asset->name }}<small class="d-block">{{ $asset->category }}</small></td><td>{{ number_format($asset->acquisition_cost,2) }}</td><td>{{ number_format($asset->accumulated_depreciation,2) }}</td><td>{{ number_format($asset->acquisition_cost-$asset->accumulated_depreciation-$asset->residual_value,2) }}</td></tr>@endforeach</tbody></table>{{ $assets->links('pagination::bootstrap-5') }}</div></div></div></div>@endsection
