ahora si funcan las tarjetas lol

This commit is contained in:
2026-03-21 02:18:50 -03:00
parent e5415b11e7
commit b043652f22
5 changed files with 45 additions and 51 deletions

View File

@@ -31,7 +31,7 @@
<th class="text-end">Acciones</th>
</tr>
</thead>
<tbody>
<tbody>
{% for r in rendiciones %}
<tr>
<td class="align-middle">{{ r[1] }}</td>
@@ -39,37 +39,17 @@
<td class="align-middle"><span class="badge bg-info text-dark">{{ r[3] }}</span></td>
<td class="align-middle">{{ r[4] }}</td>
<td class="align-middle">
${{ "{:,.0f}".format((r[5] or 0) + (r[17] or 0) + (r[6] or 0) + (r[7] or 0)).replace(',', '.') }}
${{ "{:,.0f}".format((r[5] or 0) + (r[6] or 0) + (r[7] or 0) + (r[8] or 0)).replace(',', '.') }}
</td>
<td class="align-middle text-danger">${{ "{:,.0f}".format(r[8] or 0).replace(',', '.') }}</td>
<td class="align-middle text-danger">${{ "{:,.0f}".format(r[9] 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>
<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[14], r[15], r[16]) }}
{{ rendicion_detail_modal(r, r[15], r[16], r[17]) }}
{{ edit_rendicion_modal(r, workers, modulos) }}
{{ confirm_modal(
@@ -98,11 +78,12 @@
function calcTotalEdit(id) {
const getVal = (inputId) => parseInt(document.getElementById(inputId).value.replace(/\D/g, '')) || 0;
const tarjeta = getVal(`edit_tarjeta_${id}`);
const debito = getVal(`edit_debito_${id}`);
const credito = getVal(`edit_credito_${id}`);
const mp = getVal(`edit_mp_${id}`);
const efectivo = getVal(`edit_efectivo_${id}`);
const total = tarjeta + mp + efectivo;
const total = debito + credito + mp + efectivo;
document.getElementById(`display_nuevo_total_${id}`).innerText = '$' + total.toLocaleString('es-CL');
}

View File

@@ -201,8 +201,8 @@
<dt class="col-sm-5 text-muted">Acompañante</dt>
<dd class="col-sm-7">
{% if rendicion[10] %}
{{ rendicion[10] }}
{% if rendicion[11] %}
{{ rendicion[11] }}
{% else %}
<span class="text-muted italic small">Sin acompañante</span>
{% endif %}
@@ -216,19 +216,23 @@
</dl>
<hr>
<div class="d-flex justify-content-between mb-2">
<span class="text-muted">Tarjetas:</span>
<span class="text-muted">Débito:</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">Crédito:</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">Mercado Pago:</span>
<span>${{ "{:,.0f}".format(rendicion[7] or 0).replace(',', '.') }}</span>
</div>
<div class="d-flex justify-content-between mb-2">
<span class="text-muted">Efectivo:</span>
<span>${{ "{:,.0f}".format(rendicion[8] or 0).replace(',', '.') }}</span>
</div>
{% set total_declarado = rendicion[5] + rendicion[6] + rendicion[7] %}
{% set total_declarado = (rendicion[5] or 0) + (rendicion[6] or 0) + (rendicion[7] or 0) + (rendicion[8] or 0) %}
<div class="d-flex justify-content-between mt-3 pt-2 border-top">
<strong class="fs-5">Total Declarado:</strong>
<strong class="fs-5">${{ "{:,.0f}".format(total_declarado).replace(',', '.') }}</strong>
@@ -247,12 +251,12 @@
<div class="card-body">
<div class="d-flex justify-content-between mb-3">
<strong class="text-danger">Monto Gastos:</strong>
<strong class="text-danger">-${{ "{:,.0f}".format(rendicion[8] or 0).replace(',', '.') }}</strong>
<strong class="text-danger">-${{ "{:,.0f}".format(rendicion[9] or 0).replace(',', '.') }}</strong>
</div>
<div>
<span class="text-muted d-block mb-1">Observaciones:</span>
<p class="mb-0 bg-dark p-2 rounded border border-secondary" style="font-size: 0.9em;">
{{ rendicion[9] if rendicion[9] else "Sin observaciones." }}
{{ rendicion[10] if rendicion[10] else "Sin observaciones." }}
</p>
</div>
</div>
@@ -321,11 +325,18 @@
<h6 class="border-bottom pb-2 text-success">Declaración de Dinero</h6>
<div class="row g-3">
<div class="col-md-4">
<label class="form-label">Tarjetas</label>
<div class="col-md-3">
<label class="form-label">Débito</label>
<div class="input-group">
<span class="input-group-text">$</span>
<input type="text" class="form-control money-input" id="edit_tarjeta_{{ rendicion[0] }}" name="venta_tarjeta" value="{{ rendicion[5] }}" oninput="calcTotalEdit({{ rendicion[0] }})" required>
<input type="text" class="form-control" id="edit_debito_{{ rendicion[0] }}" name="venta_debito" value="{{ '{:,.0f}'.format(rendicion[5] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
</div>
</div>
<div class="col-md-3">
<label class="form-label">Crédito</label>
<div class="input-group">
<span class="input-group-text">$</span>
<input type="text" class="form-control" id="edit_credito_{{ rendicion[0] }}" name="venta_credito" value="{{ '{:,.0f}'.format(rendicion[6] or 0).replace(',', '.') }}" oninput="calcTotalEdit({{ rendicion[0] }})">
</div>
</div>
<div class="col-md-4">

View File

@@ -128,14 +128,14 @@
<input type="text" class="form-control money-input sale-input" name="venta_credito" id="venta_credito" required>
</div>
</div>
<div class="col-md-4">
<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>
</div>
<div class="col-md-4">
<div class="col-md-3">
<label class="form-label">Venta Efectivo</label>
<div class="input-group">
<span class="input-group-text">$</span>
@@ -143,7 +143,6 @@
</div>
</div>
</div>
<div class="row g-3 mb-4 p-3 bg-body-secondary rounded shadow-sm">
<div class="col-md-4">
<label class="form-label text-info fw-bold">Total Digital (Tarjeta + MP)</label>