<form method="GET" action="{{ route('admin.vendors.index') }}" id="statement-filter-form">
    <input type="hidden" name="vendor" value="{{ $selected->id }}">
    <input type="hidden" name="view" value="statement">
    @foreach(collect($filters)->only(['company_name', 'contact_name', 'email', 'phone', 'state', 'vendor_code', 'q']) as $key => $val)
        @if($val)<input type="hidden" name="{{ $key }}" value="{{ $val }}">@endif
    @endforeach
    <label class="form-label small fw-medium">Period between</label>
    <div class="input-group input-group-sm mb-2">
        <input type="date" name="from" class="form-control" value="{{ $statementFrom }}" required>
        <span class="input-group-text">to</span>
        <input type="date" name="to" class="form-control" value="{{ $statementTo }}" required>
    </div>
    <label class="form-label small fw-medium">Filter</label>
    <select name="txn" class="form-select form-select-sm mb-3">
        @foreach($txnFilters as $key => $label)
            <option value="{{ $key }}" @selected($txnFilter === $key)>{{ $label }}</option>
        @endforeach
    </select>
    <div class="d-flex gap-2">
        <button type="submit" class="btn btn-success btn-sm flex-grow-1">Apply</button>
        <a href="{{ route('admin.vendors.index', ['vendor' => $selected->id, 'view' => 'statement']) }}" class="btn btn-light btn-sm">Clear</a>
    </div>
</form>
