We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
we are currently working with the latest Version 2.16.3 and try to add an attachment to an existing XRechnung (3.0.2) or Factur-X Extended (1.0.7).
If we do so, the Mustang Library adds unexpected XML Tags inside of the ApplicableHeaderTradeSettlement Tag:
<ram:InvoiceReferencedDocument> <ram:IssuerAssignedID/> </ram:InvoiceReferencedDocument>
This leads to validation Errors with the Mustang Validator, because it violates the BR-55:
Are we doing something wrong?
FYI: We are working with base64, because of a legacy application, I just stripped the code from the current application.
No additional InvoiceReferencedDocument, because we attach some additional information not an invoice correction e.g.
import java.nio.charset.StandardCharsets; import java.text.ParseException; import org.mustangproject.FileAttachment; import org.mustangproject.Invoice; import org.mustangproject.ZUGFeRD.ZUGFeRD2PullProvider; import org.mustangproject.ZUGFeRD.ZUGFeRDInvoiceImporter; import org.mustangproject.ZUGFeRD.Profiles; import java.util.Base64; import javax.xml.xpath.XPathExpressionException; public class MustangApiApplication { public static void main(String[] args) throws XPathExpressionException, ParseException { String base64Xml = ""; // USE AN OFFICIAL FACTUR-X SAMPLE AS BASE64 byte[] xml = Base64.getDecoder().decode(base64Xml); String profile = "Extended"; // Attach additional files to XML ZUGFeRDInvoiceImporter importer = new ZUGFeRDInvoiceImporter(); importer.fromXML(new String(xml, StandardCharsets.UTF_8)); Invoice invoice = importer.extractInvoice(); FileAttachment attachment = new FileAttachment("attachment.txt", "text/plain", "Attachment", Base64.getDecoder().decode("RGFzIGlzdCBlaW4gVGVzdA==")); attachment.setDescription("Attachment"); invoice.embedFileInXML(attachment); ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider(); zf2p.setProfile(Profiles.getByName(profile)); zf2p.generateXML(invoice); byte[] xmlWithAttachments = zf2p.getXML(); // Return result String base64XmlWithAttachments = new String(Base64.getEncoder().encode(xmlWithAttachments), StandardCharsets.UTF_8); System.out.println(base64XmlWithAttachments); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Issue:
we are currently working with the latest Version 2.16.3 and try to add an attachment to an existing XRechnung (3.0.2) or Factur-X Extended (1.0.7).
If we do so, the Mustang Library adds unexpected XML Tags inside of the ApplicableHeaderTradeSettlement Tag:
This leads to validation Errors with the Mustang Validator, because it violates the BR-55:
Are we doing something wrong?
FYI: We are working with base64, because of a legacy application, I just stripped the code from the current application.
Expected behaviour:
No additional InvoiceReferencedDocument, because we attach some additional information not an invoice correction e.g.
Steps/Code to reproduce:
The text was updated successfully, but these errors were encountered: