@ramiidv/arca-empleados 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +380 -0
- package/dist/constants.d.ts +314 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +511 -0
- package/dist/constants.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -0
- package/dist/f935-builder.d.ts +91 -0
- package/dist/f935-builder.d.ts.map +1 -0
- package/dist/f935-builder.js +246 -0
- package/dist/f935-builder.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/serializer.d.ts +58 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/serializer.js +304 -0
- package/dist/serializer.js.map +1 -0
- package/dist/types.d.ts +204 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/validators.d.ts +38 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +255 -0
- package/dist/validators.js.map +1 -0
- package/llms.txt +269 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ramiidv
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
# @ramiidv/arca-empleados-sdk
|
|
2
|
+
|
|
3
|
+
SDK de TypeScript para la gestion de empleados con ARCA (ex AFIP). Genera archivos F935 para el sistema "Mi Simplificacion - Ingreso Masivo de Datos v2.0".
|
|
4
|
+
|
|
5
|
+
## Importante
|
|
6
|
+
|
|
7
|
+
Este SDK **no realiza llamadas a servicios web ni APIs**. ARCA no expone una API publica para la gestion de empleados. En cambio, los empleadores utilizan la interfaz web de "Mi Simplificacion" o la aplicacion de escritorio "Ingreso Masivo de Datos" que procesa archivos de datos estructurados.
|
|
8
|
+
|
|
9
|
+
Este SDK genera esos archivos de datos (formato F935) con tipado fuerte y validacion completa.
|
|
10
|
+
|
|
11
|
+
## Instalacion
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @ramiidv/arca-empleados-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Inicio rapido
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { writeFileSync } from 'node:fs';
|
|
21
|
+
import {
|
|
22
|
+
ArcaEmpleados,
|
|
23
|
+
ModalidadContratacion,
|
|
24
|
+
Provincia,
|
|
25
|
+
} from '@ramiidv/arca-empleados-sdk';
|
|
26
|
+
|
|
27
|
+
const empleados = new ArcaEmpleados({
|
|
28
|
+
cuitEmpleador: '30-71234567-1',
|
|
29
|
+
razonSocial: 'Mi Empresa S.A.',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
empleados.alta({
|
|
33
|
+
cuil: '20-12345678-6',
|
|
34
|
+
fechaInicio: new Date(2024, 2, 1),
|
|
35
|
+
modalidadContratacion: ModalidadContratacion.TIEMPO_COMPLETO_INDETERMINADO,
|
|
36
|
+
obraSocial: '100100',
|
|
37
|
+
actividadEconomica: '620100',
|
|
38
|
+
domicilioExplotacion: {
|
|
39
|
+
calle: 'Av. Corrientes',
|
|
40
|
+
numero: '1234',
|
|
41
|
+
localidad: 'CABA',
|
|
42
|
+
codigoPostal: '1043',
|
|
43
|
+
provincia: Provincia.CAPITAL_FEDERAL,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const resultado = empleados.generar();
|
|
48
|
+
writeFileSync('F935.txt', resultado.contenido, 'utf-8');
|
|
49
|
+
console.log(resultado.resumen);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Tipos de registro
|
|
53
|
+
|
|
54
|
+
El archivo F935 comunica 5 tipos de registro:
|
|
55
|
+
|
|
56
|
+
### 1. Relaciones Laborales (Alta / Baja / Modificacion)
|
|
57
|
+
|
|
58
|
+
**Alta** - Registro de un nuevo empleado. Segun RG 5508/2024, requiere 7 campos obligatorios:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
empleados.alta({
|
|
62
|
+
cuil: '20-12345678-6',
|
|
63
|
+
fechaInicio: new Date(2024, 2, 1),
|
|
64
|
+
modalidadContratacion: ModalidadContratacion.TIEMPO_COMPLETO_INDETERMINADO,
|
|
65
|
+
obraSocial: '100100',
|
|
66
|
+
actividadEconomica: '620100',
|
|
67
|
+
trabajadorAgropecuario: false, // default: false
|
|
68
|
+
domicilioExplotacion: { /* ... */ },
|
|
69
|
+
fechaFin: undefined, // solo para plazo fijo, eventual, aprendizaje, pasantia
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Baja** - Desvinculacion de un empleado (debe informarse dentro de 5 dias habiles):
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
empleados.baja({
|
|
77
|
+
cuil: '20-12345678-6',
|
|
78
|
+
fechaBaja: new Date(2024, 5, 15),
|
|
79
|
+
motivoBaja: MotivoBaja.RENUNCIA,
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Modificacion** - Cambios en una relacion laboral existente:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
empleados.modificacion({
|
|
87
|
+
cuil: '20-12345678-6',
|
|
88
|
+
fechaInicio: new Date(2024, 2, 1),
|
|
89
|
+
obraSocial: '100200', // nuevo valor
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 2. Datos Complementarios del Trabajador
|
|
94
|
+
|
|
95
|
+
Datos adicionales que deben completarse antes de la primera liquidacion:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
empleados.datosComplementarios({
|
|
99
|
+
cuil: '20-12345678-6',
|
|
100
|
+
fechaInicio: new Date(2024, 2, 1),
|
|
101
|
+
situacionRevista: SituacionRevista.ACTIVO,
|
|
102
|
+
nivelEducacion: NivelEducacion.UNIVERSITARIO_COMPLETO,
|
|
103
|
+
modalidadLiquidacion: ModalidadLiquidacion.MENSUAL,
|
|
104
|
+
remuneracion: 350000,
|
|
105
|
+
// ... mas campos opcionales
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 3. CBU (Datos Bancarios)
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
empleados.cbu({
|
|
113
|
+
cuil: '20-12345678-6',
|
|
114
|
+
fechaInicio: new Date(2024, 2, 1),
|
|
115
|
+
cbu: '0110599100000054489273',
|
|
116
|
+
tipoCuenta: TipoCuenta.CAJA_AHORRO,
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 4. Relaciones Familiares
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
empleados.relacionFamiliar({
|
|
124
|
+
cuil: '20-12345678-6',
|
|
125
|
+
fechaInicio: new Date(2024, 2, 1),
|
|
126
|
+
tipoRelacion: TipoRelacionFamiliar.HIJO,
|
|
127
|
+
nombreFamiliar: 'Juan',
|
|
128
|
+
apellidoFamiliar: 'Perez',
|
|
129
|
+
fechaNacimiento: new Date(2015, 5, 10),
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 5. Domicilios de Explotacion
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
empleados.domicilioExplotacion({
|
|
137
|
+
cuil: '20-12345678-6',
|
|
138
|
+
calle: 'Av. Corrientes',
|
|
139
|
+
numero: '1234',
|
|
140
|
+
localidad: 'CABA',
|
|
141
|
+
codigoPostal: '1043',
|
|
142
|
+
provincia: Provincia.CAPITAL_FEDERAL,
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## API
|
|
147
|
+
|
|
148
|
+
### `ArcaEmpleados`
|
|
149
|
+
|
|
150
|
+
Constructor:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
new ArcaEmpleados(config: ArcaEmpleadosConfig)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
| Opcion | Tipo | Default | Descripcion |
|
|
157
|
+
|--------|------|---------|-------------|
|
|
158
|
+
| `cuitEmpleador` | `string` | (requerido) | CUIT del empleador |
|
|
159
|
+
| `razonSocial` | `string` | - | Razon social del empleador |
|
|
160
|
+
| `strict` | `boolean` | `true` | Valida campos al agregar registros |
|
|
161
|
+
|
|
162
|
+
Metodos:
|
|
163
|
+
|
|
164
|
+
| Metodo | Retorno | Descripcion |
|
|
165
|
+
|--------|---------|-------------|
|
|
166
|
+
| `alta(data)` | `this` | Agrega un alta |
|
|
167
|
+
| `baja(data)` | `this` | Agrega una baja |
|
|
168
|
+
| `modificacion(data)` | `this` | Agrega una modificacion |
|
|
169
|
+
| `datosComplementarios(data)` | `this` | Agrega datos complementarios |
|
|
170
|
+
| `cbu(data)` | `this` | Agrega datos de CBU |
|
|
171
|
+
| `relacionFamiliar(data)` | `this` | Agrega relacion familiar |
|
|
172
|
+
| `domicilioExplotacion(data)` | `this` | Agrega domicilio de explotacion |
|
|
173
|
+
| `altasMasivas(data[])` | `this` | Agrega multiples altas |
|
|
174
|
+
| `bajasMasivas(data[])` | `this` | Agrega multiples bajas |
|
|
175
|
+
| `generar()` | `F935Output` | Genera el archivo |
|
|
176
|
+
| `resumen()` | `F935Resumen` | Resumen sin generar |
|
|
177
|
+
| `limpiar()` | `this` | Limpia registros |
|
|
178
|
+
| `registros` | `F935Registro[]` | Registros almacenados (lectura) |
|
|
179
|
+
|
|
180
|
+
### `F935Output`
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
interface F935Output {
|
|
184
|
+
contenido: string; // Contenido del archivo
|
|
185
|
+
archivo: F935Archivo; // Metadata
|
|
186
|
+
resumen: F935Resumen; // Resumen de registros
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### `F935Resumen`
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
interface F935Resumen {
|
|
194
|
+
totalRegistros: number;
|
|
195
|
+
altas: number;
|
|
196
|
+
bajas: number;
|
|
197
|
+
modificaciones: number;
|
|
198
|
+
datosComplementarios: number;
|
|
199
|
+
cbus: number;
|
|
200
|
+
familiares: number;
|
|
201
|
+
domicilios: number;
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Enums y constantes
|
|
206
|
+
|
|
207
|
+
### Modalidad de Contratacion (`ModalidadContratacion`)
|
|
208
|
+
|
|
209
|
+
Codigos oficiales SICOSS (tabla T03). Se muestran los mas utilizados:
|
|
210
|
+
|
|
211
|
+
| Codigo | Enum | Descripcion |
|
|
212
|
+
|--------|------|-------------|
|
|
213
|
+
| `0` | `PROMOVIDA_REDUCCION_0` | Contrato Modalidad Promovida. Reduccion 0% |
|
|
214
|
+
| `1` | `TIEMPO_PARCIAL_INDETERMINADO` | A tiempo parcial: Indeterminado/permanente |
|
|
215
|
+
| `3` | `APRENDIZAJE` | De aprendizaje Ley 25.013 |
|
|
216
|
+
| `8` | `TIEMPO_COMPLETO_INDETERMINADO` | A Tiempo completo indeterminado / Trabajo permanente |
|
|
217
|
+
| `11` | `TEMPORADA` | Trabajo de temporada |
|
|
218
|
+
| `12` | `EVENTUAL` | Trabajo eventual |
|
|
219
|
+
| `21` | `TIEMPO_PARCIAL_PLAZO_FIJO` | A tiempo parcial determinado (plazo fijo) |
|
|
220
|
+
| `22` | `TIEMPO_COMPLETO_PLAZO_FIJO` | A Tiempo completo determinado (plazo fijo) |
|
|
221
|
+
| `24` | `CONSTRUCCION` | Personal de la Construccion Ley 22.250 |
|
|
222
|
+
| `27` | `PASANTIA_CON_OS` | Pasantias Ley 26.427 -con obra social- |
|
|
223
|
+
| `32` | `PERIODO_PRUEBA` | Periodo de Prueba Art. 6 Ley 25.877 |
|
|
224
|
+
| `110` | `AGRARIO_PERMANENTE` | Trabajo permanente Ley 26.727 (agrario) |
|
|
225
|
+
| `111` | `AGRARIO_TEMPORARIO` | Trabajo temporario Ley 26.727 (agrario) |
|
|
226
|
+
| `112` | `AGRARIO_PERMANENTE_DISCONTINUO` | Trabajo permanente discontinuo Ley 26.727 |
|
|
227
|
+
|
|
228
|
+
> Hay 35 codigos en total. Consultar el enum `ModalidadContratacion` para la lista completa.
|
|
229
|
+
|
|
230
|
+
### Motivo de Baja (`MotivoBaja`)
|
|
231
|
+
|
|
232
|
+
Codigos oficiales de Simplificacion Registral. Se muestran los mas utilizados:
|
|
233
|
+
|
|
234
|
+
| Codigo | Enum | Descripcion |
|
|
235
|
+
|--------|------|-------------|
|
|
236
|
+
| `0` | `FALLECIMIENTO` | Baja por fallecimiento |
|
|
237
|
+
| `7` | `DESPIDO` | Baja por despido |
|
|
238
|
+
| `21` | `RENUNCIA` | Renuncia del trabajador (Art.240 LCT) |
|
|
239
|
+
| `22` | `MUTUO_ACUERDO` | Voluntad concurrente de las partes (Art.241 LCT) |
|
|
240
|
+
| `26` | `DESPIDO_SIN_CAUSA` | Despido sin causa (Art.245 LCT) |
|
|
241
|
+
| `30` | `VENCIMIENTO_PLAZO` | Vencimiento de plazo (Art.250 LCT) |
|
|
242
|
+
| `33` | `JUBILACION` | Jubilacion (Art.252 LCT) |
|
|
243
|
+
| `34` | `INCAPACIDAD` | Incapacidad del trabajador (Art.254 LCT) |
|
|
244
|
+
| `38` | `FIN_APRENDIZAJE_PASANTIA` | Fin contrato de aprendizaje y pasantias |
|
|
245
|
+
| `99` | `VENCIMIENTO_PLAZO_FIJO` | Vencimiento contrato a plazo fijo o determinado |
|
|
246
|
+
|
|
247
|
+
> Hay 34 codigos en total. Consultar el enum `MotivoBaja` para la lista completa.
|
|
248
|
+
|
|
249
|
+
### Situacion de Revista (`SituacionRevista`)
|
|
250
|
+
|
|
251
|
+
Codigos oficiales de Simplificacion Registral. Se muestran los mas utilizados:
|
|
252
|
+
|
|
253
|
+
| Codigo | Enum | Descripcion |
|
|
254
|
+
|--------|------|-------------|
|
|
255
|
+
| `1` | `ACTIVO` | Activo |
|
|
256
|
+
| `5` | `LICENCIA_MATERNIDAD` | Licencia por maternidad |
|
|
257
|
+
| `6` | `SUSPENSION_OTRAS_CAUSALES` | Suspensiones otras causales |
|
|
258
|
+
| `9` | `SUSPENSION_223_BIS` | Suspendido Art. 223 Bis |
|
|
259
|
+
| `13` | `LICENCIA_SIN_GOCE` | Licencia sin goce de haberes |
|
|
260
|
+
| `14` | `RESERVA_PUESTO` | Reserva de puesto |
|
|
261
|
+
| `32` | `LICENCIA_PATERNIDAD` | Licencia por paternidad |
|
|
262
|
+
| `44` | `CONSERVACION_EMPLEO` | Conservacion del empleo |
|
|
263
|
+
|
|
264
|
+
> Hay 23 codigos en total. Consultar el enum `SituacionRevista` para la lista completa.
|
|
265
|
+
|
|
266
|
+
### Provincias (`Provincia`)
|
|
267
|
+
|
|
268
|
+
Codigos 0-23: CABA (0), Buenos Aires (1), Catamarca (2), Cordoba (3), Corrientes (4), Entre Rios (5), Jujuy (6), Mendoza (7), La Rioja (8), Salta (9), San Juan (10), San Luis (11), Santa Fe (12), Santiago del Estero (13), Tucuman (14), Chaco (15), Chubut (16), Formosa (17), Misiones (18), Neuquen (19), La Pampa (20), Rio Negro (21), Santa Cruz (22), Tierra del Fuego (23).
|
|
269
|
+
|
|
270
|
+
### Otros enums
|
|
271
|
+
|
|
272
|
+
- `NivelEducacion` (0-10): Sin instruccion hasta Posgrado completo
|
|
273
|
+
- `EstadoCivil` (1-6): Soltero, Casado, Divorciado, Viudo, Separado, Union convivencial
|
|
274
|
+
- `TipoRelacionFamiliar` (1-7): Conyuge, Hijo, Hijo discapacitado, Hijastro, Menor en guarda, Prenatal, Conviviente
|
|
275
|
+
- `TipoServicio` (1-2): Con/sin aporte PAMI
|
|
276
|
+
- `ModalidadLiquidacion` (1-8): Mensual, Quincenal, Semanal, Diaria, Por hora, Por pieza, A comision, Jornal
|
|
277
|
+
- `TipoCuenta` (1-2): Caja de ahorro, Cuenta corriente
|
|
278
|
+
- `Escolaridad` (0-5): No escolar hasta Universitaria
|
|
279
|
+
|
|
280
|
+
### Mapas de descripciones
|
|
281
|
+
|
|
282
|
+
Cada enum tiene un mapa de descripciones exportado:
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
import { MOTIVO_BAJA_DESCRIPCION, MotivoBaja } from '@ramiidv/arca-empleados-sdk';
|
|
286
|
+
|
|
287
|
+
console.log(MOTIVO_BAJA_DESCRIPCION[MotivoBaja.RENUNCIA]); // "Renuncia del trabajador (Art.240 LCT)"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Mapas disponibles: `MODALIDAD_CONTRATACION_DESCRIPCION`, `MOTIVO_BAJA_DESCRIPCION`, `SITUACION_REVISTA_DESCRIPCION`, `NIVEL_EDUCACION_DESCRIPCION`, `ESTADO_CIVIL_DESCRIPCION`, `TIPO_RELACION_FAMILIAR_DESCRIPCION`, `PROVINCIA_DESCRIPCION`, `MODALIDAD_LIQUIDACION_DESCRIPCION`, `TIPO_CUENTA_DESCRIPCION`, `ESCOLARIDAD_DESCRIPCION`, `TIPO_SERVICIO_DESCRIPCION`.
|
|
291
|
+
|
|
292
|
+
## Validacion
|
|
293
|
+
|
|
294
|
+
El SDK valida automaticamente los datos cuando `strict: true` (default):
|
|
295
|
+
|
|
296
|
+
### CUIL
|
|
297
|
+
|
|
298
|
+
- Formato: 11 digitos (acepta `XX-XXXXXXXX-X` o `XXXXXXXXXXX`)
|
|
299
|
+
- Prefijos validos: 20, 23, 24, 27, 30, 33, 34
|
|
300
|
+
- Digito verificador: algoritmo de modulo 11 con pesos [5,4,3,2,7,6,5,4,3,2]
|
|
301
|
+
|
|
302
|
+
### CBU
|
|
303
|
+
|
|
304
|
+
- Formato: 22 digitos
|
|
305
|
+
- Bloque 1 (8 digitos): banco + sucursal + digito verificador
|
|
306
|
+
- Bloque 2 (14 digitos): cuenta + digito verificador
|
|
307
|
+
- Ambos digitos verificadores se validan con algoritmo de pesos alternados
|
|
308
|
+
|
|
309
|
+
### Fechas
|
|
310
|
+
|
|
311
|
+
- Deben ser objetos `Date` validos
|
|
312
|
+
- `fechaFin` debe ser posterior a `fechaInicio`
|
|
313
|
+
- `fechaFin` es obligatoria para contratos a plazo fijo, eventuales, aprendizaje y pasantia
|
|
314
|
+
|
|
315
|
+
### Domicilios
|
|
316
|
+
|
|
317
|
+
- Calle, numero, localidad y codigo postal son requeridos
|
|
318
|
+
- Provincia debe ser un valor entre 0 y 23
|
|
319
|
+
|
|
320
|
+
## Manejo de errores
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
import {
|
|
324
|
+
ArcaEmpleadosError, // Base (catch-all)
|
|
325
|
+
ArcaValidationError, // Datos invalidos
|
|
326
|
+
ArcaSerializationError, // Fallo al serializar
|
|
327
|
+
} from '@ramiidv/arca-empleados-sdk';
|
|
328
|
+
|
|
329
|
+
try {
|
|
330
|
+
empleados.alta({ /* ... */ });
|
|
331
|
+
} catch (error) {
|
|
332
|
+
if (error instanceof ArcaValidationError) {
|
|
333
|
+
console.error('Campo:', error.field);
|
|
334
|
+
for (const detalle of error.errors) {
|
|
335
|
+
console.error(` ${detalle.field}: ${detalle.message}`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Utilidades de CUIL/CBU
|
|
342
|
+
|
|
343
|
+
```ts
|
|
344
|
+
import {
|
|
345
|
+
validateCuil, // Valida y retorna CUIL normalizado (11 digitos)
|
|
346
|
+
validateCBU, // Valida y retorna CBU (22 digitos)
|
|
347
|
+
normalizeCuil, // Quita guiones: "20-12345678-6" -> "20123456786"
|
|
348
|
+
formatCuil, // Agrega guiones: "20123456789" -> "20-12345678-6"
|
|
349
|
+
} from '@ramiidv/arca-empleados-sdk';
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## Formato del archivo
|
|
353
|
+
|
|
354
|
+
El archivo generado usa formato delimitado por pipes (`|`). Cada linea representa un registro:
|
|
355
|
+
|
|
356
|
+
```text
|
|
357
|
+
00|CUIT_EMPLEADOR|RAZON_SOCIAL|FECHA_GENERACION|CANTIDAD_REGISTROS|
|
|
358
|
+
01|CUIT_EMPLEADOR|TIPO_OP|CUIL|...campos...|
|
|
359
|
+
02|CUIT_EMPLEADOR|CUIL|...campos...|
|
|
360
|
+
03|CUIT_EMPLEADOR|CUIL|...campos...|
|
|
361
|
+
04|CUIT_EMPLEADOR|CUIL|...campos...|
|
|
362
|
+
05|CUIT_EMPLEADOR|CUIL|...campos...|
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
- `00`: Header
|
|
366
|
+
- `01`: Relacion laboral (alta=0, baja=1, modificacion=2)
|
|
367
|
+
- `02`: Datos complementarios
|
|
368
|
+
- `03`: CBU
|
|
369
|
+
- `04`: Relacion familiar
|
|
370
|
+
- `05`: Domicilio de explotacion
|
|
371
|
+
|
|
372
|
+
Las fechas se formatean como DDMMYYYY. Los booleanos como 'S'/'N'.
|
|
373
|
+
|
|
374
|
+
## Nota sobre codigos SICOSS
|
|
375
|
+
|
|
376
|
+
Los codigos de modalidad de contratacion, situacion de revista, motivos de baja y otros estan basados en las tablas SICOSS oficiales. Es recomendable verificar los valores contra las tablas vigentes publicadas por ARCA, ya que pueden actualizarse periodicamente.
|
|
377
|
+
|
|
378
|
+
## Licencia
|
|
379
|
+
|
|
380
|
+
MIT
|