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 +1 -1
- package/package.json +1 -1
- package/src/db2_connector.js +4 -2
- package/src/index.js +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/db2_connector.js
CHANGED
|
@@ -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.
|
|
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")
|