feat: resolve exam prices via TARIFA+EMPRESA JOIN, show company name

- PRECIO now falls back to catalog price (TARIFA) when 0/null
- JOIN EMPRESA + EMPRESA_SUB + TARIFA in exam query
- NOM_EMPRESA propagated to log and historial display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-18 14:58:10 -05:00
co-authored by Claude Sonnet 4.6
parent 7aa02fe6ac
commit 6cbf0732e6
3 changed files with 24 additions and 15 deletions
+2 -2
View File
@@ -363,8 +363,8 @@ async function cargarHistorialScheduler() {
? `<span class="text-orange-600">${p.diagnostico_cod}</span>${p.diagnostico_nombre ? ' · ' + p.diagnostico_nombre : ''}`
: '<span class="text-gray-300">Sin diagnóstico</span>';
const empresa = p.nit_empresa
? `<span class="text-teal-600">${p.nit_empresa}</span>`
const empresa = (p.nom_empresa || p.nit_empresa)
? `<span class="text-teal-600">${p.nom_empresa || p.nit_empresa}</span>`
: '<span class="text-gray-300">Sin empresa</span>';
const valor = p.valor_total > 0