A cotización (quotation) is a price estimate prepared for a client before a sale is confirmed. Any authenticated user can create one by navigating toDocumentation 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/. The final price (monto_total) is computed automatically — either from the product’s fixed price or from a formula that combines material area, thickness, profit margin, and laser cutting time — and is recalculated live in the browser as the user types, then persisted to the database on save.
Pricing Formula
The price calculation is defined in two places that share identical logic: the_calcular_monto() helper in views.py (used for the live AJAX preview at /ajax/calcular/) and the calcular_monto() method on the Cotizaciones model (called automatically in Cotizaciones.save()).
Fixed-price products
If the selectedProductos record has a non-null precio_fijo, that value is used directly as monto_total and all area/material calculations are skipped.
Variable-price calculation
For products without a fixed price, the formula is:| Variable | Source |
|---|---|
largo_cm, ancho_cm | Entered by the user (piece dimensions in centimetres) |
factor_costo | Looked up from TabuladorCostos using espesor_mm as the key |
porcentaje_utilidad | Stored on the Cotizaciones record; defaults to 40 % |
minutos_lazer | Optional laser cutting time entered by the user |
tarifa_laser_minuto | Singleton value from ConfiguracionPrecios.get_config() |
ROUND_HALF_UP (Python Decimal).
How Price Calculation Is Triggered
Navigate to the new order form
Go to
/pedidos/nuevo/ from the sidebar or from the Dashboard quick-access button labelled Nuevo Pedido. This is the active POS interface where the pricing engine runs both client-side (live preview) and server-side (on save).Select a client
Choose an existing client from the searchable Select2 dropdown. The list is pre-populated with all
Clientes records. You can type part of the client’s name or phone number to filter.Select a product and material
Pick the
Productos entry that matches the custom piece being quoted, then choose the acrylic sheet (Materiales) to be used.Enter dimensions and thickness
Fill in Largo (cm) and Ancho (cm) for the piece dimensions. Then select the Espesor (mm) from the dropdown, which is populated from the
TabuladorCostos table. The espesor value determines the factor_costo used in the material cost calculation.Optionally enter laser minutes
If the job requires laser cutting time, enter the estimated Minutos Láser (
minutos_lazer). Leave at 0 if no laser work is needed.Review the live price preview
As you update any field, the right-hand panel recalculates and displays a real-time cost breakdown — area, material cost, profit, laser cost, and total — by calling
POST /ajax/calcular/. The same formula mirrors the server-side logic in _calcular_monto(). If the product has a fixed price, the panel shows that price directly and marks the other fields as not applicable.Submit the order
Click Registrar Pedido Completo. The browser sends the cart as a JSON payload to
POST /pedidos/nuevo/ with Content-Type: application/json. For any Cotizaciones record that is created or updated separately (e.g., via the Django admin), Cotizaciones.save() automatically calls calcular_monto() to recompute and store monto_total.Cotizaciones Model Fields
TheCotizaciones model (db_table = 'cotizaciones') stores the following fields:
| Field | Type | Description |
|---|---|---|
id_cotizacion | AutoField (PK) | Auto-generated primary key |
id_cliente | FK → Clientes | The client this quote is for |
id_producto | FK → Productos | The product being quoted |
id_material | FK → Materiales | The acrylic sheet material |
largo_pza | DecimalField | Piece length in centimetres |
ancho_pza | DecimalField | Piece width in centimetres |
espesor_mm | IntegerField | Thickness in millimetres; used to look up TabuladorCostos.factor_costo |
porcentaje_utilidad | IntegerField | Profit margin percentage; defaults to 40 |
minutos_lazer | IntegerField | Estimated laser cutting time in minutes |
monto_total | DecimalField | Auto-calculated on every save() call |
fecha | DateField | Date the quotation was created |