The Registrar Devolución screen lets a student close one of their active loans by locating the record with their cédula, selecting the correct item, optionally noting any observations (e.g. missing accessories or damage), drawing a return signature, and confirming. The entire flow is contained inside theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gavafue/registroComponentesMultimedia/llms.txt
Use this file to discover all available pages before exploring further.
view-return section of the single-page app and requires no administrator involvement. Once confirmed, the loan record is updated in the database and the equipment is marked as returned.
Inactivity Timer
The return view includes a 5-minute inactivity guard. If no interaction is detected for five minutes while the Devolver tab is active, the app automatically switches back to the Retirar view and shows an informational toast. This prevents a partially-completed return form from being left open on a shared kiosk.Step-by-Step Return Flow
Open the Devolver tab
Click the Devolver button in the top navigation bar. The
view-return section becomes visible, the inactivity timer starts, and any previously displayed loan results are hidden until a new search is performed.Enter your Cédula and search for active loans
Type your cédula in the Tu Cédula de Identidad search field and click Buscar (or press Enter). The search field enforces the same 7–8 digit rule as the checkout form.The click handler calls Which issues a The PHP endpoint returns only the columns needed for display — it does not expose signature data to the public view:Example response
API.getActiveLoansByCI(ci):GET request:Select the loan to return
A list of loan cards is rendered dynamically inside The selected card receives a
#loans-list. Each card shows the equipment description and the checkout date/time. Click the card for the loan you want to close.selected CSS class and the hidden #return-loan-id input is populated with the loan’s database ID. The return form (#return-details) slides into view.Add optional observations
The Observaciones field (Leave the field blank if the equipment is returned in perfect condition.
#return-obs) is free text and entirely optional. Use it to note any issues with the returned equipment, such as missing accessories or damage noticed on return.Draw your return signature
Sign inside the Firma de Devolución canvas (
#return-signature-pad). This uses the same SignaturePad class as the checkout form, initialised as window.returnSignature.The clear button (data-canvas="return-signature-pad") wipes the canvas so you can redraw if needed.Confirm the return
Click Confirmar Devolución. The submit handler collects the loan ID, the base64-encoded signature, and any observation text, then calls The PHP endpoint sets
API.returnLoan():API.returnLoan() sends a PUT request:return_time = NOW(), stores the signature and observation, and flips status to 'returned'. It only updates rows that are currently active, preventing double-returns:Confirmation and reset
On success the app:
- Shows a green toast: “¡Devolución confirmada!”
- Resets the return form and clears the signature canvas
- Hides the loan list and return details panel
- Clears the CI search field and scrolls to the top of the page
- Returns focus to the CI input field for the next user
API Request / Response
Request| HTTP status | JSON body | Cause |
|---|---|---|
| 400 | {"error": "Faltan campos obligatorios para la devolución"} | return_signature missing from body |
| 400 | {"error": "Falta el ID del préstamo"} | id missing from body |
| 404 | {"error": "Préstamo no encontrado o ya devuelto"} | Loan ID doesn’t exist or status is already returned |
Error Handling
No active loans found
If the CI search returns an empty array, the loans list shows a message: “No tienes préstamos activos pendientes de devolver.” The return form remains hidden. The student should check that they typed the correct cédula.
Loan already returned
If a student attempts to return a loan whose status has already been changed to
returned (e.g. marked by an admin), the server returns HTTP 404. The app displays an error toast with the server’s message.Clearing the Search
The Limpiar button (#btn-clear-search-ci) resets the entire return panel — it clears the CI input, hides the loan list, hides the return form, and resets the hidden loan ID field. Use it to start a fresh search without switching tabs.
Pressing Escape while the CI field is focused also triggers the clear action, equivalent to clicking the Limpiar button.