Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt

Use this file to discover all available pages before exploring further.

A Control Perceptivo is the formal warehouse receipt document that records the physical reception of materials from a supplier. When materials arrive at the warehouse, a Control Perceptivo is created at /entradas to establish a verifiable record of what was received, from whom, and in what quantities. Each receipt ties together administrative references such as purchase orders and delivery notes with actual line-item material quantities, providing a complete inbound traceability chain.

Data Model

ControlPerceptivo

Represents the receipt header — one document per supplier delivery.
id_control
number
required
Auto-generated primary key for the receipt.
numero_control
string
required
Human-readable control number entered by the user at creation (e.g. ACTA 001-2025). Must be unique across all receipts.
numero_nota_entrega
string | null
The supplier’s delivery note number. Optional; stored as null when not provided.
fecha_control
string
required
ISO-8601 date string representing when the receipt was registered (e.g. 2025-01-15).
fk_id_proveedor
number
required
Foreign key referencing the supplier (proveedores) who delivered the materials.
proveedor_nombre
string
Supplier name resolved via JOIN. Read-only; populated by the API on retrieval.
observacion
string | null
Free-text notes about the delivery (e.g. "Entrega parcial"). Optional.
foto
string | null
Base64-encoded image attached to the receipt header. Optional.
numero_requerimiento
string | null
Internal requisition number that originated the purchase. Optional.
numero_orden_compra
string | null
Purchase order number issued to the supplier. Optional.
detalles
ControlPerceptivoDetalle[]
Array of line items describing the materials and quantities received. Populated on detail retrieval.

ControlPerceptivoDetalle

Represents a single material line within a receipt. A receipt must contain at least one detail line.
id_detalle_control
number
Auto-generated primary key for the detail line.
fk_id_control
number
Foreign key back to the parent ControlPerceptivo.
fk_id_material
number
required
Foreign key referencing the material (materiales) being received.
material_descripcion
string
Material description resolved via JOIN. Read-only; populated by the API on retrieval.
cantidad
number
required
Quantity of the material received. Must be greater than 0. Accepts decimal values. The API accepts both number and numeric string (automatically coerced to number).

Creating a Receipt

New receipts are created at the dedicated form route /entradas/crear. The form is split into a header section (receipt metadata) and a materials detail section (line items). At least one material line must be added before submitting.
1

Select a Supplier

Choose the delivering supplier from the Proveedor dropdown. The list is populated from all active suppliers in the system. This field is required.
2

Set the Control Number and Date

Enter a unique Número de Control (e.g. ACTA 001-2025) and select the Fecha for when the receipt is being registered. Both fields are required and the control number is user-provided — it is not auto-generated.
3

Fill in Order References (Optional)

Optionally provide the Número Nota Entrega (supplier delivery note), Número Requerimiento (internal requisition), and Número Orden Compra (purchase order). These fields link the receipt to procurement documents for traceability.
4

Add Material Lines

In the Detalles de Materiales panel, select a material from the Material dropdown and enter the Cantidad received. Optionally attach a photo of the goods for the detail line. Click Agregar to append the line to the receipt table. Repeat for each material in the delivery. Each material can only appear once per receipt.
5

Submit the Receipt

Click Registrar Control Perceptivo to save. On success, the application navigates back to /entradas and stock levels (existencias) are updated automatically by the backend.
Submitting a Control Perceptivo automatically increases the warehouse stock (existencias) for each material in the detalles array. No separate stock adjustment is required.

Viewing Receipts

The list view at /entradas displays all registered receipts in a sortable data table. Each row exposes the following columns:
ColumnDescription
Nº ControlThe receipt control number (numero_control). Sortable.
FechaThe registration date (fecha_control), formatted as a locale date string. Sortable.
Nota EntregaThe supplier delivery note number (numero_nota_entrega), or N/A when absent.
ActionsRow-level actions for viewing receipt details.
Click any row’s action menu to inspect the full receipt, including the resolved proveedor_nombre and all detalles lines.

API Operations

List All Receipts

No query parameters. Returns all Control Perceptivo records without detalles.
GET /controles-perceptivos
[
  {
    "id_control": 1,
    "numero_control": "ACTA 001-2025",
    "fecha_control": "2025-01-15",
    "fk_id_proveedor": 3,
    "proveedor_nombre": "Distribuidora Central",
    "numero_nota_entrega": "NE-2025-001",
    "numero_requerimiento": "REQ-001",
    "numero_orden_compra": "OC-2025-010",
    "observacion": "Entrega parcial",
    "foto": null
  }
]

Get a Single Receipt

Returns the full receipt including its detalles array with resolved material_descripcion for each line.
GET /controles-perceptivos/:id
id
number
required
The id_control of the receipt to retrieve.
{
  "id_control": 1,
  "numero_control": "ACTA 001-2025",
  "fecha_control": "2025-01-15",
  "fk_id_proveedor": 3,
  "proveedor_nombre": "Distribuidora Central",
  "observacion": "Entrega parcial",
  "foto": null,
  "detalles": [
    {
      "id_detalle_control": 1,
      "fk_id_control": 1,
      "fk_id_material": 5,
      "material_descripcion": "Cable UTP Cat6",
      "cantidad": 100
    },
    {
      "id_detalle_control": 2,
      "fk_id_control": 1,
      "fk_id_material": 12,
      "material_descripcion": "Conector RJ45",
      "cantidad": 50
    }
  ]
}

Create a Receipt

Creates a new Control Perceptivo and its detail lines in a single request. The backend increments warehouse stock for all materials in detalles.
POST /controles-perceptivos
Request body:
{
  "numero_control": "ACTA 001-2025",
  "numero_nota_entrega": "NE-2025-001",
  "fecha_control": "2025-01-15",
  "fk_id_proveedor": 3,
  "numero_requerimiento": "REQ-001",
  "numero_orden_compra": "OC-2025-010",
  "observacion": "Entrega parcial",
  "detalles": [
    { "fk_id_material": 5, "cantidad": 100 },
    { "fk_id_material": 12, "cantidad": 50 }
  ]
}
numero_control
string
required
Unique, user-provided control number (e.g. ACTA 001-2025). Not auto-generated; must be unique across all receipts.
numero_nota_entrega
string
Supplier delivery note number. Optional.
fecha_control
string
required
Receipt date in YYYY-MM-DD format.
fk_id_proveedor
number
required
ID of the supplying vendor.
numero_requerimiento
string
Internal requisition number. Optional.
numero_orden_compra
string
Purchase order number. Optional.
observacion
string
Free-text delivery notes. Optional.
detalles
array
required
Array of material lines. Each element requires fk_id_material (number) and cantidad (number > 0). Minimum one item required.
The numero_control field is user-provided and must be unique across all receipts. Attempting to create a duplicate control number will result in an error from the backend.

Build docs developers (and LLMs) love