diff --git a/ucepsa/edge-oee-demo/services/order-report-api/app/templates/order_report.html b/ucepsa/edge-oee-demo/services/order-report-api/app/templates/order_report.html
index 2d6ba8d..7aeba34 100644
--- a/ucepsa/edge-oee-demo/services/order-report-api/app/templates/order_report.html
+++ b/ucepsa/edge-oee-demo/services/order-report-api/app/templates/order_report.html
@@ -278,7 +278,69 @@
+
Ingreso neto
{{ margin.revenue_net_eur|num(2) }} €
+
Cliente
{{ margin.customer_name or "Sin cliente" }}
+
Pedido venta
{{ margin.sale_order_ref or "Sin pedido" }}
+
Coste paros
{{ margin.stop_cost_eur|num(2) }} €
+
Coste material
{{ margin.material_cost_estimated_eur|num(2) if margin.material_cost_estimated_eur is not none else "Pendiente" }}
+
Coste conocido
{{ margin.known_or_estimated_cost_eur|num(2) }} €
+
Margen estimado
{{ margin.estimated_margin_eur|num(2) if margin.estimated_margin_eur is not none else "No calculable" }}
+
Estado margen
{% if margin.margin_status == 'PARTIAL_MARGIN_MISSING_RAW_MATERIAL_COST' %}Pendiente coste de materia prima{% elif margin.margin_status == 'ESTIMATED_MARGIN_AVAILABLE' %}Margen estimado disponible{% elif margin.margin_status == 'NO_MARGIN_WITHOUT_REVENUE' %}Sin ingreso de venta vinculado{% else %}{{ margin.margin_status }}{% endif %}
+
+
+
+ | Métrica | Valor |
+ | Ingreso neto venta | {{ margin.revenue_net_eur|num(2) if margin.revenue_net_eur is not none else "" }} € |
+ | Ingreso total venta | {{ margin.revenue_total_eur|num(2) if margin.revenue_total_eur is not none else "" }} € |
+ | Pedido venta | {{ margin.sale_order_ref or "" }} |
+ | Cliente | {{ margin.customer_name or "" }} |
+ | Materia prima consumida | {{ margin.raw_materials_summary or "Sin materia prima detectada" }} |
+ | Coste materia prima | {{ margin.material_cost_estimated_eur|num(2) if margin.material_cost_estimated_eur is not none else "Pendiente de coste" }} |
+ | Estado coste materia prima | {% if margin.material_cost_source_status == 'MISSING_RAW_MATERIAL_COST_PARAMETER' %}Pendiente coste de materia prima{% elif margin.material_cost_source_status == 'FROM_RAW_MATERIAL_COSTS' %}Calculado desde coste de materia prima{% elif margin.material_cost_source_status == 'FROM_ODOO_RAW_MATERIAL_VALUE' %}Calculado desde valoración Odoo{% else %}{{ margin.material_cost_source_status }}{% endif %} |
+ | Coste paros | {{ margin.stop_cost_eur|num(2) }} € |
+ | Coste conocido o estimado | {{ margin.known_or_estimated_cost_eur|num(2) }} € |
+ | Margen parcial tras costes conocidos | {{ margin.partial_margin_after_known_costs_eur|num(2) if margin.partial_margin_after_known_costs_eur is not none else "" }} € |
+ | Margen estimado | {{ margin.estimated_margin_eur|num(2) if margin.estimated_margin_eur is not none else "No calculable todavía" }} |
+ | % margen estimado | {{ margin.estimated_margin_pct|num(2) if margin.estimated_margin_pct is not none else "No calculable todavía" }} |
+ | Estado económico | {% if margin.margin_status == 'PARTIAL_MARGIN_MISSING_RAW_MATERIAL_COST' %}Pendiente coste de materia prima{% elif margin.margin_status == 'ESTIMATED_MARGIN_AVAILABLE' %}Margen estimado disponible{% elif margin.margin_status == 'NO_MARGIN_WITHOUT_REVENUE' %}Sin ingreso de venta vinculado{% else %}{{ margin.margin_status }}{% endif %} |
+
+
+
+
+ | Código |
+ Materia prima |
+ Cantidad prevista |
+ Cantidad consumida |
+ UdM |
+ Coste €/kg |
+ Coste estimado |
+ Estado |
+
+ {% for raw in raw_materials %}
+
+ | {{ raw.raw_product_default_code or "" }} |
+ {{ raw.raw_product_name or "" }} |
+ {{ raw.planned_qty|num(3) if raw.planned_qty is not none else "" }} |
+ {{ raw.consumed_qty|num(3) if raw.consumed_qty is not none else "" }} |
+ {{ raw.raw_uom or "" }} |
+ {{ raw.material_cost_eur_per_kg|num(4) if raw.material_cost_eur_per_kg is not none else "" }} |
+ {{ raw.material_cost_estimated_eur_rounded|num(2) if raw.material_cost_estimated_eur_rounded is not none else "" }} |
+ {% if raw.material_cost_status == 'MISSING_RAW_MATERIAL_COST_PARAMETER' %}Pendiente coste materia prima{% elif raw.material_cost_status == 'FROM_RAW_MATERIAL_COST_PARAMETER' %}Coste manual validado{% elif raw.material_cost_status == 'FROM_ODOO_STOCK_MOVE_VALUE' %}Coste desde Odoo{% else %}{{ raw.material_cost_status }}{% endif %} |
+
+ {% else %}
+ | Sin materias primas detectadas para la orden. |
+ {% endfor %}
+
+ {% else %}
+ No hay datos comerciales o económicos vinculados a esta orden.
+ {% endif %}
+
+