modificacion factura lsoto
This commit is contained in:
@@ -66,6 +66,12 @@ FUNCTION generafile(documento_encabezado,documento_Detalle,xsucid,xbodega,xopera
|
||||
phash,ohash VARCHAR(10)
|
||||
LET ohash = NULL
|
||||
LET ruta_originales= fgl_getenv("RUTA_XML_ORIGINALES")
|
||||
# Studio quita la barra final de las variables tipo dir: asegurarla
|
||||
IF ruta_originales.getLength() > 0 THEN
|
||||
IF ruta_originales.subString(ruta_originales.getLength(), ruta_originales.getLength()) <> "/" AND ruta_originales.subString(ruta_originales.getLength(), ruta_originales.getLength()) <> "\\" THEN
|
||||
LET ruta_originales = ruta_originales, "/"
|
||||
END IF
|
||||
END IF
|
||||
|
||||
#LET ruta_originales = '.\\filesXML\\ncf31\\'
|
||||
# LET documento_encabezado.nombreFile ='130337391E310000000001.XML'
|
||||
@@ -159,6 +165,12 @@ FUNCTION generafile(documento_encabezado,documento_Detalle,xsucid,xbodega,xopera
|
||||
IF r_documento_encabezado.tipoEcf = '32' AND montoFactura < 250000 THEN
|
||||
|
||||
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
|
||||
|
||||
CALL firmadocumento(nombreFile)
|
||||
LET filexml = ruta_firmados CLIPPED,os.Path.baseName(nombreFile)
|
||||
@@ -851,6 +863,12 @@ FUNCTION anularencf(documento_anular)
|
||||
|
||||
|
||||
LET ruta_originales= fgl_getenv("RUTA_XML_ORIGINALES")
|
||||
# Studio quita la barra final de las variables tipo dir: asegurarla
|
||||
IF ruta_originales.getLength() > 0 THEN
|
||||
IF ruta_originales.subString(ruta_originales.getLength(), ruta_originales.getLength()) <> "/" AND ruta_originales.subString(ruta_originales.getLength(), ruta_originales.getLength()) <> "\\" THEN
|
||||
LET ruta_originales = ruta_originales, "/"
|
||||
END IF
|
||||
END IF
|
||||
#LET ruta_originales = '.\\filesXML\\ncf31\\'
|
||||
# LET documento_encabezado.nombreFile ='130337391E310000000001.XML'
|
||||
LET nombreFile = ruta_originales,documento_anular.nombreFile CLIPPED
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user