Initial commit - production deployment

This commit is contained in:
2026-01-21 17:17:16 +01:00
commit c23d00dd92
2289 changed files with 638440 additions and 0 deletions

View File

@@ -0,0 +1,165 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🚨 URGENTE: Fallo de Equipo - {{ equipment_name }}</title>
<style>
body {
font-family: 'Arial', 'Helvetica', sans-serif;
line-height: 1.6;
color: #333;
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #fff;
}
.header {
background-color: #dc2626;
color: white;
padding: 15px;
border-radius: 8px 8px 0 0;
text-align: center;
}
.content {
padding: 20px;
}
.equipment-info {
background-color: #f8f9fa;
padding: 15px;
border-radius: 6px;
margin: 20px 0;
}
.equipment-info dt {
font-weight: bold;
margin-bottom: 5px;
}
.equipment-info dd {
margin-left: 0;
margin-bottom: 10px;
}
.failure-details {
background-color: #fef2f2;
border: 1px solid #fecaca;
padding: 15px;
border-radius: 6px;
margin: 20px 0;
}
.action-button {
display: inline-block;
background-color: #dc2626;
color: white;
padding: 10px 20px;
text-decoration: none;
border-radius: 6px;
font-weight: bold;
margin: 10px 0;
}
.support-contact {
background-color: #f0f9ff;
padding: 15px;
border-radius: 6px;
margin: 20px 0;
}
.footer {
text-align: center;
margin-top: 20px;
color: #666;
font-size: 12px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>🚨 URGENTE: Fallo de Equipo</h1>
<p>Acción Inmediata Requerida</p>
</div>
<div class="content">
<p>Estimado Equipo de Soporte,</p>
<p>Se ha reportado un fallo en el equipo <strong>{{ equipment_name }}</strong> en {{ equipment_location }}. Esto requiere su atención inmediata.</p>
<div class="equipment-info">
<h2>Información del Equipo</h2>
<dl>
<dt>Nombre del Equipo:</dt>
<dd>{{ equipment_name }}</dd>
<dt>Tipo:</dt>
<dd>{{ equipment_type }}</dd>
<dt>Modelo:</dt>
<dd>{{ equipment_model }}</dd>
<dt>Número de Serie:</dt>
<dd>{{ equipment_serial_number }}</dd>
<dt>Ubicación:</dt>
<dd>{{ equipment_location }}</dd>
</dl>
</div>
<div class="failure-details">
<h2>Detalles del Fallo</h2>
<dl>
<dt>Tipo de Fallo:</dt>
<dd>{{ failure_type }}</dd>
<dt>Gravedad:</dt>
<dd><strong style="color: {{ 'red' if severity == 'urgent' else 'orange' }};">{{ severity.upper() }}</strong></dd>
<dt>Descripción:</dt>
<dd>{{ description }}</dd>
<dt>Fecha/Hora Reportado:</dt>
<dd>{{ reported_time }}</dd>
<dt>Impacto Estimado:</dt>
<dd>{{ 'SÍ - Afecta producción' if estimated_impact else 'NO - Sin impacto en producción' }}</dd>
</dl>
</div>
<p>Este equipo ha sido marcado automáticamente como <strong>FUERA DE SERVICIO</strong> y retirado de producción para evitar más problemas.</p>
<div class="support-contact">
<h2>Información de Contacto de Soporte</h2>
{% if support_contact.email %}
<p><strong>Email:</strong> {{ support_contact.email }}</p>
{% endif %}
{% if support_contact.phone %}
<p><strong>Teléfono:</strong> {{ support_contact.phone }}</p>
{% endif %}
{% if support_contact.company %}
<p><strong>Empresa:</strong> {{ support_contact.company }}</p>
{% endif %}
{% if support_contact.contract_number %}
<p><strong>Número de Contrato:</strong> {{ support_contact.contract_number }}</p>
{% endif %}
{% if support_contact.response_time_sla %}
<p><strong>Tiempo de Respuesta Esperado:</strong> {{ support_contact.response_time_sla }} horas</p>
{% endif %}
</div>
<p><a href="{{ equipment_link }}" class="action-button">Ver Detalles del Equipo</a></p>
<p>Por favor responda dentro del plazo de SLA y actualice el sistema cuando la reparación esté completada.</p>
<p>Gracias,<br>
Equipo de {{ bakery_name }}</p>
</div>
<div class="footer">
<p>Esta es una notificación automática del Sistema de Monitoreo de Equipos de {{ bakery_name }}</p>
<p>© {{ current_year }} {{ bakery_name }}. Todos los derechos reservados.</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,159 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>✅ Equipo Reparado - {{ equipment_name }}</title>
<style>
body {
font-family: 'Arial', 'Helvetica', sans-serif;
line-height: 1.6;
color: #333;
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #fff;
}
.header {
background-color: #10b981;
color: white;
padding: 15px;
border-radius: 8px 8px 0 0;
text-align: center;
}
.content {
padding: 20px;
}
.equipment-info {
background-color: #f8f9fa;
padding: 15px;
border-radius: 6px;
margin: 20px 0;
}
.equipment-info dt {
font-weight: bold;
margin-bottom: 5px;
}
.equipment-info dd {
margin-left: 0;
margin-bottom: 10px;
}
.repair-details {
background-color: #dcfce7;
border: 1px solid #a3e635;
padding: 15px;
border-radius: 6px;
margin: 20px 0;
}
.action-button {
display: inline-block;
background-color: #10b981;
color: white;
padding: 10px 20px;
text-decoration: none;
border-radius: 6px;
font-weight: bold;
margin: 10px 0;
}
.downtime-summary {
background-color: #fef3c7;
padding: 15px;
border-radius: 6px;
margin: 20px 0;
}
.footer {
text-align: center;
margin-top: 20px;
color: #666;
font-size: 12px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>✅ Equipo Reparado</h1>
<p>Equipo de Vuelta en Servicio</p>
</div>
<div class="content">
<p>Estimado Equipo,</p>
<p>Nos complace informarle que el equipo <strong>{{ equipment_name }}</strong> ha sido reparado y vuelto al servicio con éxito.</p>
<div class="equipment-info">
<h2>Información del Equipo</h2>
<dl>
<dt>Nombre del Equipo:</dt>
<dd>{{ equipment_name }}</dd>
<dt>Tipo:</dt>
<dd>{{ equipment_type }}</dd>
<dt>Modelo:</dt>
<dd>{{ equipment_model }}</dd>
<dt>Ubicación:</dt>
<dd>{{ equipment_location }}</dd>
</dl>
</div>
<div class="repair-details">
<h2>Detalles de la Reparación</h2>
<dl>
<dt>Fecha de Reparación:</dt>
<dd>{{ repair_date }}</dd>
<dt>Técnico:</dt>
<dd>{{ technician_name }}</dd>
<dt>Descripción de la Reparación:</dt>
<dd>{{ repair_description }}</dd>
{% if parts_replaced and parts_replaced|length > 0 %}
<dt>Piezas Reemplazadas:</dt>
<dd>{{ parts_replaced|join(', ') }}</dd>
{% endif %}
<dt>Costo de Reparación:</dt>
<dd>€{{ "%.2f"|format(cost) }}</dd>
<dt>Resultados de Pruebas:</dt>
<dd>{{ '✅ Equipo probado y operativo' if test_results else '⚠️ Equipo requiere pruebas adicionales' }}</dd>
</dl>
</div>
<div class="downtime-summary">
<h2>Resumen de Tiempo de Inactividad</h2>
<dl>
<dt>Tiempo Total de Inactividad:</dt>
<dd>{{ downtime_hours }} horas</dd>
<dt>Impacto de Costo:</dt>
<dd>€{{ "%.2f"|format(cost) }}</dd>
</dl>
</div>
<p>El equipo ahora está <strong>OPERATIVO</strong> y disponible para producción.</p>
<p><a href="{{ equipment_link }}" class="action-button">Ver Detalles del Equipo</a></p>
<p>Gracias por su pronta atención a este asunto.</p>
<p>Atentamente,<br>
Equipo de {{ bakery_name }}</p>
</div>
<div class="footer">
<p>Esta es una notificación automática del Sistema de Monitoreo de Equipos de {{ bakery_name }}</p>
<p>© {{ current_year }} {{ bakery_name }}. Todos los derechos reservados.</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,297 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Purchase Order - {{po_number}}</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
line-height: 1.6;
color: #333333;
background-color: #f5f5f5;
margin: 0;
padding: 0;
}
.email-container {
max-width: 600px;
margin: 20px auto;
background-color: #ffffff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.header {
background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
color: #ffffff;
padding: 30px 20px;
text-align: center;
}
.header h1 {
margin: 0;
font-size: 24px;
font-weight: 600;
}
.header p {
margin: 8px 0 0 0;
font-size: 14px;
opacity: 0.9;
}
.content {
padding: 30px 20px;
}
.greeting {
font-size: 16px;
margin-bottom: 20px;
}
.info-box {
background-color: #F9FAFB;
border-left: 4px solid #4F46E5;
padding: 16px;
margin: 20px 0;
border-radius: 4px;
}
.info-box h3 {
margin: 0 0 12px 0;
font-size: 14px;
font-weight: 600;
text-transform: uppercase;
color: #6B7280;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #E5E7EB;
}
.info-row:last-child {
border-bottom: none;
}
.info-label {
font-weight: 500;
color: #6B7280;
}
.info-value {
font-weight: 600;
color: #111827;
}
.items-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
.items-table thead {
background-color: #F3F4F6;
}
.items-table th {
padding: 12px;
text-align: left;
font-size: 13px;
font-weight: 600;
color: #6B7280;
text-transform: uppercase;
border-bottom: 2px solid #E5E7EB;
}
.items-table td {
padding: 12px;
border-bottom: 1px solid #E5E7EB;
font-size: 14px;
}
.items-table tbody tr:last-child td {
border-bottom: none;
}
.items-table tbody tr:hover {
background-color: #F9FAFB;
}
.text-right {
text-align: right;
}
.total-row {
background-color: #F3F4F6;
font-weight: 600;
font-size: 16px;
}
.total-row td {
padding: 16px 12px;
border-top: 2px solid #4F46E5;
}
.cta-button {
display: inline-block;
background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
color: #ffffff;
text-decoration: none;
padding: 14px 28px;
border-radius: 6px;
font-weight: 600;
font-size: 14px;
margin: 20px 0;
text-align: center;
box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}
.cta-button:hover {
opacity: 0.9;
}
.notes {
background-color: #FEF3C7;
border-left: 4px solid #F59E0B;
padding: 16px;
margin: 20px 0;
border-radius: 4px;
}
.notes h4 {
margin: 0 0 8px 0;
font-size: 14px;
font-weight: 600;
color: #92400E;
}
.notes p {
margin: 0;
font-size: 14px;
color: #78350F;
}
.footer {
background-color: #F9FAFB;
padding: 20px;
text-align: center;
font-size: 12px;
color: #6B7280;
border-top: 1px solid #E5E7EB;
}
.footer p {
margin: 4px 0;
}
.footer a {
color: #4F46E5;
text-decoration: none;
}
@media only screen and (max-width: 600px) {
.email-container {
margin: 0;
border-radius: 0;
}
.content {
padding: 20px 16px;
}
.items-table th,
.items-table td {
padding: 8px;
font-size: 12px;
}
}
</style>
</head>
<body>
<div class="email-container">
<!-- Header -->
<div class="header">
<h1>📦 New Purchase Order</h1>
<p>Order #{{po_number}}</p>
</div>
<!-- Content -->
<div class="content">
<div class="greeting">
<p>Dear {{supplier_name}},</p>
<p>We would like to place the following purchase order:</p>
</div>
<!-- Order Information -->
<div class="info-box">
<h3>Order Details</h3>
<div class="info-row">
<span class="info-label">PO Number:</span>
<span class="info-value">{{po_number}}</span>
</div>
<div class="info-row">
<span class="info-label">Order Date:</span>
<span class="info-value">{{order_date}}</span>
</div>
<div class="info-row">
<span class="info-label">Required Delivery:</span>
<span class="info-value">{{required_delivery_date}}</span>
</div>
<div class="info-row">
<span class="info-label">Delivery Address:</span>
<span class="info-value">{{delivery_address}}</span>
</div>
</div>
<!-- Order Items -->
<table class="items-table">
<thead>
<tr>
<th>Product</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
{% for item in items %}
<tr>
<td>{{item.product_name}}</td>
<td class="text-right">{{item.ordered_quantity}} {{item.unit_of_measure}}</td>
<td class="text-right">{{currency_symbol}}{{item.unit_price}}</td>
<td class="text-right">{{currency_symbol}}{{item.line_total}}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr class="total-row">
<td colspan="3" class="text-right">Total Amount:</td>
<td class="text-right">{{currency_symbol}}{{total_amount}}</td>
</tr>
</tfoot>
</table>
<!-- Call to Action -->
<div style="text-align: center;">
<p style="margin-bottom: 10px;">Please confirm receipt of this order:</p>
<a href="mailto:{{bakery_email}}?subject=RE: PO {{po_number}} - Confirmation" class="cta-button">
Confirm Order
</a>
</div>
<!-- Important Notes -->
{% if notes %}
<div class="notes">
<h4>⚠️ Important Notes</h4>
<p>{{notes}}</p>
</div>
{% endif %}
<!-- Payment & Delivery Instructions -->
<div class="info-box" style="margin-top: 30px;">
<h3>Payment & Delivery</h3>
<p style="margin: 0; font-size: 14px; color: #6B7280;">
• Payment Terms: {{payment_terms}}<br>
• Delivery Instructions: {{delivery_instructions}}<br>
• Contact Person: {{contact_person}}<br>
• Phone: {{contact_phone}}
</p>
</div>
<!-- Footer Message -->
<p style="margin-top: 30px; font-size: 14px; color: #6B7280;">
Thank you for your continued partnership. If you have any questions about this order,
please don't hesitate to contact us.
</p>
<p style="font-size: 14px; color: #6B7280;">
Best regards,<br>
<strong>{{bakery_name}}</strong>
</p>
</div>
<!-- Footer -->
<div class="footer">
<p><strong>{{bakery_name}}</strong></p>
<p>{{bakery_address}}</p>
<p>Phone: {{bakery_phone}} | Email: <a href="mailto:{{bakery_email}}">{{bakery_email}}</a></p>
<p style="margin-top: 16px; font-size: 11px; color: #9CA3AF;">
This is an automated email. Please do not reply directly to this message.
</p>
</div>
</div>
</body>
</html>