1.2.0 • Published 1 year ago

fiscalintegrationcots v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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).

{
  "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 ValueDescripciónEnum Index
PRDPRODUCCIÓN0
HABHABILITACIÓN1
UATPRUEBAS2
PLTPILOTO3
NANO APLICA4

Estructura del modelo de respuesta, PetitionResponse

{
  "PetitionResponse"
  {
      "success" : true,
      "message" : "",
      "module" : "",
      "URL" : "",
      "Tracer" : "",
      "result" : ""
  }  
}

Estructura del modelo de Nómina Electrónica

  DocumentoNomina {
    "empleador" : Empleador,
    "trabajadores" : Array<Trabajadores>
  }

Estructura del modelo de Empleador

  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

  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

  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

  NumeroSecuenciaXML {
    "prefijo" : string,
    "consecutivo" : string,
    "numero" : string
  }

Estructura del modelo de InformacionGeneral

  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

  DocumentRef {
    "numRef" : string,
    "fechaGenPred" : string,
    "cuneRef" : string
  }

Estructura del modelo de FechasPagos

  FechasPagos {
    "fecha" : string
  }

Estructura del modelo de BasicoDevengados

  BasicoDevengados {
    "diasTrabajados" : number,
    "sueldoTrabajado" : number
  }

Estructura del modelo de Cesantias

  Cesantias {
    "pago" : number,
    "porcentaje" : number,
    "pagoIntereses" : number
  }

Estructura del modelo de Compensaciones

  Compensaciones {
    "compensacionO" : number,
    "compensacionE" : number
  }

Estructura del modelo de Deducciones

  Deducciones {
    "tipo" : number,
    "porcentaje" : number,
    "valorBase" : number,
    "deduccion" : number,
    "descripcion" : string
  }

Estructura del modelo de Devengados

  Devengados {
    "tipo" : number,
    "fechaInicio" : string,
    "_fechaFin" : Date,
    "fechaFin" : string,
    "cantidad" : number,
    "pago" : number
  }

Estructura del modelo de FondoSP

  FondoSP {
    "porcentaje" : number,
    "deduccionSP" : number,
    "porcentajeSub" : number,
    "deduccionSub" : number
  }

Estructura del modelo de HorasExtras

  HorasExtras {
    "tipo" : string,
    "horaInicio" : string,
    "horaFin" : string,
    "cantidad" : number,
    "porcentaje" : number,
    "pago" : number
  }

Estructura del modelo de HuelgasLegales

  HuelgasLegales {
    "fechaInicio" : string,
    "fechaFin" : string,
    "cantidad" : number  
  }

Estructura del modelo de Nota

  Nota {
    "nota" : string
  }

Estructura del modelo de OtrasDeducciones

  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

  OtrosConceptos {
    "tipo" : number,
    "descripcionConcepto" : string,
    "conceptoS" : number,
    "conceptoNS" : number
  }

Estructura del modelo de OtrosDevengados

  OtrosDevengados {
    "dotacion" : number,
    "apoyoSost": number,
    "teletrabajo" : number,
    "bonifRetiro" : number,
    "reintegro" : number,
    "indemnizacion" : number,
    "pagoTercero" : number,
    "anticipo" : number,
    "comision" : number
  }

Estructura del modelo de Pago

  Pago {
    "forma" : number,
    "metodo" : string,
    "banco" : string,
    "tipoCuenta" : string,
    "numeroCuenta" : string
  }

Estructura del modelo de Primas

  Primas {
    "cantidad" : string,
    "pago" : string,
    "pagoNS" : string
  }

Estructura del modelo de Sanciones

  Sanciones {
    "sancionPublic" : number,
    "sancionPriv" : number
  }

Estructura del modelo de Transporte

  Transporte {
    "auxilioTransporte" : number,
    "viaticoManuAlojS" : number,
    "viaticoManuAlojNS" : number
  }

Estructura del modelo de RADIAN

  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

  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

  FromSenderTaxScheme {
    "RegistrationName" : string,
    "CompanyID" : string,
    "SenderIDType" : string,
    "OrganizationIDType" : string,
    "StockAmount1" : number,
    "Currency1" : string
  }

Estructura del modelo de FromSenderParty

  FromSenderParty {
    "ID" : string,
    "RegistrationName" : string,
    "SenderIDType" : string,
    "OrganizationIDType" : string,
    "CompanyLegalFormCode" : string,
    "StockAmount" : number,
    "SenderMandateType" : string
  }

Estructura del modelo de FromSenderParty

  FromReceiverTaxScheme {
    "RegistrationName" : string,
    "CompanyID" : string,
    "ReceiverIDType" : string,
    "OrganizationIDType" : string,
    "StockAmount1" : number,
    "Currency1" : string
  }

Estructura del modelo de FromSenderParty

  FromReceiverParty {
    "ID" : string,
    "RegistrationName" : string,
    "ReceiverIDType" : string,
    "OrganizationIDType" : string,
    "CompanyLegalFormCode" : string,
    "StockAmount" : number,
    "ReceiverMandateType" : string
  }

Estructura del modelo de FromIssuerParty

  FromIssuerParty {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "OrganizationIDType" : string,
    "StockAmount" : number
  }

Estructura del modelo de FromDRIssuerLegalEntity

  FromDRIssuerLegalEntity {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "CompanyType_c" : string,
    "StockAmount1" : string,
    "Currency1" : string
  }

Estructura del modelo de FromSenderLegalEntity

  FromSenderLegalEntity {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "CompanyType_c" : string,
    "StockAmount1" : string,
    "Currency1" : string
  }

Estructura del modelo de FromReceiverLegalEntity

  FromReceiverLegalEntity {
    "LegalFormCode" : string,
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "CompanyType_c" : string,
    "StockAmount1" : number,
    "Currency1" : string
  }

Estructura del modelo de FromCustomTagGeneral

  FromCustomTagGeneral {
    "Name" : string,
    "Value" : string
  }

Estructura del modelo de FromDRPerson

  FromDRPerson {
    "ID" : string,
    "IssuerIDType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "OrganizationDepartment" : string,
    "Nationality" : string
  }

Estructura del modelo de FromSenderPerson

  FromSenderPerson {
    "ID" : string,
    "IdentificationType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "Nationality" : string,
    "OrganizationDepartment" : string
  }

Estructura del modelo de FromReceiverPerson

  FromReceiverPerson {
    "ID" : string, 
    "IdentificationType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "Nationality" : string,
    "OrganizationDepartment" : string
  }

Estructura del modelo de FromSenderPAttorney

  FromSenderPAttorney {
    "ID" : string,
    "IdentificationType" : string,
    "TipoMandante" : string,
    "Description" : string
  }

Estructura del modelo de FromDRIssuerPAttorney

  FromDRIssuerPAttorney {
    "ID" : string,
    "IssuerIDType" : string,
    "FirstName" : string,
    "FamilyName" : string,
    "JobTitle" : string,
    "OrganizationDepartment" : string,
    "Nationality" : string
  }

Estructura del modelo de FromDRIssuerPAttorneyPerson

  FromDRIssuerPAttorneyPerson {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "OrganizationIDType" : string,
    "StockAmount" : number
  }

Estructura del modelo de FromDRIssuerTaxScheme

  FromDRIssuerTaxScheme {
    "ID" : string,
    "Name" : string,
    "IdentificationType" : string,
    "OrganizationIDType" : string,
    "StockAmount" : number
  }

Estructura del modelo de FromDocumentReference

  FromDocumentReference {
    "LegalNumRef" : string,
    "CUFERef" : string,
    "DocumentTypeCodeRef" : string,
    "StartDate" : string,
    "EndDate" : string,
    "DescriptionCode" : string,
    "Description" : string,
    "ScopeMandate" : string
  }

Estructura del modelo de Notes

  Notes {
    "Note" : string
  }

Estructura del modelo de Notes

  FromAttachment {
    "ID" : string,
    "DocumentBinary" : string,
    "ResponseDescription" : string,
    "DocumentDescription" : string,
    "EffectiveDate" : string
  }

FiscalIntegrationCo para .NET

.NET Standard 2.0

NuGet Version NuGet Downloads

Paquete oficial .NET FiscalIntegrationCo