# fiscalintegrationcots

> FiscalIntegrationCoTs es una librería desarrollada en Node.js (TypeScript) en su version 18.14.0, que permite el envío de documentos nómina electrónica y eventos de RADIAN a la DIAN a través de los servicios ofrecidos por el proveedor tecnológico avalado

Latest version **1.2.0** (published 2023-04-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install fiscalintegrationcots
pnpm add fiscalintegrationcots
yarn add fiscalintegrationcots
bun add fiscalintegrationcots
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2023-04-05 |
| First published | 2023-03-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 98.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | fiscalproductsco |

## Links

- npm: https://www.npmjs.com/package/fiscalintegrationcots
- npm.io page: https://npm.io/package/fiscalintegrationcots

## Dependencies (12)

- [chai](https://npm.io/package/chai.md) ^4.3.7
- [axios](https://npm.io/package/axios.md) ^1.3.4
- [moment](https://npm.io/package/moment.md) ^2.29.4
- [ts-node](https://npm.io/package/ts-node.md) ^10.9.1
- [jwt-decode](https://npm.io/package/jwt-decode.md) ^3.1.2
- [jwt-simple](https://npm.io/package/jwt-simple.md) ^0.5.6
- [typescript](https://npm.io/package/typescript.md) ^4.9.5
- [@types/chai](https://npm.io/package/@types/chai.md) ^4.3.4
- [@types/axios](https://npm.io/package/@types/axios.md) ^0.14.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.0
- [@types/jwt-decode](https://npm.io/package/@types/jwt-decode.md) ^3.1.0
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^9.0.1

## Recent versions

- 1.2.0 (latest) — 2023-04-05
- 1.1.0 — 2023-03-13
- 1.0.2 — 2023-03-07
- 1.0.1 — 2023-03-06

## README

## FiscalIntegrationCo
FiscalIntegrationCoTs es una librería desarrollada en Node.js (TypeScript) en su version 18.14.0, que permite el envío de documentos nómina electrónica y eventos de RADIAN a la DIAN a través de los servicios ofrecidos por el proveedor tecnológico avalado por la DIAN, BTW SAS.

**Archivo de configuración `librarysettings.json`**

Para el correcto funcionamiento de la liberia es necesario agregar en la raiz de su proyecto un archivo JSON con nombre `librarysettings.json`, en este se debe configurar un objeto `EnvironmentTypeSettings` el cual indica  el ambiente al que se realizaran los timbrados. El valor a cargar en el campo `EnvironmentType` esta descrito en la 
columna `Enum Index` de la tabla `Descripción de los ambientes` según aplique. Tambien se debe configurar un objeto  `AuthenticationSettings` el cual indica las credenciales requeridas para la conexion a los servicios de timbrado, en este se indican los campos usuario (`Username`) y contraseña (`Password`).
```json
{
  "EnvironmentTypeSettings": {
    "EnvironmentType": "2"
  },
  "AuthenticationSettings": {
    "Username": "",
    "Password": ""
  }
}
```
En este ejemplo el valor `2` corresponde al ambiente `UAT` (`PRUEBAS`).
Los valores a cargar en los campos `Username` y `Password` son proporcionados por el proveedor tecnológico `BTW SAS`.
____

### Modelos incluídos en la librería 

**DocumentType** (tipos de documento)

- Nomina
- Radian

**EnvironmentType** (tipos de ambiente)

- PRD
- HAB
- UAT
- PLT
- NA

**Descripción de los ambientes**

| EnvironmentType Value  | Descripción | Enum Index |
| ------------- |:-------------:|:-------------:|
|PRD      | PRODUCCIÓN | 0 |
| HAB     | HABILITACIÓN | 1 |
| UAT     | PRUEBAS | 2 |
| PLT     | PILOTO | 3 |
| NA      | NO APLICA | 4 |


**Estructura del modelo de respuesta, PetitionResponse**

```json
{
  "PetitionResponse"
  {
      "success" : true,
      "message" : "",
      "module" : "",
      "URL" : "",
      "Tracer" : "",
      "result" : ""
  }  
}
```

____

**Estructura del modelo de Nómina Electrónica**

```json

  DocumentoNomina {
    "empleador" : Empleador,
    "trabajadores" : Array<Trabajadores>
  }

```

**Estructura del modelo de Empleador**

```json
  Empleador {
    "razonSocial" : string,
    "primerApellido" : string | null,
    "segundoApellido" : string | null,
    "primerNombre" : string | null,
    "otrosNombres" : string | null,
    "nit" : string,
    "dv" : string,
    "pais" : string,
    "departamentoEstado" : string,
    "municipioCiudad" : string,
    "direccion" : string
  }
```

**Estructura del modelo de Trabajadores**

```json
  Trabajadores {
    "trabajador" : Trabajador,
    "numeroSecuenciaXML" : NumeroSecuenciaXML,
    "informacionGeneral" : InformacionGeneral,
    "documentRef" : DocumentRef,
    "fechasPagos" : Array<FechasPagos>,
    "basicoDevengados" : BasicoDevengados | [],
    "cesantias" : Cesantias | [],
    "compensaciones" : Array<Compensaciones> | [],
    "deducciones" : Array<Deducciones> | [],
    "devengados" : Array<Devengados> | [], 
    "fondoSP" : Array<FondoSP> | [],
    "horasExtras" : Array<HorasExtras> | [],
    "huelgasLegales" : Array<HuelgasLegales> | [],
    "notas" : Array<Nota> | [],
    "otrasDeducciones" : Array<OtrasDeducciones> | [],
    "otrosConceptos" : Array<OtrosConceptos> | [],
    "otrosDevengados" : Array<OtrosDevengados> | [],
    "pago" : Pago,
    "primas" : Array<Primas> | [],
    "sanciones" : Array<Sanciones> | [],
    "transporte" : Array<Transporte> | []
  }
```

**Estructura del modelo de Trabajador**

```json
  Trabajador {
    "tipoTrabajador" : string,
    "subTipoTrabajador" : string,
    "fechaIngreso" : string,
    "_fechaRetiro" : Date | null,
    "fechaRetiro" : string | null,
    "tiempoLaborado" : string,
    "altoRiesgoPension" : boolean,
    "tipoDocumento" : string,
    "numeroDocumento" : string,
    "primerApellido" : string,
    "segundoApellido" : string,
    "primerNombre" : string,
    "otrosNombres" : string,
    "lugarTrabajoPais" : string,
    "lugarTrabajoMunicipioCiudad" : string,
    "lugarTrabajoDepartamentoEstado" : string,
    "lugarTrabajoDireccion" : string,
    "salarioIntegral" : boolean,
    "tipoContrato" : number,
    "sueldo" : number,
    "codigoTrabajador" : string,
    "email" : string
  }
```

**Estructura del modelo de NumeroSecuenciaXML**

```json
  NumeroSecuenciaXML {
    "prefijo" : string,
    "consecutivo" : string,
    "numero" : string
  }
```

**Estructura del modelo de InformacionGeneral**

```json
  InformacionGeneral {
    "fechaGen" : string,
    "fechaPagoInicio" : string,
    "fechaPagoFin" : string,
    "tipoNomina" : string,
    "periodoNomina" : string,
    "tipoMoneda" : string,
    "tipoNota" : string,
    "notas" : string,
    "numDocNovedad" : string,
    "trm" : number,
    "devengadosTotal" : number,
    "deduccionesTotal" : number,
    "comprobanteTotal" : number
  }
```

**Estructura del modelo de DocumentRef**

```json
  DocumentRef {
    "numRef" : string,
    "fechaGenPred" : string,
    "cuneRef" : string
  }
```

**Estructura del modelo de FechasPagos**

```json
  FechasPagos {
    "fecha" : string
  }
```

**Estructura del modelo de BasicoDevengados**

```json
  BasicoDevengados {
    "diasTrabajados" : number,
    "sueldoTrabajado" : number
  }
```

**Estructura del modelo de Cesantias**

```json
  Cesantias {
    "pago" : number,
    "porcentaje" : number,
    "pagoIntereses" : number
  }
```

**Estructura del modelo de Compensaciones**

```json
  Compensaciones {
    "compensacionO" : number,
    "compensacionE" : number
  }
```

**Estructura del modelo de Deducciones**

```json
  Deducciones {
    "tipo" : number,
    "porcentaje" : number,
    "valorBase" : number,
    "deduccion" : number,
    "descripcion" : string
  }
```

**Estructura del modelo de Devengados**

```json
  Devengados {
    "tipo" : number,
    "fechaInicio" : string,
    "_fechaFin" : Date,
    "fechaFin" : string,
    "cantidad" : number,
    "pago" : number
  }
```

**Estructura del modelo de FondoSP**

```json
  FondoSP {
    "porcentaje" : number,
    "deduccionSP" : number,
    "porcentajeSub" : number,
    "deduccionSub" : number
  }
```

**Estructura del modelo de HorasExtras**

```json
  HorasExtras {
    "tipo" : string,
    "horaInicio" : string,
    "horaFin" : string,
    "cantidad" : number,
    "porcentaje" : number,
    "pago" : number
  }
```

**Estructura del modelo de HuelgasLegales**

```json
  HuelgasLegales {
    "fechaInicio" : string,
    "fechaFin" : string,
    "cantidad" : number  
  }
```

**Estructura del modelo de Nota**

```json
  Nota {
    "nota" : string
  }
```

**Estructura del modelo de OtrasDeducciones**

```json
  OtrasDeducciones {
    "otraDeduccion" : number,
    "pensionVoluntaria" : number,
    "retencionFuente" : number,
    "ica" : number,
    "afc" : number,
    "cooperativa" : number,
    "embargoFiscal" : number,
    "planComplementarios" : number, 
    "educacion" : number,
    "reintegro": number,
    "deuda" : number,
    "pagoTercero" : number,
    "anticipo" : number
  }
```

**Estructura del modelo de OtrosConceptos**

```json
  OtrosConceptos {
    "tipo" : number,
    "descripcionConcepto" : string,
    "conceptoS" : number,
    "conceptoNS" : number
  }
```

**Estructura del modelo de OtrosDevengados**

```json
  OtrosDevengados {
    "dotacion" : number,
    "apoyoSost": number,
    "teletrabajo" : number,
    "bonifRetiro" : number,
    "reintegro" : number,
    "indemnizacion" : number,
    "pagoTercero" : number,
    "anticipo" : number,
    "comision" : number
  }
```

**Estructura del modelo de Pago**

```json
  Pago {
    "forma" : number,
    "metodo" : string,
    "banco" : string,
    "tipoCuenta" : string,
    "numeroCuenta" : string
  }
```

**Estructura del modelo de Primas**

```json
  Primas {
    "cantidad" : string,
    "pago" : string,
    "pagoNS" : string
  }
```

**Estructura del modelo de Sanciones**

```json
  Sanciones {
    "sancionPublic" : number,
    "sancionPriv" : number
  }
```

**Estructura del modelo de Transporte**

```json
  Transporte {
    "auxilioTransporte" : number,
    "viaticoManuAlojS" : number,
    "viaticoManuAlojNS" : number
  }
```
____

**Estructura del modelo de RADIAN**

```json
  BasicStructure {
    "FromHead" : FromHead,
    "FromSenderTaxScheme" : FromSenderTaxScheme,
    "FromSenderParty" : Array<FromSenderParty>,
    "FromReceiverTaxScheme" : Array<FromReceiverTaxScheme>,
    "FromReceiverParty" : Array<FromReceiverParty>,
    "FromIssuerParty" : Array<FromIssuerParty>,
    "FromDRIssuerLegalEntity" : Array<FromDRIssuerLegalEntity>,
    "FromSenderLegalEntity" : Array<FromSenderLegalEntity>,
    "FromReceiverLegalEntity" : Array<FromReceiverLegalEntity>,
    "FromCustomTagGeneral" : Array<FromCustomTagGeneral>,
    "FromDRPerson" : Array<FromDRPerson>,
    "FromSenderPerson" : Array<FromSenderPerson>,
    "FromReceiverPerson" : Array<FromReceiverPerson>,
    "FromSenderPAttorney" : Array<FromSenderPAttorney>,
    "FromDRIssuerPAttorney" : Array<FromDRIssuerPAttorney>,
    "FromDRIssuerPAttorneyPerson" : Array<FromDRIssuerPAttorneyPerson>,
    "FromDRIssuerTaxScheme" : Array<FromDRIssuerTaxScheme>,
    "FromDocumentReference" : Array<FromDocumentReference>,
    "Notes" : Array<Notes>,
    "FromAttachment" : Array<FromAttachment>
  }
```

**Estructura del modelo de FromHead**

```json
  FromHead {
    "ID" : string,
    "IssueDate" : string,
    "ResponseCode" : string,
    "ResponseCodeListID" : string,
    "OperationType_c" : string,
    "CustomizationSchemeID" : string,
    "EffectiveDateMandate" : string,
    "PublicEffectiveDate" : string,
    "Email" : string,
    "ConsecutiveTerm" : string,
    "Attachment" : string,
    "ValidityNote" : string,
    "CurrencyCode" : string
  }
```

**Estructura del modelo de FromSenderTaxScheme**

```json
  FromSenderTaxScheme {
    "RegistrationName" : string,
    "CompanyID" : string,
    "SenderIDType" : string,
    "OrganizationIDType" : string,
    "StockAmount1" : number,
    "Currency1" : string
  }
```

**Estructura del modelo de FromSenderParty**

```json
  FromSenderParty {
    "ID" : string,
    "RegistrationName" : string,
    "SenderIDType" : string,
    "OrganizationIDType" : string,
    "CompanyLegalFormCode" : string,
    "StockAmount" : number,
    "SenderMandateType" : string
  }
```

**Estructura del modelo de FromSenderParty**

```json
  FromReceiverTaxScheme {
    "RegistrationName" : string,
    "CompanyID" : string,
    "ReceiverIDType" : string,
    "OrganizationIDType" : string,
    "StockAmount1" : number,
    "Currency1" : string
  }
```

**Estructura del modelo de FromSenderParty**

```json
  FromReceiverParty {
    "ID" : string,
    "RegistrationName" : string,
    "ReceiverIDType" : string,
    "OrganizationIDType" : string,
    "CompanyLegalFormCode" : string,
    "StockAmount" : number,
    "ReceiverMandateType" : string
  }
```

**Estructura del modelo de FromIssuerParty**

```json
  FromIssuerParty {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "OrganizationIDType" : string,
    "StockAmount" : number
  }
```

**Estructura del modelo de FromDRIssuerLegalEntity**

```json
  FromDRIssuerLegalEntity {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "CompanyType_c" : string,
    "StockAmount1" : string,
    "Currency1" : string
  }
```

**Estructura del modelo de FromSenderLegalEntity**

```json
  FromSenderLegalEntity {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "CompanyType_c" : string,
    "StockAmount1" : string,
    "Currency1" : string
  }
```

**Estructura del modelo de FromReceiverLegalEntity**

```json
  FromReceiverLegalEntity {
    "LegalFormCode" : string,
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "CompanyType_c" : string,
    "StockAmount1" : number,
    "Currency1" : string
  }
```

**Estructura del modelo de FromCustomTagGeneral**

```json
  FromCustomTagGeneral {
    "Name" : string,
    "Value" : string
  }
```

**Estructura del modelo de FromDRPerson**

```json
  FromDRPerson {
    "ID" : string,
    "IssuerIDType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "OrganizationDepartment" : string,
    "Nationality" : string
  }
```

**Estructura del modelo de FromSenderPerson**

```json
  FromSenderPerson {
    "ID" : string,
    "IdentificationType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "Nationality" : string,
    "OrganizationDepartment" : string
  }
```

**Estructura del modelo de FromReceiverPerson**

```json
  FromReceiverPerson {
    "ID" : string, 
    "IdentificationType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "Nationality" : string,
    "OrganizationDepartment" : string
  }
```

**Estructura del modelo de FromSenderPAttorney**

```json
  FromSenderPAttorney {
    "ID" : string,
    "IdentificationType" : string,
    "TipoMandante" : string,
    "Description" : string
  }
```

**Estructura del modelo de FromDRIssuerPAttorney**

```json
  FromDRIssuerPAttorney {
    "ID" : string,
    "IssuerIDType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "OrganizationDepartment" : string,
    "Nationality" : string
  }
```

**Estructura del modelo de FromDRIssuerPAttorneyPerson**

```json
  FromDRIssuerPAttorneyPerson {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "OrganizationIDType" : string,
    "StockAmount" : number
  }
```

**Estructura del modelo de FromDRIssuerTaxScheme**

```json
  FromDRIssuerTaxScheme {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "OrganizationIDType" : string,
    "StockAmount" : number
  }
```

**Estructura del modelo de FromDocumentReference**

```json
  FromDocumentReference {
    "LegalNumRef" : string,
    "CUFERef" : string,
    "DocumentTypeCodeRef" : string,
    "StartDate" : string,
    "EndDate" : string,
    "DescriptionCode" : string,
    "Description" : string,
    "ScopeMandate" : string
  }
```

**Estructura del modelo de Notes**

```json
  Notes {
    "Note" : string
  }
```

**Estructura del modelo de Notes**

```json
  FromAttachment {
    "ID" : string,
    "DocumentBinary" : string,
    "ResponseDescription" : string,
    "DocumentDescription" : string,
    "EffectiveDate" : string
  }
```
____
## FiscalIntegrationCo para .NET

### .NET Standard 2.0

[![NuGet Version](http://img.shields.io/nuget/v/Fiscal.Library.Core.svg?style=flat)](https://www.nuget.org/packages/Fiscal.Library.Core/) [![NuGet Downloads](https://img.shields.io/nuget/dt/Fiscal.Library.Core.svg)](https://www.nuget.org/packages/Fiscal.Library.Core/)

Paquete oficial .NET *[FiscalIntegrationCo](https://github.com/FiscalProductsCo/FiscalIntegration)*

---
_Source: https://npm.io/package/fiscalintegrationcots · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
