feat: add bono to pago combinado in recepcion
New Bono field in the combined payment panel — included in the running total sum, reset, and pagos_detalle payload on submit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
417b53528b
commit
b9312fe0d9
@@ -765,10 +765,14 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
<div class="col-5"><label class="form-label mb-0 small fw-semibold"><i class="fas fa-university me-1 text-primary"></i>Transferencia</label></div>
|
||||
<div class="col-7"><input type="number" id="comb-transferencia" class="form-control form-control-sm" placeholder="$0" min="0" step="100" oninput="sumarCombinado()"></div>
|
||||
</div>
|
||||
<div class="row g-2 align-items-center">
|
||||
<div class="row g-2 align-items-center mb-1">
|
||||
<div class="col-5"><label class="form-label mb-0 small fw-semibold"><i class="fas fa-credit-card me-1 text-warning"></i>Tarjeta</label></div>
|
||||
<div class="col-7"><input type="number" id="comb-tarjeta" class="form-control form-control-sm" placeholder="$0" min="0" step="100" oninput="sumarCombinado()"></div>
|
||||
</div>
|
||||
<div class="row g-2 align-items-center">
|
||||
<div class="col-5"><label class="form-label mb-0 small fw-semibold"><i class="fas fa-ticket-alt me-1 text-info"></i>Bono</label></div>
|
||||
<div class="col-7"><input type="number" id="comb-bono" class="form-control form-control-sm" placeholder="$0" min="0" step="100" oninput="sumarCombinado()"></div>
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="inp-obs" class="form-control form-control-sm mt-2"
|
||||
rows="2" placeholder="Observaciones…" maxlength="500"></textarea>
|
||||
@@ -1450,11 +1454,11 @@ function togglePagoCombinado() {
|
||||
}
|
||||
function sumarCombinado() {
|
||||
const v = id => parseFloat(document.getElementById(id).value) || 0;
|
||||
const total = v('comb-efectivo') + v('comb-transferencia') + v('comb-tarjeta');
|
||||
const total = v('comb-efectivo') + v('comb-transferencia') + v('comb-tarjeta') + v('comb-bono');
|
||||
document.getElementById('inp-total').value = total || '';
|
||||
}
|
||||
function resetPagoCombinado() {
|
||||
['comb-efectivo','comb-transferencia','comb-tarjeta'].forEach(id => document.getElementById(id).value = '');
|
||||
['comb-efectivo','comb-transferencia','comb-tarjeta','comb-bono'].forEach(id => document.getElementById(id).value = '');
|
||||
document.getElementById('panel-combinado').classList.add('d-none');
|
||||
const inp = document.getElementById('inp-total');
|
||||
inp.readOnly = false;
|
||||
@@ -1615,6 +1619,7 @@ async function guardarSolicitud() {
|
||||
efectivo: parseFloat(document.getElementById('comb-efectivo').value) || 0,
|
||||
transferencia: parseFloat(document.getElementById('comb-transferencia').value) || 0,
|
||||
tarjeta: parseFloat(document.getElementById('comb-tarjeta').value) || 0,
|
||||
bono: parseFloat(document.getElementById('comb-bono').value) || 0,
|
||||
} : null,
|
||||
observaciones: document.getElementById('inp-obs').value.trim() || null,
|
||||
embarazada: document.getElementById('chk-embarazada').checked ? 1 : 0,
|
||||
|
||||
Reference in New Issue
Block a user