@extends('layouts.franchise', ['heading' => 'Stock Valuation Report'])

@section('content')
    <div class="mb-4 flex gap-2">
        <a href="{{ request()->fullUrlWithQuery(['export' => 'excel']) }}" class="rounded border px-3 py-2 text-sm">Excel</a>
        <a href="{{ request()->fullUrlWithQuery(['export' => 'pdf']) }}" class="rounded border px-3 py-2 text-sm">PDF</a>
    </div>

    <div class="grid grid-cols-1 gap-3">
        @forelse($rows as $row)
            <div class="rounded-2xl bg-white p-4 shadow">
                <div class="font-semibold">{{ $row->name }} ({{ $row->sku }})</div>
                <div class="text-sm text-slate-600">Qty: {{ number_format((float) $row->quantity, 2) }} | DP: ? {{ number_format((float) $row->dp_price, 2) }} | BV: {{ number_format((float) $row->bv, 2) }}</div>
            </div>
        @empty
            <div class="rounded-2xl bg-white p-4 text-center text-slate-500">No stock data.</div>
        @endforelse
    </div>
@endsection

