modificacion factura lsoto

This commit is contained in:
Luis
2026-10-19 18:21:13 -04:00
parent 1d3906bcc3
commit 4c9a841473
33 changed files with 18480 additions and 252 deletions
+15
View File
@@ -55,6 +55,12 @@ FUNCTION procesoEncf(fileporfirmar,ambiente,tiporecepcion,xsucid,xbodega,xoperac
# LET ptipoRecepcion = tiporecepcion
LET ruta_firmados = fgl_getenv("RUTA_XML_FIRMADOS")
# Studio quita la barra final de las variables tipo dir: asegurarla
IF ruta_firmados.getLength() > 0 THEN
IF ruta_firmados.subString(ruta_firmados.getLength(), ruta_firmados.getLength()) <> "/" AND ruta_firmados.subString(ruta_firmados.getLength(), ruta_firmados.getLength()) <> "\\" THEN
LET ruta_firmados = ruta_firmados, "/"
END IF
END IF
LET rutaSemilla = fgl_getenv("RUTA_SEMILLA")
LET rutaCert = fgl_getenv("RUTA_CERT")
@@ -178,6 +184,12 @@ FUNCTION firmadocumento(fileafirmar)
fileafirmar STRING
LET rutaCert = fgl_getenv("RUTA_CERT")
LET ruta_firmados = fgl_getenv("RUTA_XML_FIRMADOS")
# Studio quita la barra final de las variables tipo dir: asegurarla
IF ruta_firmados.getLength() > 0 THEN
IF ruta_firmados.subString(ruta_firmados.getLength(), ruta_firmados.getLength()) <> "/" AND ruta_firmados.subString(ruta_firmados.getLength(), ruta_firmados.getLength()) <> "\\" THEN
LET ruta_firmados = ruta_firmados, "/"
END IF
END IF
# Create DomDocument object
LET doc = xml.DomDocument.Create()
# Notice that whitespaces are significant in cryptography,
@@ -247,6 +259,9 @@ LET ruta_firmados = fgl_getenv("RUTA_XML_FIRMADOS")
# Save document with enveloped signature back to disk
CALL doc.setFeature("format-pretty-print",TRUE)
LET fileafirmar = ruta_firmados CLIPPED,os.Path.baseName(fileafirmar)
# om.XmlWriter escribe en la codificacion del sistema (windows-1252);
# la DGII lo rechaza (codigo 003). Se guarda el firmado en UTF-8.
CALL doc.setXmlEncoding("UTF-8")
CALL doc.save(fileafirmar)