Documentation 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.
The Pricing Configuration screen at /configuracion/ is the central control panel for every variable that feeds into an Acrylitec quote price. Here you can adjust the laser tariff, define material cost factors by thickness, and set per-product profit margins — all without touching code. Access to this screen is restricted to Administrators; any non-admin who navigates to /configuracion/ is redirected to the /sin-permiso/ page.
ConfiguracionPrecios — Laser Tariff (Singleton)
The ConfiguracionPrecios model stores the global laser operating cost. It is designed as a singleton: only one record ever exists in the database (pk=1). The class method get_config() creates that record automatically the first time it is needed, so you never have to seed it manually.
| Field | Type | Default | Description |
|---|
tarifa_laser_minuto | Decimal(8, 2) | 15.00 | Cost per laser minute in pesos |
actualizado | DateTimeField (auto) | — | Timestamp of last update (set automatically on every save) |
To update the laser tariff, submit a POST request to /configuracion/ with:
| Parameter | Value |
|---|
accion | tarifa_laser |
tarifa_laser_minuto | New rate (e.g. 18.50) |
The Pricing Configuration screen shows the current tariff and the date it was last changed, so you always have an audit trail at a glance.
TabuladorCostos — Cost Tabulador by Thickness
The TabuladorCostos model defines the raw material cost per square metre for each acrylic sheet thickness you cut. Every thickness you work with needs its own row; the quoting engine performs an exact match on espesor_mm when calculating a price.
| Field | Type | Description |
|---|
espesor_mm | Integer | Material thickness in millimetres |
factor_costo | Decimal(10, 4) | Cost factor per m² in pesos |
Example tabulador entries
| espesor_mm | factor_costo |
|---|
| 3 | 850.0000 |
| 5 | 1200.0000 |
| 8 | 1800.0000 |
Adding a new thickness row
Submit a POST request to /configuracion/ with:
| Parameter | Value |
|---|
accion | nuevo_tabulador |
espesor_mm | Thickness in mm (e.g. 6) |
factor_costo_nuevo | Cost factor in pesos/m² (e.g. 1500.00) |
Updating an existing thickness row
Submit a POST request to /configuracion/ with:
| Parameter | Value |
|---|
accion | factor_costo |
tabulador_id | Primary key of the TabuladorCostos record |
factor_costo | Updated cost factor in pesos/m² |
If no TabuladorCostos row exists for the requested espesor_mm, factor_costo defaults to 0.00 and the resulting quote price will be inaccurate. Always add a tabulador entry for every thickness you cut before creating quotes that use that thickness.
Per-Product Profit Margin
Each Productos record carries a porcentaje_utilidad field (default 40). This percentage is applied on top of the raw material cost to calculate the profit component of a quote. You can set a different margin for each product — for example, a higher margin on custom engraving jobs and a lower one on bulk sheet cuts.
To update a product’s margin, submit a POST request to /configuracion/ with:
| Parameter | Value |
|---|
accion | utilidad_producto |
producto_id | Primary key of the Productos record |
porcentaje_utilidad | New margin percentage (e.g. 55) |
When a quotation is calculated (via Cotizaciones.calcular_monto() or the _calcular_monto() view helper), the following logic applies:
from decimal import Decimal, ROUND_HALF_UP
# If the product has a fixed retail price, it is used directly:
monto_total = producto.precio_fijo
# Otherwise, the formula is applied:
area_m2 = (largo_cm * ancho_cm) / 10000
factor = TabuladorCostos.objects.get(espesor_mm=espesor_mm).factor_costo
costo_material = area_m2 * factor
utilidad = costo_material * (porcentaje_utilidad / 100)
costo_laser = minutos_lazer * tarifa_laser_minuto
monto_total = (costo_material + utilidad + costo_laser).quantize(
Decimal('0.01'), rounding=ROUND_HALF_UP
)
Each component maps directly to settings on the Pricing Configuration screen:
factor — set via the TabuladorCostos panel (per-thickness row)
porcentaje_utilidad — set via the per-product margin panel
tarifa_laser_minuto — set via the laser tariff panel
Products with a precio_fijo bypass the formula entirely — the fixed price is returned as-is, with costo_material, utilidad, and costo_laser all set to 0.00. This is ideal for standard catalog items like keychains or trophies that have a known retail price regardless of cutting time or sheet dimensions.
Price configuration changes apply to the next quotation created after saving. Existing Cotizaciones and Ventas records store their monto_total at the time of creation and are not recalculated retroactively.