Skip to content

[29.0] bug 649305 - Add Report Address Source functionality to Company Information - #11252

Open
David Holuša (DavidHolusa) wants to merge 3 commits into
releases/29.0from
bugs/649305-290-FixCompanyAddress
Open

[29.0] bug 649305 - Add Report Address Source functionality to Company Information#11252
David Holuša (DavidHolusa) wants to merge 3 commits into
releases/29.0from
bugs/649305-290-FixCompanyAddress

Conversation

@DavidHolusa

@DavidHolusa David Holuša (DavidHolusa) commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What & why

Adds a new Report Address Source option to the Company Information table and page for the CZ Core Localization Pack. This allows users to choose whether the address printed on CZ sales and purchase document reports is taken from Company Information or from the Responsibility Center.

Previously, when a Responsibility Center was set on a document, its address was always used in printed reports. However, CZ legislation requires the billing address to be stated, and customers use Responsibility Centers in various ways — making it not always appropriate to override the company address. This change introduces a configurable setting so each company can control the behavior.

Changes:

  • New enum Report Address Source CZL with options: Company Information, Responsibility Center
  • New field Report Address Source CZL on the Company Information table (79)
  • New field on the Company Information page (1), Communication FastTab (Importance = Additional)
  • Updated CZ report address formatting logic to respect the new setting

Linked work

Fixes AB#649305

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Set Report Address Source to "Company Information" → printed sales invoice shows company address regardless of Responsibility Center on the document.
  • Set Report Address Source to "Responsibility Center" → printed sales invoice shows Responsibility Center address when one is assigned to the document.
  • Verified default value preserves existing behavior (Responsibility Center) for backward compatibility.

Risk & compatibility

  • New enum and field addition — no breaking changes to existing functionality.
  • Default value should be set to Responsibility Center to maintain backward compatibility with existing behavior after the previous redesign.
  • No upgrade code needed as the default enum value covers existing installations.

@DavidHolusa
David Holuša (DavidHolusa) requested a review from a team September 9, 2026 08:41
@DavidHolusa
David Holuša (DavidHolusa) requested a review from a team as a code owner September 9, 2026 08:41
@github-actions github-actions Bot added the Team: Integrations GitHub request for Integrations area label Sep 9, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Sep 9, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

This adds a company-level Report Address Source CZL setting and a Format Address subscriber so CZ document reports can choose the company address instead of the responsibility center address. The hook is the right place because the CZ sales, purchase, and service reports already call GetCompanyAddr, and the BaseApp publisher fires before the responsibility-center fallback. The branch for Company Information is correct when selected, but the enum order makes that branch the default, which does not preserve the expected behavior.

Problem-solution fit

Fit: Partial

The new setting and central subscriber match the reported need to choose the address source for CZ document reports. The solution is incomplete because existing companies will default to Company Information, not to the previous Responsibility Center behavior.

Suggestions

S1 (🔴 High): Default reverses existing address behavior
The enum field will default to Company Information because it is value 0. That changes existing companies from the current Responsibility Center behavior after upgrade, so reports can print the wrong address unless the user changes the setting. Make Responsibility Center the zero/default value, or add safe initialization or upgrade handling.

S2 (🟠 Moderate): Default behavior needs regression coverage
No test file changed for this central subscriber. Add coverage that the default keeps Responsibility Center, and that Company Information is used only when selected. This would catch the current default-value regression.

Risk assessment and necessity

Risk: The subscriber changes the central Format Address path used by CZ sales, purchase, and service reports. The BaseApp publisher exists and fires before the standard responsibility-center logic, so the new handler controls the address source when it sets IsHandled. With the current enum order, existing companies can get the company address instead of the responsibility-center address on reports after upgrade.

Necessity: The change is needed because a company may need its billing address on CZ document reports even when documents use responsibility centers. The scope is reasonable and centralized, but it must keep the previous default to avoid unexpected report output.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11252 round=1 by=alexei-dobriansky at=2026-09-09T22:19:15Z lastSha=a3a0ddd06b5a76f31e08d5f4ada870d7ffc51cf3 reviewKey=1deab48ddbb0748eef9eea1c4e9343ba649ecdc8f4b1e1c3fa35b254caa9d394 suggestions=S1@e163a4f8,S2@3395056f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants