@extends('admin.layouts.app')
@section('title','Stock Adjustment')
@section('content')
<div class="page-shell"><div class="page-head"><div><h1 class="page-title">Stock Adjustment</h1><div class="page-subtitle">Damage, opening balance or correction entry</div></div></div>
<form method="POST" action="{{ route('admin.inventory.adjustments.store') }}" class="card panel-tight grid-3">@csrf
<div><label>Date</label><input type="date" name="adjustment_date" value="{{ now()->toDateString() }}"></div>
<div><label>Product</label><select name="product_id">@foreach($products as $product)<option value="{{ $product->id }}">{{ $product->product_name }} ({{ $product->product_code }})</option>@endforeach</select></div>
<div><label>Adjust Qty (+/-)</label><input type="number" name="adjust_qty" required></div>
<div><label>Reason</label><input type="text" name="reason" placeholder="Damage / Opening Stock / Manual Correction"></div>
<div style="grid-column:1/-1"><label>Notes</label><textarea name="notes" rows="3"></textarea></div>
<div class="form-actions" style="grid-column:1/-1"><button class="btn primary">Save Adjustment</button></div>
</form>
<div class="card panel-tight table-wrap"><table class="table"><thead><tr><th>No</th><th>Date</th><th>Product</th><th>Current</th><th>Adjust</th><th>New</th><th>Reason</th></tr></thead><tbody>@foreach($adjustments as $row)<tr><td>{{ $row->adjustment_no }}</td><td>{{ $row->adjustment_date }}</td><td>{{ $row->product_name }}</td><td>{{ $row->current_qty }}</td><td>{{ $row->adjust_qty }}</td><td>{{ $row->new_qty }}</td><td>{{ $row->reason }}</td></tr>@endforeach</tbody></table>{{ $adjustments->links() }}</div></div>
@endsection
