ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Bug]: XRechnung – Posting purchase document unrelated to E-Documents triggers error about missing Customer

Open miljance opened this issue 1 year ago • 4 comments

Describe the issue

When posting or releasing a purchase document in Business Central (Germany localization) with the E-Document Service for XRechnung enabled, the system incorrectly validates the Buyer Reference setting.

Even though the Buyer Reference field is only relevant for sales documents (Sales Header, Sales Invoice Header, Sales Cr. Memo Header), the system attempts to fetch a Customer record when processing a purchase document.

This results in an error message:

The Customer does not exist. Identification fields and values: No.='V00010'

This behavior is incorrect because:

  • Buyer Reference should not be validated on the purchase side.
  • The check should only apply to sales documents selected for export via the E-Document Service.
  • Current logic ignores the E-Document Service setup and applies validation globally.

Expected behavior

  • Posting or releasing purchase documents should not trigger validation of the Buyer Reference field as the field is non-existent in purchase.
  • The system should only enforce Buyer Reference checks on sales documents (Sales, Sales Invoices, Sales Credit Memos) that are explicitly selected for export via the E-Document Service.

Steps to reproduce

  1. Use Business Central for Germany.
  2. Enable E-Document Service for XRechnung.
  3. In setup:
    • Set Buyer Reference Mandatory = Yes
    • Set Buyer Reference = Customer Reference
  4. Configure a Workflow for XRechnung (per docs).
  5. Configure a Document Sending Profile for XRechnung (per docs).
  6. Mark this sending profile as the default profile.
  7. Create a new Vendor.
  8. Create a Purchase Order for this vendor.
  9. Attempt to release the purchase order.
  10. Observe the error:

The Customer does not exist. Identification fields and values: No.='V00010'

Additional context

Fixes AB#609592

No response

I will provide a fix for a bug

  • [x] I will provide a fix for a bug

miljance avatar Sep 22 '25 15:09 miljance

@djukicmilica FYI

AleksanderGladkov avatar Oct 01 '25 15:10 AleksanderGladkov

This issue has been approved for contribution ✅ Thanks for contributing.

github-actions[bot] avatar Oct 02 '25 06:10 github-actions[bot]

@JesperSchulz Can the Issue be moved to BCApps as the E-Docs module has been moved to BCApps?

miljance avatar Oct 03 '25 14:10 miljance

@JesperSchulz sorry for pinging once again but the XRechnung seems to be present in ALAppExtensions in DE folder as this is a germany localization. Can you move it back to ALAppExtensions?

miljance avatar Oct 06 '25 08:10 miljance