A single CMXC invoice (e.g. CMXC-307) can have multiple receptions. Previously each reception was sent as a separate ventas, causing TNS to accept the first and reject the rest with "ya existe" — leaving only 1/N of the services registered. Now agrupar_por_factura groups all receptions sharing the same NUM_FACTURA into one ventas JSON with all their services in detallePedido. One factura = one send. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>