110 lines
5.6 KiB
HTML
110 lines
5.6 KiB
HTML
{% extends "macros/base.html" %}
|
|
{% from 'macros/modals.html' import alert_modal, rendicion_detail_modal, confirm_modal, edit_rendicion_modal %}
|
|
{% from "macros/ui.html" import flashed_messages %}
|
|
|
|
{% block title %}Historial de Rendiciones{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h2 class="mb-0">Historial de Rendiciones</h2>
|
|
</div>
|
|
|
|
<div class="card shadow-sm mb-4 border-0">
|
|
<div class="card-body bg-body-tertiary rounded p-3">
|
|
<form method="GET" action="{{ url_for('admin.admin_rendiciones') }}" id="filterForm">
|
|
<div class="row g-2 align-items-end">
|
|
<div class="col-md-2">
|
|
<label class="form-label small text-muted mb-1">Desde</label>
|
|
<input type="date" name="fecha_inicio" class="form-control form-control-sm" value="{{ fecha_inicio }}">
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label class="form-label small text-muted mb-1">Hasta</label>
|
|
<input type="date" name="fecha_fin" class="form-control form-control-sm" value="{{ fecha_fin }}">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label class="form-label small text-muted mb-1">Zona</label>
|
|
<select name="zona_id" id="zonaSelect" class="form-select form-select-sm">
|
|
<option value="">Todas las Zonas</option>
|
|
{% for z in zonas %}
|
|
<option value="{{ z[0] }}" {% if zona_actual|string == z[0]|string %}selected{% endif %}>{{ z[1] }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label class="form-label small text-muted mb-1">Módulo</label>
|
|
<select name="modulo_id" id="moduloSelect" class="form-select form-select-sm">
|
|
<option value="">Todos los Módulos</option>
|
|
{% for m in modulos %}
|
|
<option value="{{ m[0] }}" data-zona="{{ m[2] }}" {% if modulo_actual|string == m[0]|string %}selected{% endif %}>{{ m[1] }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<button type="submit" class="btn btn-primary btn-sm w-100"><i class="bi bi-search"></i> Filtrar</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{{ flashed_messages() }}
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="card-body p-0">
|
|
<table class="table table-striped table-hover mb-0">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Fecha</th>
|
|
<th>Trabajador</th>
|
|
<th>Módulo</th>
|
|
<th>Total Declarado</th>
|
|
<th>Gastos</th>
|
|
<th class="text-end">Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for r in rendiciones %}
|
|
<tr>
|
|
<td class="align-middle">{{ r[1] }}</td>
|
|
<td class="align-middle">{{ r[2] }}</td>
|
|
<td class="align-middle"><span class="badge bg-info text-dark">{{ r[3] }}</span></td>
|
|
|
|
<td class="align-middle">
|
|
${{ "{:,.0f}".format((r[4] or 0) + (r[5] or 0) + (r[6] or 0) + (r[7] or 0)).replace(',', '.') }}
|
|
</td>
|
|
<td class="align-middle text-danger">${{ "{:,.0f}".format(r[8] or 0).replace(',', '.') }}</td>
|
|
<td class="text-end">
|
|
<div class="btn-group" role="group">
|
|
<button type="button" class="btn btn-sm btn-info text-white" data-bs-toggle="modal" data-bs-target="#viewRendicion{{ r[0] }}" title="Ver Detalle"><i class="bi bi-eye"></i></button>
|
|
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#editRendicion{{ r[0] }}" title="Editar Valores Declarados"><i class="bi bi-pencil"></i></button>
|
|
<button type="button" class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#deleteRendicion{{ r[0] }}" title="Eliminar Rendición"><i class="bi bi-trash"></i></button>
|
|
</div>
|
|
|
|
{{ rendicion_detail_modal(r, r[23], r[24], r[25]) }}
|
|
{{ edit_rendicion_modal(r, r[23], workers, modulos) }}
|
|
|
|
{{ confirm_modal(
|
|
id='deleteRendicion' ~ r[0],
|
|
title='Eliminar Rendición',
|
|
message='¿Estás seguro de que deseas eliminar la rendición #' ~ r[0] ~ '? Esta acción no se puede deshacer.',
|
|
action_url=url_for('admin.delete_rendicion', id=r[0]),
|
|
btn_class='btn-danger',
|
|
btn_text='Eliminar'
|
|
) }}
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="6" class="text-center py-4 text-muted">Aún no hay rendiciones enviadas.</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{{ alert_modal(id='errorPersonaModal', title='Error de Validación', message='') }}
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script src="{{ url_for('static', filename='js/admin_rendiciones.js') }}"></script>
|
|
{% endblock %} |