Skip to main content

Vehicle Inspection Forms

After registering client information, the system generates individual inspection forms for each vehicle. Each form captures motorization type, ITV status, and observations.

Overview

Vehicle inspection forms are dynamically generated based on the number of vehicles specified during client registration. Each form is numbered sequentially and includes all necessary fields to document the inspection results.

Form Structure

Each vehicle form contains the following sections:
1

Vehicle Identification

Each form displays a header with the vehicle number:
🚙 Vehículo Nº [1, 2, 3, ...]
The numbering helps you track which vehicle you’re inspecting and corresponds to the final report.
2

Select Motorization Type

Choose the engine type from four available options:

Available Motorization Options

🛢️ Diesel
  • Radio button ID: radio1{N}
  • Name: motorizacion{N}
  • Value: "Diesel"
  • Rate: 50€ per vehicle
The motorization selection is required for each vehicle. Rates are automatically calculated based on your selection.
3

Select ITV Status

Indicate whether the vehicle passed inspection:

ITV Status Options

✅ Aprobado

Vehicle passed the ITV inspection
  • Radio button ID: radio5{N}
  • Name: aprobados{N}
  • Value: "Aprobo"

❌ No Aprobado

Vehicle failed the ITV inspection
  • Radio button ID: radio6{N}
  • Name: aprobados{N}
  • Value: "NoAprobo"
The ITV status field is required. You must select either “Aprobado” or “No Aprobado” before calculating results.
4

Add Observations (Optional)

Enter detailed notes about the vehicle’s condition:
  • Field ID: observaciones{N}
  • Type: Textarea
  • Max length: 250 characters
  • Rows: 4
  • Placeholder: “Ingrese observaciones sobre el estado del vehículo…”
Example observations:
  • “Neumáticos desgastados, requieren reemplazo”
  • “Sistema de frenos en buen estado”
  • “Emisiones fuera de norma, requiere ajuste”
  • “Luces delanteras con fisuras”

Pricing Structure

Inspection costs vary by motorization type:
MotorizationIconRate per Vehicle
Diesel🛢️50€
Gasolina45€
Híbrido🔋35€
Eléctrico30€
The total cost is calculated automatically based on the number of vehicles of each type.

Form Validation

Before you can calculate results, the system validates all vehicle forms:

Required Fields Check

for (let i = 1; i <= numeroAutos; i++) {
    // Verify motorization is selected
    const motorizacionSeleccionada = document.querySelector(`input[name="motorizacion${i}"]:checked`);
    if (!motorizacionSeleccionada) {
        mostrarError(`Por favor, seleccione la motorización para el vehículo ${i}.`);
        return false;
    }

    // Verify ITV status is selected
    const itvSeleccionado = document.querySelector(`input[name="aprobados${i}"]:checked`);
    if (!itvSeleccionado) {
        mostrarError(`Por favor, seleccione el estado ITV para el vehículo ${i}.`);
        return false;
    }
}

Validation Error Messages

  • Missing Motorization: “Por favor, seleccione la motorización para el vehículo .”
  • Missing ITV Status: “Por favor, seleccione el estado ITV para el vehículo .”

Completing Multiple Vehicles

When inspecting multiple vehicles:
  1. Work sequentially: Complete each vehicle form from top to bottom
  2. Use observations: Document any issues or notable conditions for each vehicle
  3. Double-check selections: Verify motorization and status before proceeding
  4. Scroll through forms: Each vehicle has its own distinct form section

Calculate Results Button

After filling out all vehicle forms, click the “Calcular Resultados” button:
  • Button ID: calcular
  • Function: calcularYMostrar()
  • Located at the bottom of all vehicle forms
  • Validates all forms before processing
  • Transitions to the results view
The “Calcular Resultados” button only appears after vehicle forms are generated. Make sure all required fields are completed before clicking it.

Data Processing

When you submit the forms, the system:
  1. Validates all required fields
  2. Collects data from each vehicle form
  3. Stores information in vehiculosData array:
vehiculosData.push({
    numero: i,
    motorizacion: motorizacion,
    estadoITV: estadoITV,
    observaciones: observaciones
});
  1. Calculates total cost based on motorization rates
  2. Generates the final inspection report

Technical Reference

Vehicle forms are created by:
  • generarFormulariosVehiculos() - Generates all forms (script.js:44-51)
  • crearFormularioVehiculo(numeroVehiculo) - Creates individual form HTML (script.js:58-102)
  • validarFormulariosVehiculos() - Validates all forms (script.js:167-184)
  • procesarDatosVehiculos() - Processes and stores data (script.js:189-204)

Next Steps

After completing all vehicle inspections and clicking “Calcular Resultados”:
  1. The forms will be hidden with a smooth animation
  2. The results section will display with client info, ITV statuses, and totals
  3. You can export or print the final inspection report

Build docs developers (and LLMs) love