-
Notifications
You must be signed in to change notification settings - Fork 692
Description
Describe the issue
When the Buyer Reference setting on the E-Document Service is set to "Customer Reference" (E-Invoice Routing No. from the Customer card), and a Sales Invoice has a Bill-to Customer that differs from the Sell-to Customer, the xRechnung / ZUGFeRD XML export writes the Buyer Reference (BT-10) of the Sell-to Customer into cbc:BuyerReference. The correct behavior is to use the Buyer Reference of the Bill-to Customer, since the Bill-to Customer is the actual invoice recipient and the Buyer Reference (Leitweg-ID) is used to route the e-invoice to the correct receiving system.
Expected behavior
When the Buyer Reference is sourced from the Customer card ("Customer Reference" setting) and the Sales Invoice has a Bill-to Customer that differs from the Sell-to Customer, the cbc:BuyerReference (BT-10) in the exported XML should contain the E-Invoice Routing No. of the Bill-to Customer, not the Sell-to Customer.
Steps to reproduce
- Use Business Central for Germany.
- Enable E-Document Service for XRechnung.
- In setup:
- Set Buyer Reference Mandatory = Yes
- Set Buyer Reference = Customer Reference
- Configure a Workflow and a Document Sending Profile for XRechnung (per [docs]). Mark the sending profile as default.
- Create two Customers:
- Customer A with E-Invoice Routing No. =
11-AAA-11 - Customer B with E-Invoice Routing No. =
22-BBB-22
- Customer A with E-Invoice Routing No. =
- Create a new Sales Invoice:
- Sell-to Customer = Customer A
- Bill-to Customer = Customer B
- Add a Sales Line with any value.
- Post the Sales Invoice.
- Open the Posted Sales Invoice → Related → E-Document → Open E-Document.
- From E-Document Logs, export the XML file.
- Inspect
<cbc:BuyerReference>in the XML.- Actual result:
<cbc:BuyerReference>11-AAA-11</cbc:BuyerReference>(Sell-to Customer's E-Invoice Routing No.) - Expected result:
<cbc:BuyerReference>22-BBB-22</cbc:BuyerReference>(Bill-to Customer's E-Invoice Routing No.)
- Actual result:
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug