FinchContext
Run with

Build Sistema RED / SILTRA Contribution Files

Skill: Convert payroll contribution data into the Sistema RED liquidation segment files

Region: Spain (España) Category: Payroll — Seguridad Social (Sistema RED / SILTRA, Sistema de Liquidación Directa) Does: Takes a month's social-security contribution data and produces the SILTRA liquidation segment files exchanged under the Sistema de Liquidación Directa (SLD) — the fixed-width / segmented flat files keyed by CCC (Código Cuenta de Cotización) and NAF/NUSS that carry each worker's bases de cotización and conceptos, plus the structure to reconcile the request against the TGSS response (fichero de respuesta). Standard: TGSS Sistema RED — Sistema de Liquidación Directa (SLD); ficheros de bases (FAN/segmentos), SILTRA winsuite; diseños de registro de la Tesorería General de la Seguridad Social

These are fixed-width / segmented flat files transmitted to the TGSS through SILTRA, not XML or JSON. The AI lays out the segments and computes bases and cuotas; the employer must validate against the current TGSS diseños de registro and reconcile the fichero de bases/solicitud with the TGSS fichero de respuesta (DCL — Datos de Cálculo de la Liquidación / RNT-RLC) before confirming. Segment layouts and contribution tipos change every year (Orden de cotización and the annual Ley de PGE) — verify the active design before use.


When this applies


Filing procedure

  1. Read the source. Accept a payroll export (CSV/JSON), HR system extract, or pasted per-employee figures. Identify the employer CCC, the contribution month, and per worker: NAF/NUSS, IPF (DNI/NIE), grupo de cotización, days worked, bases de cotización, and remuneration concepts.
  2. Extract fields. Per CCC capture the régimen and the liquidation type; per worker capture NAF, grupo, CNAE/ocupación for AT/EP, base de contingencias comunes (CC), base de contingencias profesionales (CP/AT-EP), horas extra bases, and conceptos retributivos (CRA — conceptos retributivos abonados). Missing NAF or base → ask, never invent.
  3. Normalize. Money as cents (no decimal point) or 2-decimal per the segment design; dates ddmmaaaa; identifiers right-padded/left-zero-filled to fixed width; text fields space-padded to the field length. Each record is a fixed-length line.
  4. Compute the bases. Cap each base within the topes mínimo/máximo for the worker's grupo; compute cuotas = base × tipo for each contingency where the file carries them; sum per CCC.
  5. Lay out the segments. Emit the header (registro de empresa / CCC), the per-worker tramo segments, and the trailer/totales, each as a fixed-width line per the TGSS diseño.
  6. Transmit and reconcile. Send via SILTRA; on receiving the fichero de respuesta (DCL/RNT-RLC), reconcile the TGSS-calculated cuotas against the bases sent and confirm. Validate against the checklist.

Source → Sistema RED segment field map

From the source → Segment / field
Employer CCC (régimen + province + number) Registro empresa — CCC (11 pos)
Contribution régimen (0111 general…) Registro empresa — RegimenCotizacion
Período de liquidación (mes/año) Cabecera — PeriodoLiquidacion (mmaaaa)
Tipo de liquidación (L00 ordinaria…) Cabecera — TipoLiquidacion
Worker NAF / NUSS Registro trabajador — NAF (12 pos)
Worker IPF (DNI/NIE) Registro trabajador — IPF
Grupo de cotización (01–11) Registro trabajador — GrupoCotizacion
Días / tramo de alta Tramo — FechaDesde/FechaHasta, DiasTramo
Base contingencias comunes Tramo — BaseCC
Base contingencias profesionales (AT/EP) Tramo — BaseCP
Base horas extraordinarias Tramo — BaseHorasExtra
Conceptos retributivos abonados (CRA) Segmento CRA — ClaveConcepto, Importe
Cuota empresa contingencias comunes Trailer/DCL — CuotaEmpresaCC
Cuota trabajador Trailer/DCL — CuotaTrabajador
Total líquido a ingresar (CCC) Trailer — LiquidoIngresar

Every required field appears above. The TGSS fichero de respuesta mirrors these keys (CCC + NAF + período) and adds the calculated cuotas for reconciliation.


Output structure

Fichero de bases / solicitud (SLD)  — fixed-width segmented flat file
├── Registro de cabecera del envío            (sender, presentador, autorización RED)
├── Registro de empresa (por CCC)             (CCC, régimen, período de liquidación, tipo L00…)
│   ├── Registro de trabajador (por NAF)       (NAF, IPF, grupo cotización, CNAE/ocupación)
│   │   ├── Tramo de bases                      (fecha desde/hasta, días, BaseCC, BaseCP, horas extra)
│   │   └── Segmento CRA                         (conceptos retributivos: clave + importe)
│   └── … (repite por trabajador)
├── Registro de totales del CCC               (sumas de bases y cuotas, líquido a ingresar)
└── Registro de fin de envío                  (recuento de registros, control)

Fichero de respuesta (TGSS) — para conciliar
├── DCL — Datos de Cálculo de la Liquidación  (cuotas calculadas por la TGSS por NAF)
├── RNT — Relación Nominal de Trabajadores
└── RLC — Recibo de Liquidación de Cotizaciones (líquido confirmado a ingresar)

Each line is a fixed-length record; field positions and lengths follow the TGSS diseño de registro for the SLD. The request carries bases; the response carries TGSS-calculated cuotas to be reconciled and confirmed.


Code tables

Régimen de cotización (selected)

Code Meaning
0111 Régimen General
0112 Sistema Especial Agrario (cuenta ajena)
0613 Régimen Especial Empleados de Hogar
0521 RETA — Autónomos (different flow)

Tipo de liquidación

Code Meaning
L00 Liquidación ordinaria (mensual)
L02 Atrasos por convenio colectivo
L03 Salarios de tramitación
L13 Liquidación complementaria por bonificación/deducción
L90 Liquidación de vacaciones devengadas y no disfrutadas

Grupo de cotización

Grupo Categoría
01 Ingenieros y Licenciados
02 Ingenieros técnicos, peritos, ayudantes titulados
03 Jefes administrativos y de taller
0407 Auxiliares, subalternos, administrativos (mensuales)
0811 Oficiales y peones (cotización por días)

Conceptos retributivos abonados (CRA) — claves de ejemplo

Clave Concepto
0500 Salario base
0501 Complementos salariales
0510 Horas extraordinarias
0511 Pluses extrasalariales / dietas

Calculation rules


Worked example (end-to-end)

Input — June 2026 payroll for one CCC (pasted)

Empresa: Comercial Ejemplo SL
CCC: 28/1234567/89   Régimen: 0111 (General)
Período de liquidación: 06/2026   Tipo: L00

Trabajador:
  Nombre: Ana López García
  NAF: 281234567890   IPF (DNI): 12345678Z
  Grupo de cotización: 05 (administrativo, mensual)
  Tramo: 01/06/2026 a 30/06/2026 (30 días)
  Salario base: 2.000,00 €   Prorrata pagas extra: 333,33 €
  Sin horas extraordinarias

After extraction + normalization (intermediate)

CCC normalizado: 28123456789   (régimen 0111)
Período: 062026   Tipo liquidación: L00
NAF: 281234567890   IPF: 12345678Z   Grupo: 05
Tramo: 01062026 - 30062026   Días: 30
Base contingencias comunes (CC) = 2000.00 + 333.33 = 2333.33  (dentro de topes grupo 05)
Base contingencias profesionales (CP) = 2333.33
Conceptos: 0500 salario base 2000.00 ; (prorrata pagas incluida en base)

Cuotas (a calcular/confirmar por la TGSS en el fichero de respuesta):
  CC empresa  = 2333.33 × 23,60 % = 550.67
  CC trabajador = 2333.33 × 4,70 % = 109.67
  Desempleo (5,50 % + 1,55 %) = 128.33 + 36.17
  FOGASA (0,20 %) = 4.67 ; FP (0,60 % + 0,10 %) = 14.00 + 2.33

Output — fichero de bases (SLD segmented flat file)

CAB SLD PRESENTADOR B12345678 COMERCIAL EJEMPLO SL          AUTRED 00001  062026
EMP 28123456789 0111 062026 L00 COMERCIAL EJEMPLO SL                          
TRA 281234567890 12345678Z 05 0010 LOPEZ GARCIA ANA                           
TRM 01062026 30062026 030 BCC 000000233333 BCP 000000233333 BHE 000000000000  
CRA 281234567890 0500 000000200000                                            
CRA 281234567890 0501 000000033333                                            
TOT 28123456789 BCC 000000233333 CEM 000000055067 CTR 000000010967 LIQ 000000066034
FIN 062026 REGISTROS 000007 CONTROL 0000000233333                             

Normalisations shown: CCC 28/1234567/8928123456789 (11 positions, slashes removed); período 06/2026062026 (mmaaaa); dates → ddmmaaaa (01062026); amounts to integer cents zero-filled (2.333,33 €000000233333); base CC recomputed 2000.00 + 333.33 = 2333.33; text fields space-padded. The TOT líquido (000000066034 = 660.34) is provisional — it must be reconciled against the TGSS fichero de respuesta (DCL/RLC) before the liquidation is confirmed and paid. (Field positions are illustrative; map to the exact TGSS diseño de registro for production.)


Validation checklist


Last updated: 2026-06-13 — verify the current TGSS Sistema RED / SLD diseños de registro, contribution tipos and topes (Orden de cotización), and SILTRA file layout against the official Tesorería General de la Seguridad Social specification before use.