Acrylitec supports two sales flows. The primary flow is the POS (Point of Sale) interface atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/YonAnn99/Acrylitec/llms.txt
Use this file to discover all available pages before exploring further.
/pedidos/nuevo/, which accepts a multi-item cart, calculates subtotals client-side, and persists the order as a single Ventas record with one DetalleVenta row per line item. A legacy quote-based flow (linking a Ventas record to an existing Cotizaciones record via id_cotizacion) is also retained for backward compatibility with orders created before the POS system was introduced.
POS Order Flow
Open the new order form
Navigate to
/pedidos/nuevo/. The page is accessible to all authenticated users and renders the Punto de Venta (POS) interface.Select or create a client
Choose an existing client from the searchable Select2 dropdown. If the client is not yet registered, click Nuevo cliente to open a modal form. Submitting the modal calls the AJAX endpoint
POST /ajax/crear-cliente/ in the background, which creates a Clientes record and returns the new id_cliente and nombre so the dropdown can be updated immediately without a page reload.Once the first cart item is added, the client selector is locked to prevent accidental changes.Configure each line item
For each item in the order, fill in:
- Producto and Material from the respective Select2 dropdowns
- Cantidad (quantity, minimum 1)
- Largo (cm) and Ancho (cm) — piece dimensions
- Espesor (mm) — acrylic thickness, selected from the
TabuladorCostosentries - Min. Láser — laser cutting minutes (optional, defaults to 0)
- Utilidad (%) — profit margin for this line item (defaults to 40)
tarifa_laser_minuto value is injected into the page from ConfiguracionPrecios via the template context.Add the item to the cart
Click Agregar al Carrito. The line item — including its computed subtotal — is appended to the in-memory
carrito array and displayed in the Resumen del Pedido table. The grand total updates automatically.Set payment and delivery details
In the Cobro y Confirmación section, enter:
- Monto abonado ($) — advance payment received (pre-filled with the grand total; edit as needed)
- Estatus inicial — starting status for the order (see Sales Statuses below)
- Fecha de entrega — optional promised delivery date
Submit the order
Click Registrar Pedido Completo. The browser serialises the cart as a JSON payload and sends it via
fetch to POST /pedidos/nuevo/ with the Content-Type: application/json header.Server-side processing
The
nuevo_pedido view detects the JSON content type and performs the following in sequence:- Creates a
Ventasrecord linked to the selected client, with the providedmonto_abonado,estatus, and optionalfecha_entrega. - For each item in the
carritoarray, creates aDetalleVentarecord storing the product, material, dimensions, laser minutes, and subtotal. - Decrements
Materiales.stock_actualby the item’scantidadfor each material used. - Checks whether any material’s
stock_actualhas dropped to or belowstock_minimo. - Returns a JSON response with
ok: true, the newventa_id, and anyalertas_stockentries.
/ventas/<venta_id>/.Sales Statuses
EveryVentas record carries an estatus field with one of four choices defined in the model:
| Value | Label | Meaning |
|---|---|---|
pendiente | Pendiente | Default state — order received but not yet started |
en_produccion | En producción | The acrylic pieces are actively being cut or processed |
pagada | Pagada | Full payment has been received; counts as revenue in dashboard and sales KPIs |
entregada | Entregada | Order has been physically delivered to the client; counts as revenue in dashboard and sales KPIs |
Updating Order Status
To change the estatus or set a delivery date, submit a standard HTMLPOST form to:
estatus field (one of the four values above). Optionally include fecha_entrega (ISO date string YYYY-MM-DD) to record or update the promised delivery date. The view validates the status value and saves the changes, then redirects back to /ventas/<pk>/.
The order detail page (/ventas/<pk>/) also renders a four-step visual progress bar — Pendiente → En producción → Pagada → Entregada — that highlights the current stage.
Managing Advance Payments
EachVentas record stores a monto_abonado field representing the amount already paid by the client. The remaining balance is computed on the fly by the saldo_restante property:
POST to:
monto_abonado in the request body with the new cumulative total paid. The view saves the value and redirects to the order detail page, where the updated saldo_restante is displayed immediately.
Viewing the Sales List
The full sales history is available at/ventas/. In addition to the paginated table of all orders, the page header shows five summary KPI cards computed by the lista_ventas view:
| KPI | Description |
|---|---|
| Total ventas | Count of all Ventas records |
| Ingresos totales | Sum of order totals where estatus is pagada or entregada |
| Pendientes | Count of orders with estatus = pendiente |
| En producción | Count of orders with estatus = en_produccion |
| Entregadas | Count of orders with estatus = entregada |
VTA-XXXX), date, client name, product name, total amount, amount paid, current status badge, and a Ver link to the detail view.
Low Stock Alerts
After eachDetalleVenta is saved, the server checks whether the consumed material’s stock_actual has dropped to or below its configured stock_minimo. If so, the material is added to the alertas_stock list in the JSON response:
DetalleVenta Line Items
The
DetalleVenta model (db_table = 'detalle_venta') stores one row per cart item and links back to its parent order via a CASCADE foreign key. Its fields are:| Field | Type | Description |
|---|---|---|
id_detalle | AutoField (PK) | Auto-generated primary key |
id_venta | FK → Ventas | Parent sale (deletes children on cascade) |
id_producto | FK → Productos | Product for this line item |
id_material | FK → Materiales | Material used for this line item |
cantidad | IntegerField | Number of pieces (default 1) |
largo_pza | DecimalField | Piece length in centimetres |
ancho_pza | DecimalField | Piece width in centimetres |
espesor_mm | DecimalField | Thickness in millimetres |
minutos_lazer | IntegerField | Laser cutting minutes (default 0) |
subtotal | DecimalField | Pre-calculated line total sent from the client |