-
Notifications
You must be signed in to change notification settings - Fork 688
Labels
FinanceGitHub request for Finance areaGitHub request for Finance areaapprovedThe issue is approvedThe issue is approved
Description
Describe the issue
When generating a XRechnung electronic document with an embedded PDF attachment for a posted sales invoice, the embedded PDF is always the one belonging to the first posted sales invoice in the database (in the standard demo database this is invoice 103001), regardless of which invoice is being processed.
For example, when processing posted sales invoice 103300, the generated XML contains an <cac:AdditionalDocumentReference> with:
<cbc:ID>Invoice_103001.pdf</cbc:ID>- Filename "Invoice_103001.pdf"
- Embedded binary content of invoice 103001
This behavior has been introduced with the issue #29414.
XML snippet example (partial):
<cac:AdditionalDocumentReference>
<cbc:ID>Invoice_103001.pdf</cbc:ID>
<cac:Attachment>
<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="Invoice_103001.pdf">
JVBERi0xLjgNCi...
</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>Expected behavior
The embedded PDF attachment should always correspond to the current posted sales invoice being processed:
- Filename should be
Invoice_<CurrentInvoiceNo>.pdf(e.g.,Invoice_103300.pdf) - The embedded binary content should be the PDF report generated for the current invoice
Steps to reproduce
- Open E-Document Service and select XRechnung.
- Set “Embed PDF in export” = Yes.
- Select a customer and assign a Sending Profile using the E-Documents workflow (DE: E-BELEGE).
- Make sure that Workflow uses XRechnung and is enabled.
- Create and post a Sales Invoice, open the E-Document, and export the XML.
- Current result: The XML does contain
cbc:EmbeddedDocumentBinaryObjectholding the PDF with the nameInvoice_103001.pdf. - Expected: The XML should contain
cbc:EmbeddedDocumentBinaryObjectholding the PDF with the nameInvoice_103300.pdf.
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FinanceGitHub request for Finance areaGitHub request for Finance areaapprovedThe issue is approvedThe issue is approved