iteracion 2

This commit is contained in:
Nachou-u
2026-09-07 18:44:32 -03:00
parent a103a47ae6
commit 09a3f6fb37
93 changed files with 7394 additions and 349 deletions
+72
View File
@@ -0,0 +1,72 @@
{% extends 'base.html' %}
{% load humanize %}
{% block content %}
<section class="page-view active">
<div class="view-header">
<div class="view-title">
<h2><i data-lucide="shopping-cart" style="color:var(--efintel-blue);"></i> Catálogo de Ítems y Servicios de Compras</h2>
<p>Catálogo homologado de bienes, insumos, arriendos y servicios para requisiciones u órdenes de compra.</p>
</div>
<div>
<a href="{% url 'procurement:catalog_create' %}" class="btn-primary" style="text-decoration:none;">
<i data-lucide="plus-circle" style="width:16px;"></i> + Nuevo Ítem de Catálogo
</a>
</div>
</div>
<div class="filter-bar" style="margin-bottom: 1.5rem;">
<form method="get" class="d-flex" style="gap: 1rem; align-items: flex-end;">
<div class="form-group" style="flex: 1;">
<label for="q">Buscar (Código/Nombre)</label>
<input type="text" name="q" id="q" class="form-control" value="{{ query }}" placeholder="Ej. Laptops, CAT-001...">
</div>
<div class="form-group" style="flex: 1;">
<label for="category">Categoría</label>
<select name="category" id="category" class="form-control">
<option value="">Todas</option>
{% for cat in categories %}
<option value="{{ cat.id }}" {% if cat.id|stringformat:"s" == selected_cat %}selected{% endif %}>{{ cat.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<button type="submit" class="btn-primary" style="height: 38px;">Filtrar</button>
</div>
</form>
</div>
<div class="data-card">
<table class="data-table">
<thead>
<tr>
<th>Código</th>
<th>Descripción</th>
<th>Unidad</th>
<th>Precio Ref. (CLP)</th>
<th>SLA (Días)</th>
<th>Proveedor Preferido</th>
</tr>
</thead>
<tbody>
{% for item in items %}
<tr>
<td><strong>{{ item.code }}</strong></td>
<td>{{ item.name }}</td>
<td>{{ item.get_unit_display }}</td>
<td>${{ item.reference_price_clp|floatformat:"0"|intcomma }} CLP</td>
<td>{{ item.sla_days }} días</td>
<td>{{ item.preferred_vendor.name|default:"Sin asignar" }}</td>
</tr>
{% empty %}
<tr>
<td colspan="6" style="text-align:center; padding:2rem; color:var(--text-secondary);">
No hay ítems registrados en el catálogo. <a href="{% url 'procurement:catalog_create' %}">Crear el primero</a>.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
{% endblock %}