modified: database.py
new file: generar_unificado.py modified: routes_admin.py modified: routes_worker.py modified: templates/admin_rendiciones.html new file: templates/admin_report_horarios.html modified: templates/macros/modals.html modified: templates/worker_dashboard.html modified: templates/worker_history.html
This commit is contained in:
@@ -48,8 +48,8 @@
|
||||
<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[16], r[17], r[18]) }}
|
||||
{{ edit_rendicion_modal(r, r[16], workers, modulos) }}
|
||||
{{ rendicion_detail_modal(r, r[20], r[21], r[22]) }}
|
||||
{{ edit_rendicion_modal(r, r[20], workers, modulos) }}
|
||||
|
||||
{{ confirm_modal(
|
||||
id='deleteRendicion' ~ r[0],
|
||||
|
||||
105
templates/admin_report_horarios.html
Normal file
105
templates/admin_report_horarios.html
Normal file
@@ -0,0 +1,105 @@
|
||||
{% extends "macros/base.html" %}
|
||||
|
||||
{% block title %}Reporte: Horarios - {{ modulo_name }}{% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
<style>
|
||||
.table-container {
|
||||
max-height: 75vh;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.sticky-col {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
background-color: var(--bs-body-bg);
|
||||
border-right: 2px solid var(--bs-border-color) !important;
|
||||
}
|
||||
|
||||
thead th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
background-color: var(--bs-body-bg);
|
||||
box-shadow: inset 0 -1px 0 var(--bs-border-color);
|
||||
}
|
||||
|
||||
thead th.sticky-col {
|
||||
z-index: 3;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<div>
|
||||
<a href="{{ url_for('admin_reportes_index') }}" class="btn btn-outline-secondary btn-sm mb-2">
|
||||
<i class="bi bi-arrow-left"></i> Volver al Menú
|
||||
</a>
|
||||
<h2>Control de Horarios</h2>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<div><strong class="text-primary fs-5">{{ modulo_name }}</strong></div>
|
||||
<div class="text-muted"><small>Período: {{ mes_nombre }}</small></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if workers_data %}
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive table-container custom-scrollbar">
|
||||
<table class="table table-bordered table-hover table-sm mb-0 text-center text-nowrap align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" class="sticky-col bg-dark text-white align-middle" style="min-width: 70px;">Día</th>
|
||||
{% for w_id, data in workers_data.items() %}
|
||||
<th colspan="3" class="bg-secondary text-white">{{ data.name }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
{% for w_id, data in workers_data.items() %}
|
||||
<th class="bg-body-tertiary">Ent</th>
|
||||
<th class="bg-body-tertiary">Sal</th>
|
||||
<th class="bg-success-subtle text-success">Hrs</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dia in dias_en_periodo %}
|
||||
<tr>
|
||||
<td class="fw-bold sticky-col p-0 align-middle">
|
||||
<div class="d-flex justify-content-between align-items-center px-2 py-1 h-100">
|
||||
<span class="text-muted" style="font-weight: 500;">{{ dia.name }}</span>
|
||||
<span>{{ dia.num }}</span>
|
||||
</div>
|
||||
</td>
|
||||
{% for w_id, data in workers_data.items() %}
|
||||
{% set turno = data.dias.get(dia.num) %}
|
||||
<td>{{ turno.in if turno else '-' }}</td>
|
||||
<td>{{ turno.out if turno else '-' }}</td>
|
||||
<td class="bg-success-subtle fw-bold text-success">{{ turno.hrs if turno else '0:00' }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot class="table-dark">
|
||||
<tr>
|
||||
<th class="sticky-col bg-dark text-white">TOTAL</th>
|
||||
{% for w_id, data in workers_data.items() %}
|
||||
<td colspan="2" class="text-end pe-2">Horas Totales:</td>
|
||||
<td class="fs-6 text-success fw-bold">{{ data.total_hrs_str }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info text-center shadow-sm mt-4">
|
||||
No hay trabajadores asignados ni registros de horarios para este módulo.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -239,19 +239,19 @@
|
||||
</dl>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span class="text-muted">Débito:</span>
|
||||
<span class="text-muted">Débito <small>(x{{ rendicion[16] }})</small>:</span>
|
||||
<span>${{ "{:,.0f}".format(rendicion[4] or 0).replace(',', '.') }}</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span class="text-muted">Crédito:</span>
|
||||
<span class="text-muted">Crédito <small>(x{{ rendicion[17] }})</small>:</span>
|
||||
<span>${{ "{:,.0f}".format(rendicion[5] or 0).replace(',', '.') }}</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span class="text-muted">Mercado Pago:</span>
|
||||
<span class="text-muted">Mercado Pago <small>(x{{ rendicion[18] }})</small>:</span>
|
||||
<span>${{ "{:,.0f}".format(rendicion[6] or 0).replace(',', '.') }}</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span class="text-muted">Efectivo:</span>
|
||||
<span class="text-muted">Efectivo <small>(x{{ rendicion[19] }})</small>:</span>
|
||||
<span>${{ "{:,.0f}".format(rendicion[7] or 0).replace(',', '.') }}</span>
|
||||
</div>
|
||||
|
||||
@@ -398,22 +398,38 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-1 mt-1 border-top pt-2">
|
||||
<div class="row g-2 mt-1 border-top pt-2">
|
||||
<div class="col-6">
|
||||
<label class="small text-muted mb-0">Débito</label>
|
||||
<input type="text" class="form-control form-control-sm text-end money-input" id="edit_debito_{{ rendicion[0] }}" name="venta_debito" value="{{ '{:,.0f}'.format(rendicion[4] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<input type="text" class="form-control form-control-sm text-end money-input mb-1" id="edit_debito_{{ rendicion[0] }}" name="venta_debito" value="{{ '{:,.0f}'.format(rendicion[4] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-dark border-secondary text-muted" style="font-size: 0.7em;">Boletas</span>
|
||||
<input type="number" class="form-control text-center bg-dark text-white border-secondary" name="boletas_debito" value="{{ rendicion[16] or 0 }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label class="small text-muted mb-0">Crédito</label>
|
||||
<input type="text" class="form-control form-control-sm text-end money-input" id="edit_credito_{{ rendicion[0] }}" name="venta_credito" value="{{ '{:,.0f}'.format(rendicion[5] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<input type="text" class="form-control form-control-sm text-end money-input mb-1" id="edit_credito_{{ rendicion[0] }}" name="venta_credito" value="{{ '{:,.0f}'.format(rendicion[5] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-dark border-secondary text-muted" style="font-size: 0.7em;">Boletas</span>
|
||||
<input type="number" class="form-control text-center bg-dark text-white border-secondary" name="boletas_credito" value="{{ rendicion[17] or 0 }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label class="small text-muted mb-0">Mercado Pago</label>
|
||||
<input type="text" class="form-control form-control-sm text-end money-input" id="edit_mp_{{ rendicion[0] }}" name="venta_mp" value="{{ '{:,.0f}'.format(rendicion[6] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<input type="text" class="form-control form-control-sm text-end money-input mb-1" id="edit_mp_{{ rendicion[0] }}" name="venta_mp" value="{{ '{:,.0f}'.format(rendicion[6] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-dark border-secondary text-muted" style="font-size: 0.7em;">Boletas</span>
|
||||
<input type="number" class="form-control text-center bg-dark text-white border-secondary" name="boletas_mp" value="{{ rendicion[18] or 0 }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label class="small text-muted mb-0">Efectivo</label>
|
||||
<input type="text" class="form-control form-control-sm text-end money-input" id="edit_efectivo_{{ rendicion[0] }}" name="venta_efectivo" value="{{ '{:,.0f}'.format(rendicion[7] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<input type="text" class="form-control form-control-sm text-end money-input mb-1" id="edit_efectivo_{{ rendicion[0] }}" name="venta_efectivo" value="{{ '{:,.0f}'.format(rendicion[7] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-dark border-secondary text-muted" style="font-size: 0.7em;">Boletas</span>
|
||||
<input type="number" class="form-control text-center bg-dark text-white border-secondary" name="boletas_efectivo" value="{{ rendicion[19] or 0 }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -502,7 +518,7 @@
|
||||
<h5 class="card-title mb-0">Control de Horarios</h5>
|
||||
</div>
|
||||
<p class="text-muted small flex-grow-1">Registro de horas de entrada y salida de los trabajadores y acompañantes.</p>
|
||||
<button class="btn btn-outline-warning w-100 mt-3" onclick="alert('Reporte en construcción')">Generar Reporte</button>
|
||||
<a href="{{ url_for('report_modulo_horarios', modulo_id=modulo_id) }}" class="btn btn-warning w-100 mt-3">Generar Reporte</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,32 +131,48 @@
|
||||
<div class="card-body">
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Venta Débito</label>
|
||||
<div class="input-group">
|
||||
<label class="form-label">Débito</label>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="text" class="form-control money-input sale-input" name="venta_debito" id="venta_debito" required>
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-secondary text-white border-0">Nº Boletas</span>
|
||||
<input type="number" class="form-control" name="boletas_debito" min="0" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Venta Crédito</label>
|
||||
<div class="input-group">
|
||||
<label class="form-label">Crédito</label>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="text" class="form-control money-input sale-input" name="venta_credito" id="venta_credito" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Venta Mercado Pago</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="text" class="form-control money-input sale-input" placeholder="0" name="venta_mp" id="venta_mp" required>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-secondary text-white border-0">Nº Boletas</span>
|
||||
<input type="number" class="form-control" name="boletas_credito" min="0" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Venta Efectivo</label>
|
||||
<div class="input-group">
|
||||
<label class="form-label">Mercado Pago</label>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="text" class="form-control money-input sale-input" placeholder="0" name="venta_mp" id="venta_mp" required>
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-secondary text-white border-0">Nº Boletas</span>
|
||||
<input type="number" class="form-control" name="boletas_mp" min="0" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Efectivo</label>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">$</span>
|
||||
<input type="text" class="form-control money-input sale-input" placeholder="0" name="venta_efectivo" id="venta_efectivo" required>
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text bg-secondary text-white border-0">Nº Boletas</span>
|
||||
<input type="number" class="form-control" name="boletas_efectivo" min="0" placeholder="0">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<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>
|
||||
{{ rendicion_detail_modal(r, r[16], r[17], r[18]) }}
|
||||
{{ rendicion_detail_modal(r, r[20], r[21], r[22]) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user