-
Notifications
You must be signed in to change notification settings - Fork 0
-
Hello, how can I add the Signature Node to another specific node in the XML using the TransformEnveloped reference? I must do it in the second node ext:ExtensionContent of the XPATH: /Invoice/ext:UBLExtensions/ext:UBLExtension/ext:Exten I have tried but I get an error because there is more than 1 ExtensionContent node.
If I add the signature node in the root /Invoice it works correctly. I appreciate all possible help Thanks. |
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment · 7 replies
-
Hi @karlos414! For more context, could you provide the original XML and the expected XML after the signature process? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @karlos414 , I hope you are doing well. This is my solution, you must replace the content of Basically I moved the sign to another node. ## Modified code to set signature in the correct position
container_signature = parsed_file.xpath(
"//ext:UBLExtension/ext:ExtensionContent",
namespaces={
"ext": "urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
},
)[1]
container_signature.append(signature)
## end of modified code Here the result XML <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:sts="dian:gov:co:facturaelectronica:Structures-2-1" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" xmlns:xades141="http://uri.etsi.org/01903/v1.4.1#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 http://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionContent>
<sts:DianExtensions>
<sts:InvoiceControl>
<sts:InvoiceAuthorization>18760000001</sts:InvoiceAuthorization>
<sts:AuthorizationPeriod>
<cbc:StartDate>2019-01-19</cbc:StartDate>
<cbc:EndDate>2030-01-19</cbc:EndDate>
</sts:AuthorizationPeriod>
<sts:AuthorizedInvoices>
<sts:Prefix>SETP</sts:Prefix>
<sts:From>990000000</sts:From>
<sts:To>995000000</sts:To>
</sts:AuthorizedInvoices>
</sts:InvoiceControl>
<sts:InvoiceSource>
<cbc:IdentificationCode listAgencyID="6" listAgencyName="United Nations Economic Commission for Europe" listSchemeURI="urn:oasis:names:specification:ubl:codelist:gc:CountryIdentificationCode-2.1">CO</cbc:IdentificationCode>
</sts:InvoiceSource>
<sts:SoftwareProvider>
<sts:ProviderID schemeAgencyID="195" schemeAgencyName="CO, DIAN (Dirección de Impuestos y Aduanas Nacionales)" schemeID="5" schemeName="31">900111222</sts:ProviderID>
<sts:SoftwareID schemeAgencyID="195" schemeAgencyName="CO, DIAN (Dirección de Impuestos y Aduanas Nacionales)">6dfd499b-15eb-4986-a9d0-1244c043e927</sts:SoftwareID>
</sts:SoftwareProvider>
<sts:SoftwareSecurityCode schemeAgencyID="195" schemeAgencyName="CO, DIAN (Dirección de Impuestos y Aduanas Nacionales)">ab4556e45300d2d5ddb514aed6a2231050296dc0164365477466cc330adb3a91578779bcf4b5cfab9e5a49e2c39409b6</sts:SoftwareSecurityCode>
<sts:AuthorizationProvider>
<sts:AuthorizationProviderID schemeAgencyID="195" schemeAgencyName="CO, DIAN (Dirección de Impuestos y Aduanas Nacionales)" schemeID="4" schemeName="31">800197268</sts:AuthorizationProviderID>
</sts:AuthorizationProvider>
<sts:QRCode></sts:QRCode>
</sts:DianExtensions>
</ext:ExtensionContent>
</ext:UBLExtension>
<ext:UBLExtension>
<ext:ExtensionContent>
<ds:Signature Id="Signature-887246a5-da70-4220-a9ad-4a3163e256c9">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></ds:SignatureMethod>
<ds:Reference Id="Reference-fe4a29da-be2a-4294-9184-57f9b431b860" URI="">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>
<ds:DigestValue>FbqKrcxH4priZCzwFU/....=</ds:DigestValue>
</ds:Reference>
<ds:Reference Id="ReferenceKeyInfo" URI="#KeyInfoId-Signature-887246a5-da70-4220-a9ad-4a3163e256c9">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>
<ds:DigestValue>2VKbfYhqb1EQohpo/....=</ds:DigestValue>
</ds:Reference>
<ds:Reference Type="http://uri.etsi.org/01903#SignedProperties" URI="#SignedProperties-Signature-887246a5-da70-4220-a9ad-4a3163e256c9">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>
<ds:DigestValue>6ANiszH+3xG1oG+...=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>.... XQUzNfxQe6iIkmVvdI070tIvZX3sVHmwWGl5qvSu6Eyi6jK57bm4IDdGsAboZAF8 n2pAD+kAJSh5wr6DoUkVq4QgQ52hLtdNAO4cBwERhFmoJrj97dm6eBXW0sRvZzug BfpGZsDeZUJaobpGy9+p6Vvf6bgSGHalwPkDkvEFZGk7HI0CPXs+j6+Lgkp/0S8I 5vrwpf8UHhQWECS+pEYazUd1za6+Oo1ghpQ62yQCj9568pWUy0iuKWaPiSmDP4TH D78PIhtdNt39LYUo6B2U1A==</ds:SignatureValue>
<ds:KeyInfo Id="KeyInfoId-Signature-887246a5-da70-4220-a9ad-4a3163e256c9">
<ds:X509Data>
<ds:X509Certificate>... MAoGA1UECwwDREdUMSYwJAYDVQQDDB1DQSBQRVJTT05BIEpVUklESUNBIC0gU0FO REJPWDAeFw0yMjAyMjUyMTQxMjJaFw0yNjAyMjQyMTQxMjJaMIGGMRkwFwYDVQQF ExBDUEotMy0xMDItNjAxODA1MQswCQYDVQQGEwJDUjEZMBcGA1UECgwQUEVSU09O QSBKVVJJRElDQTEMMAoGA1UECwwDQ1BKMTMwMQYDVQQDDCpJTlRFTElHRU5DSUEg Q09NRVJDSUFMIEdSVVBPIElOQ08gTElNSVRBREEwggEiMA0GCSqGSIb3DQEBAQUA A4IBDwAwggEKAoIBAQCNtxAg/4ZikmdlBvYtlpNfkvIdQoDgSyRc7u4O7wa65Qkd 1GYhz9dLH41SY/EadjJ8E/Cc2oC59WkFAsjMLabUyq51Gw/NicWbfBAZEaUBXcAP fJtW59MO76TPKcUf4NXDLp0zwE72Q4KUFSNiyyECsRYqaS3GIC4MTMgYNLcrA7iJ 0AqvoG5ULbIx6ZJYfPsVT0IGaUK4FAKCAh+jVRSK06Yh2q7gAu4xkuYovD5t8wjC 5z3GNcsytVmnjmfVuxVN6OAj60s5gKF0pQPjWhYYZKEB2zm61MkPidHBnS7v4Rhi 53h/RmPsXOQulumZE0GJgw0jIXVOjm/enyDDOjStAgMBAAGjgcowgccwHwYDVR0j BBgwFoAUrChF+C+dSF8sHwCQ6zLFowdTgOEwHQYDVR0OBBYEFEELbcFLO4eP4nb5 /MSUo0g/yz1QMAsGA1UdDwQEAwIGwDATBgNVHSUEDDAKBggrBgEFBQcDBDBjBggr BgEFBQcBAQRXMFUwUwYIKwYBBQUHMAKGR2h0dHBzOi8vcGtpLmNvbXByb2JhbnRl c2VsZWN0cm9uaWNvcy5nby5jci9zdGFnL2ludGVybWVkaWF0ZS1wai1wZW0uY3J0 MA0GCSqGSIb3DQEBCwUAA4ICAQCkyOHTf2PLJuiFa6Ffkw+/rFdvpkxw6/eJbYcN VM3DlsWV1LfYWC2z95wWJCbiEYa2T/yHRKMeOVJ8yi1cNTKk/6Ek1wZeUdA81e0w R+NdJdl9pJPCTWHXR86arYZqWPNlbzLtYx5RDfJD/F9VA0ObFx3PjAA4lw4A0dkR DqVN1S2Hkm0qG6woTCMYTbkOaZV5dO6LXVItfSdBf6PhZkczUU9UbgbmzAmYGL+m p7RG+mTpCFvzjUBer4dQCHn5qCXWU7IcWRBCa4QGDsW11RPMxjiMCXcgt/vyRzuO MblG50Pj9KmXGuSAukFvu4Si0gBLni2ovHk+lHN7cd0FmjWVKY23hkSF3xAhBoVM L5oaL8K2tcvHoSc7/D9oM0mgygkfHNe4Q99Qr2sQZAjHZvjb3CyVniaz4RwS6alc DgyKtbYSLzUCF04IuVoZfu3BpcnafPw1VLgpwz+MNk0XksgZnrXIVD5Quq/q2LKS vBJh+YB6nZ9KGvWwwqBHZGDAIc9qclM/hOeUPNAtWraguP+4Pb5XOhMfv63g1erf hYkLCO8N33qq++YCNVZHwwsc89xneourW5OymDfwDqf9/FCENiUhQY7g8XFRQItt PNLamWAD0SRuZA6JbxIYSR5TqQShkkafmmKGPuCcafRqC7FsMMEAszMiblBRj0jB hkTzUg==</ds:X509Certificate>
</ds:X509Data>
<ds:KeyValue>
<ds:RSAKeyValue>
<ds:Modulus>...fBPwnNqAufVpBQLIzC2m1MqudRsPzYnFm3wQGRGlAV3AD3ybVufTDu+kzynFH+DV wy6dM8BO9kOClBUjYsshArEWKmktxiAuDEzIGDS3KwO4idAKr6BuVC2yMemSWHz7 FU9CBmlCuBQCggIfo1UUitOmIdqu4ALuMZLmKLw+bfMIwuc9xjXLMrVZp45n1bsV TejgI+tLOYChdKUD41oWGGShAds5utTJD4nRwZ0u7+EYYud4f0Zj7FzkLpbpmRNB iYMNIyF1To5v3p8gwzo0rQ==</ds:Modulus>
<ds:Exponent>...</ds:Exponent>
</ds:RSAKeyValue>
</ds:KeyValue>
</ds:KeyInfo>
<ds:Object>
<xades:QualifyingProperties Id="Qualifying-Properties-Signature-887246a5-da70-4220-a9ad-4a3163e256c9" Target="#Signature-887246a5-da70-4220-a9ad-4a3163e256c9">
<xades:SignedProperties Id="SignedProperties-Signature-887246a5-da70-4220-a9ad-4a3163e256c9">
<xades:SignedSignatureProperties>
<xades:SigningTime>2024-09-23T22:53:51+00:00</xades:SigningTime>
<xades:SigningCertificate>
<xades:Cert>
<xades:CertDigest>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
<ds:DigestValue>.../A9GFJ/zhk=</ds:DigestValue>
</xades:CertDigest>
<xades:IssuerSerial>
<ds:X509IssuerName>...</ds:X509IssuerName>
<ds:X509SerialNumber>...</ds:X509SerialNumber>
</xades:IssuerSerial>
</xades:Cert>
</xades:SigningCertificate>
<xades:SignaturePolicyIdentifier>
<xades:SignaturePolicyImplied></xades:SignaturePolicyImplied>
</xades:SignaturePolicyIdentifier>
<xades:SignatureProductionPlace></xades:SignatureProductionPlace>
</xades:SignedSignatureProperties>
</xades:SignedProperties>
</xades:QualifyingProperties>
</ds:Object>
</ds:Signature>
</ext:ExtensionContent>
</ext:UBLExtension>
</ext:UBLExtensions>
<cbc:UBLVersionID>UBL 2.1</cbc:UBLVersionID>
<cbc:CustomizationID>10</cbc:CustomizationID>
<cbc:ProfileID>DIAN 2.1</cbc:ProfileID>
<cbc:ProfileExecutionID>2</cbc:ProfileExecutionID>
<cbc:ID>SETP990000000</cbc:ID>
<cbc:UUID schemeID="2" schemeName="CUFE-SHA384">1c9b786221dc8d19fed7e704749ac2fd9ab7395befaf2473c5717b0c4008046bcf045218a22eae6b258487c45b65691c</cbc:UUID>
<cbc:IssueDate>2024-08-28</cbc:IssueDate>
<cbc:IssueTime>20:00:50-05:00</cbc:IssueTime>
<cbc:InvoiceTypeCode>01</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode listAgencyID="6" listAgencyName="United Nations Economic Commission for Europe" listID="ISO 4217 Alpha">CO</cbc:DocumentCurrencyCode>
<cbc:LineCountNumeric>3</cbc:LineCountNumeric>
<cac:InvoicePeriod>
<cbc:StartDate>2024-08-01</cbc:StartDate>
<cbc:EndDate>2024-08-31</cbc:EndDate>
</cac:InvoicePeriod>
<cac:AccountingSupplierParty>
<cbc:AdditionalAccountID>1</cbc:AdditionalAccountID>
<cac:Party>
<cac:PartyName>
<cbc:Name>COMPANY S.A.S.</cbc:Name>
</cac:PartyName>
<cac:PhysicalLocation>
<cac:Address>
<cbc:ID>05001</cbc:ID>
<cbc:CityName>MEDELLÍN</cbc:CityName>
<cbc:PostalZone>050001</cbc:PostalZone>
<cbc:CountrySubentity>ANTIOQUIA</cbc:CountrySubentity>
<cbc:CountrySubentityCode>05</cbc:CountrySubentityCode>
<cac:AddressLine>
<cbc:Line>CL 5 #66-77</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>CO</cbc:IdentificationCode>
<cbc:Name languageID="es">Colombia</cbc:Name>
</cac:Country>
</cac:Address>
</cac:PhysicalLocation>
<cac:PartyTaxScheme>
<cbc:RegistrationName>COMPANY S.A.S.</cbc:RegistrationName>
<cbc:CompanyID schemeAgencyID="195" schemeAgencyName="CO DIAN (Dirección de Impuestos y Aduanas Nacionales)" schemeID="5" schemeName="31">900111222</cbc:CompanyID>
<cbc:TaxLevelCode>R-99-PN</cbc:TaxLevelCode>
<cac:RegistrationAddress>
<cbc:ID>05001</cbc:ID>
<cbc:CityName>MEDELLÍN</cbc:CityName>
<cbc:CountrySubentity>ANTIOQUIA</cbc:CountrySubentity>
<cbc:CountrySubentityCode>05</cbc:CountrySubentityCode>
<cac:AddressLine>
<cbc:Line>CL 5 #66-77</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>CO</cbc:IdentificationCode>
<cbc:Name languageID="es">Colombia</cbc:Name>
</cac:Country>
</cac:RegistrationAddress>
<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>COMPANY S.A.S.</cbc:RegistrationName>
<cbc:CompanyID schemeAgencyID="195" schemeAgencyName="CO DIAN (Dirección de Impuestos y Aduanas Nacionales)" schemeID="5" schemeName="31">900111222</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cbc:AdditionalAccountID>2</cbc:AdditionalAccountID>
<cac:Party>
<cac:PartyIdentification>
<cbc:ID schemeID="2" schemeName="13">123456789</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>CUSTOMER</cbc:Name>
</cac:PartyName>
<cac:PhysicalLocation>
<cac:Address>
<cbc:ID>05001</cbc:ID>
<cbc:CityName>MEDELLÍN</cbc:CityName>
<cbc:PostalZone>050001</cbc:PostalZone>
<cbc:CountrySubentity>ANTIOQUIA</cbc:CountrySubentity>
<cbc:CountrySubentityCode>05</cbc:CountrySubentityCode>
<cac:AddressLine>
<cbc:Line>CR 1 #22-33</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>CO</cbc:IdentificationCode>
<cbc:Name languageID="es">Colombia</cbc:Name>
</cac:Country>
</cac:Address>
</cac:PhysicalLocation>
<cac:PartyTaxScheme>
<cbc:RegistrationName>CUSTOMER</cbc:RegistrationName>
<cbc:CompanyID schemeAgencyID="195" schemeAgencyName="CO DIAN (Dirección de Impuestos y Aduanas Nacionales)" schemeID="2" schemeName="13">123456789</cbc:CompanyID>
<cbc:TaxLevelCode>R-99-PN</cbc:TaxLevelCode>
<cac:RegistrationAddress>
<cbc:ID>05001</cbc:ID>
<cbc:CityName>MEDELLÍN</cbc:CityName>
<cbc:CountrySubentity>ANTIOQUIA</cbc:CountrySubentity>
<cbc:CountrySubentityCode>05</cbc:CountrySubentityCode>
<cac:AddressLine>
<cbc:Line>CR 1 #22-33</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>CO</cbc:IdentificationCode>
<cbc:Name languageID="es">Colombia</cbc:Name>
</cac:Country>
</cac:RegistrationAddress>
<cac:TaxScheme>
<cbc:ID>ZZ</cbc:ID>
<cbc:Name>Otros tributos</cbc:Name>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>CUSTOMER</cbc:RegistrationName>
<cbc:CompanyID schemeAgencyID="195" schemeAgencyName="CO DIAN (Dirección de Impuestos y Aduanas Nacionales)" schemeID="2" schemeName="13">123456789</cbc:CompanyID>
</cac:PartyLegalEntity>
<cac:Contact>
<cbc:Name></cbc:Name>
<cbc:Telephone>3212223344</cbc:Telephone>
<cbc:ElectronicMail>[email protected]</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:PaymentMeans>
<cbc:ID>1</cbc:ID>
<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>
<cbc:PaymentID>FESP-1</cbc:PaymentID>
</cac:PaymentMeans>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">24000.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">23800.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">0.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>0.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">100000.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">5000.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>5.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">100000.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">19000.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>19.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="COP">223800.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="COP">223800.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="COP">247800.00</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID="COP">0.00</cbc:AllowanceTotalAmount>
<cbc:ChargeTotalAmount currencyID="COP">0.00</cbc:ChargeTotalAmount>
<cbc:PrepaidAmount currencyID="COP">0.00</cbc:PrepaidAmount>
<cbc:PayableAmount currencyID="COP">247800.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="WSD">1.00</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="COP">100000.00</cbc:LineExtensionAmount>
<cbc:FreeOfChargeIndicator>false</cbc:FreeOfChargeIndicator>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">19000.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">100000.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">19000.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>19.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:Item>
<cbc:Description>ARTICULO 01</cbc:Description>
<cac:SellersItemIdentification>
<cbc:ID>ART01</cbc:ID>
</cac:SellersItemIdentification>
<cac:StandardItemIdentification>
<cbc:ID schemeID="999" schemeName="EAN13">300000121</cbc:ID>
</cac:StandardItemIdentification>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="COP">119000.00</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="WSD">1.00</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
<cbc:ID>2</cbc:ID>
<cbc:InvoicedQuantity unitCode="WSD">1.00</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="COP">100000.00</cbc:LineExtensionAmount>
<cbc:FreeOfChargeIndicator>false</cbc:FreeOfChargeIndicator>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">5000.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">100000.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">5000.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>5.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:Item>
<cbc:Description>ARTICULO 02</cbc:Description>
<cac:SellersItemIdentification>
<cbc:ID>ART02</cbc:ID>
</cac:SellersItemIdentification>
<cac:StandardItemIdentification>
<cbc:ID schemeID="999" schemeName="EAN13">300000131</cbc:ID>
</cac:StandardItemIdentification>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="COP">105000.00</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="WSD">1.00</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
<cbc:ID>3</cbc:ID>
<cbc:InvoicedQuantity unitCode="WSD">1.00</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="COP">23800.00</cbc:LineExtensionAmount>
<cbc:FreeOfChargeIndicator>false</cbc:FreeOfChargeIndicator>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="COP">0.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="COP">23800.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="COP">0.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>0.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>01</cbc:ID>
<cbc:Name>IVA</cbc:Name>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:Item>
<cbc:Description>ARTICULO 03</cbc:Description>
<cac:SellersItemIdentification>
<cbc:ID>ART03</cbc:ID>
</cac:SellersItemIdentification>
<cac:StandardItemIdentification>
<cbc:ID schemeID="999" schemeName="EAN13">300000141</cbc:ID>
</cac:StandardItemIdentification>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="COP">23800.00</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="WSD">1.00</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
</Invoice>
|
Beta Was this translation helpful? Give feedback.
All reactions
-
@karlos414 you can help me with a star on GitHub! |
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you very much for the help, I replaced the file and I still have the same error
The problem is in the Transform
If I remove this Transform the xml is signed correctly, but I really need the TransformEnveloped in my signature. This is the base directory, I have only added the UTF-8 encoding when read the xml
the rest is exactly the same code as the repository. Of course I will give you the star for all the help. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Sorry my fault, I uploaded the wrong file. Actually, the signature needs to be in the root node for signing the xml, after sign you can move into the correct tag. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Izcar muchas gracias, al ir a tu perfil para darte la estrella vi que eres de Costa Rica, mejor te hablo en español. Efectivamente era el archivo incorrecto, con el ultimo que enviaste el documento se firma sin problema. Solo hay un inconveniente adicional pero es por el pretty_print lo omití y funciona bien. Si validas la firma en esta web por ejemplo indica que el digest no está correctamente calculado, pero en si es por el pretty_print aplicado después de firmar el xml. https://tools.chilkat.io/xmlDsigVerify.cshtml Muy agradecido. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Ok ok, ahí luego le hago el fix a ese pretty print! dale amigo, pura vida! y con gusto en ayudar ! |
Beta Was this translation helpful? Give feedback.
Sorry my fault, I uploaded the wrong file.
Here the correct file.
signer-checked.zip
Actually, the signature needs to be in the root node for signing the xml, after sign you can move into the correct tag.