@extends('layouts.app')

@section('title', 'Damage Stock')
@section('page-title', 'Damage Stock')

@section('content')
    <div class="card">
        <div class="card-body">
            <h4>Damage #{{ $damageStock->id }}</h4>
            <p>Date: {{ $damageStock->date_time ? \Carbon\Carbon::parse($damageStock->date_time)->format('Y-m-d H:i:s') : '-' }}</p>
            <p>Product: {{ optional($damageStock->product)->product_name ?? '' }}</p>
            <p>Qty: {{ $damageStock->qty }}</p>
            <p>Total Cost: {{ number_format($damageStock->total_cost,2) }}</p>
            <p>Remark: {{ $damageStock->remark }}</p>
            <p>Reported by: {{ optional($damageStock->creator)->name ?? '' }}</p>

            <div class="text-end mt-3">
                <a href="{{ route('damage_stocks.index') }}" class="btn btn-outline-secondary">Back</a>
                <a href="{{ route('damage_stocks.edit', $damageStock->id) }}" class="btn btn-primary">Edit</a>
            </div>
        </div>
    </div>
@endsection
