Joins TARIFA using EMPRESA.TARIFA to get the base price per exam, then calculates descuento = round((sum(TARIFA) - sum(PRECIO)) / sum(TARIFA) * 100) and sends it as integer percentage in the RDA header encabezado. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>