{{-- resources/views/reportes/ajustes/realizados_form.blade.php --}}
{{-- Reemplaza: el formulario que llama a ajustesrealizados.php --}}
@extends('layouts.app')

@section('content')
<div class="container mt-4">
  <h3>Ajustes Realizados</h3>

  <form method="POST" action="{{ route('reportes.ajustes.realizados.pdf') }}" target="_blank">
    @csrf

    <div class="row g-3 mt-2">
      <div class="col-md-3">
        <label class="form-label">Fecha desde</label>
        <input type="date" name="fechaini" class="form-control"
               value="{{ date('Y-m-01') }}" required>
      </div>
      <div class="col-md-3">
        <label class="form-label">Fecha hasta</label>
        <input type="date" name="fechafin" class="form-control"
               value="{{ date('Y-m-d') }}" required>
      </div>
      <div class="col-md-3">
        <label class="form-label">Tipo de ajuste</label>
        <select name="tipmov" class="form-select">
          <option value="0">Todos (Cargos y Abonos)</option>
          <option value="5">Solo Cargos</option>
          <option value="6">Solo Abonos</option>
        </select>
      </div>
      <div class="col-md-3 d-flex align-items-end">
        <button type="submit" class="btn btn-primary w-100">
          Generar PDF
        </button>
      </div>
    </div>

    @if ($errors->any())
      <div class="alert alert-danger mt-3">
        @foreach ($errors->all() as $e)
          <div>{{ $e }}</div>
        @endforeach
      </div>
    @endif
  </form>
</div>
@endsection