Skip to main content

Overview

The service ticket creation process (Hoja de Servicio) allows you to register new repair jobs with client information, device details, and work descriptions. The system includes smart client lookup, device catalog integration, and automatic folio generation.

Prerequisites

  • Permission: servicios.crear (Create Services)
  • Active user account with appropriate role (Técnico or Administrador)

Step-by-Step Process

1
Access the Service Ticket Form
2
Navigate to the service ticket creation page from your main dashboard. The form is located at /hoja-servicio.
3
Enter Client Information
4
  • Name: Start typing the client’s name (minimum 3 characters)
    • The system will search for existing clients automatically
    • Matching suggestions appear in a dropdown below the field
    • Select an existing client to auto-fill their contact details
  • Address: Enter the client’s physical address (optional)
  • Phone: Enter a 10-digit phone number
    • Only numeric input is accepted
    • This field is used for client lookup and duplicate detection
  • 5
    When you select an existing client from suggestions, their phone, address, and preferred serial number settings are automatically populated.
    6
    Specify Device Information
    7
  • Device Type: Select from dropdown
    • Laptop
    • Desktop Computer (PC)
    • Printer
    • Monitor
  • Brand: Type or select from the datalist
    • Common brands: Apple, MSI, Lenovo, Acer, Dell, Ateck, Asus, HP
  • Model: Select from the filtered list
    • Available models update based on selected brand
    • Device specifications auto-populate when model is selected
  • Serial Number:
    • Enter the device’s serial number
    • Or check “No quiero poner el numero de serie” to skip
  • 8
    You must either provide a serial number OR explicitly check the “skip serial number” option. The form will not submit without one of these choices.
    9
    Configure Device-Specific Details
    10
    Depending on the device type selected, different sections appear:
    11
    For Laptop/PC:
    12
    // Auto-populated from model catalog if available
    {
      procesador: "Intel Core i5",  // Processor
      ram: "8 GB",                   // RAM
      disco: "SSD 256 GB",          // Storage
      estadoPantalla: "Funciona bien",
      estadoTeclado: "Funciona bien",
      estadoMouse: "Funciona bien",
      funciona: "Sí",
      enciendeEquipo: "Sí",
      contrasenaEquipo: ""          // Optional password
    }
    
    13
  • Screen Status: Functioning, With defects, or Damaged
  • Keyboard Status: Working, some keys fail, most don’t work, or not working
  • Mouse/Touchpad: Working, sometimes fails, or not working
  • Device Password: Optional field for access credentials
  • 14
    For Printers:
    15
  • Type: Inkjet, Laser, or Multifunction
  • Prints Correctly: Yes/No
  • Physical Conditions: Free text description
  • 16
    For Monitors:
    17
  • Size: Screen size in inches
  • Correct Colors: Yes/No
  • Physical Conditions: Free text description
  • 18
    Check “Rellenar caracteristicas despues” (Fill characteristics later) if you need to capture device specs after initial registration.
    19
    Describe Work and Pricing
    20
  • Work to Perform: Describe the repair work or issue
    • This field uses fuzzy matching for duplicate detection
    • Textarea auto-expands as you type
  • Estimated Cost:
    • Enter numeric value
    • Or check “Precio se define después del mantenimiento” to set price later
  • 21
    Submit the Service
    22
    Click “Guardar Registro y Generar PDF” to:
    23
  • Save the service record to Firestore
  • Create or update the client record
  • Generate a unique folio number
  • Produce a PDF service sheet
  • Navigate to the ticket detail view
  • Duplicate Detection

    The system prevents duplicate service entries using:
    // Deduplication key structure
    const dedupeKey = `${phone}|${deviceType}|${brand}|${model}`;
    
    Active services are flagged as duplicates when:
    • Same phone number, device type, brand, and model
    • Service is not in a final state (not “entregado”, “cancelado”, or “no_reparable”)
    • Similar work description (normalized text matching)
    If a duplicate is detected:
    The system shows an alert with the existing service folio and offers to open that service instead.

    Client Auto-Linking

    When creating a service:
    1. Existing Client Selected: Updates their record with latest info
    2. New Client: Creates a new client document automatically
    3. Client ID: Stored in servicioId field for relationship tracking
    // Service-to-client linkage
    const servicePayload = {
      clienteId: clientIdFinal,  // Links to clients collection
      nombre: form.nombre,
      telefono: form.telefono,
      // ... other fields
    };
    

    Folio Generation

    Each service receives a unique folio identifier:
    • Format varies by brand (e.g., “MSI/001”, “HP/042”)
    • Stored in a separate folios collection for uniqueness guarantee
    • Cannot be changed after creation
    • Used for service lookup in POS and status tracking
    See: src/js/services/servicios_firestore.js:196-229

    Best Practices

    Use Client Lookup

    Always search for existing clients before creating new ones to maintain clean data.

    Complete Serial Numbers

    Capture serial numbers when possible for warranty tracking and device identification.

    Detailed Work Descriptions

    Write clear work descriptions to avoid confusion and improve duplicate detection.

    Verify Device Info

    Confirm auto-populated specs match the actual device before submitting.

    Troubleshooting

    Client suggestions not appearing?
    • Ensure you’ve typed at least 3 characters
    • Check that the client exists in the database
    • Wait for the 300ms debounce delay
    Model specs not auto-filling?
    • Verify the brand and model combination exists in the CSV catalog
    • Try manually entering specifications
    Duplicate service alert?
    • Review the existing service to confirm it’s truly a duplicate
    • If it’s a different repair, modify the work description to be more specific
    • Consider marking the old service as completed/delivered first

    Build docs developers (and LLMs) love