herramientaenvioestupendo 1.1.39 → 1.1.40

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # EstupendoCLI — v1.1.39
1
+ # EstupendoCLI — v1.1.40
2
2
 
3
3
  Esta herramienta esta destinada para uso de los Ing. implementadores y de soporte de la empresa Estupendo-Colombia.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "herramientaenvioestupendo",
3
- "version": "1.1.39",
3
+ "version": "1.1.40",
4
4
  "private": false,
5
5
  "description": "Proyecto para envio documentos masivos",
6
6
  "keywords": [],
@@ -363,6 +363,8 @@ const applyTestPrefix = (documentNumber, isProd, documentType) => {
363
363
  return `SETT${documentNumber.slice(2)}`
364
364
  }
365
365
 
366
+ const todayDate = () => new Date().toISOString().slice(0, 10)
367
+
366
368
  // Catalogo DIAN de motivos de nota credito/debito, segun el CodigoNota que arma el SP (SFRES: DEVAN/NALAM/VOLUM/otro)
367
369
  const NOTE_REASON_DESCRIPTIONS = {
368
370
  "01": "Devolucion de parte de los bienes; no aceptacion de parte del servicio",
@@ -384,9 +386,9 @@ const toApiDocument = (document, isProd) => {
384
386
  documentHead: {
385
387
  UUID: asString(getAny(cabecera, ["UUID", "CUFE", "CUDE", "FolioKeyControl"], "CUFE-SHA384")),
386
388
  documentType: documentType,
387
- type: asString(firstValue(getAny(cabecera, ["SubTipoOperacion"]), getAny((document.documentosRelacionados || [])[0] || {}, ["CodigoNota"]))),
389
+ type: asString(firstValue(getAny(cabecera, ["SubTipoOperacion"]), getAny((document.documentosRelacionados || [])[0] || {}, ["CodigoNota"])), "1"),
388
390
  documentNumber: applyTestPrefix(asString(getAny(cabecera, ["NumeroDocumento"], document.numeroDocumento)), isProd, documentType),
389
- dateCreated: asString(getAny(cabecera, ["FechaEmision"])),
391
+ dateCreated: isProd ? asString(getAny(cabecera, ["FechaEmision"])) : todayDate(),
390
392
  timeCreated: asString(getAny(cabecera, ["HoraEmision"])),
391
393
  opetarionType: asString(getAny(cabecera, ["TipoOperacion"])),
392
394
  refererOrder: asString(getAny(cabecera, ["OrdenCompra"])),
package/src/index.js CHANGED
@@ -4,7 +4,7 @@ import { sendTxt, sendXml, sendAttached, sendJson, requestDocumentRace, sendTxtC
4
4
  import { sendDb2Sp } from "./db2_connector.js"
5
5
 
6
6
 
7
- program.name("estupendo").version("1.1.39")
7
+ program.name("estupendo").version("1.1.40")
8
8
 
9
9
  program.command("send_xml")
10
10
  .requiredOption("-d, --directory <char>", "Directorio donde se encuentran los documentos XML")