feat: precios particulares automáticos al seleccionar exámenes

- Sin empresa: usa precio_base de exam_tipos (tarifa particular)
- Panel de precios se muestra con solo seleccionar exámenes (no requiere convenio)
- Total se aplica automáticamente al campo de cobro sin clic manual

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-16 20:27:18 -05:00
co-authored by Claude Sonnet 4.6
parent fa338e9e11
commit 35cba08004
2 changed files with 16 additions and 3 deletions
+7 -1
View File
@@ -2251,7 +2251,7 @@ async function _doRecalcular() {
const nit = document.getElementById('inp-empresa-nit').value.trim();
const subId = document.getElementById('sel-subgrupo').value;
if (!examIds.length || !nit) {
if (!examIds.length) {
document.getElementById('panel-precios').classList.add('d-none');
return;
}
@@ -2296,6 +2296,12 @@ async function _doRecalcular() {
}
document.getElementById('panel-precios').classList.remove('d-none');
// Auto-aplicar total al campo de cobro
const totalFinal = j.total || j.subtotal || 0;
if (totalFinal > 0) {
document.getElementById('inp-total').value = Math.round(totalFinal);
}
}
function aplicarPrecioCalculado() {