Skip to content

[29.x] bug 649305 - Add Report Address Source functionality to Company Information - #11251

Merged
David Holuša (DavidHolusa) merged 3 commits into
releases/29.xfrom
bugs/649305-29x-FixCompanyAddress
Sep 11, 2026
Merged

[29.x] bug 649305 - Add Report Address Source functionality to Company Information#11251
David Holuša (DavidHolusa) merged 3 commits into
releases/29.xfrom
bugs/649305-29x-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:40
@DavidHolusa
David Holuša (DavidHolusa) requested a review from a team as a code owner September 9, 2026 08:40
@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.1 milestone Sep 9, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

This change adds a Company Information setting for CZ report addresses and uses a Format Address subscriber to choose Company Information when that setting is selected. The subscriber is placed before the existing Responsibility Center fallback, so the new option can work. The problem is the new enum makes Company Information the default, which changes existing behavior instead of preserving it.

Problem-solution fit

Fit: Partial

The change adds the requested setting and connects it to the shared report address flow. It does not fully fit because the default value should keep using Responsibility Center until a company chooses Company Information.

Suggestions

S1 (🔴 High): Default report address source flips existing behavior
Because this enum field has no InitValue, value 0 becomes the default for Company Information records. That makes Company Information the default source and bypasses Responsibility Center when a document has one. Make Responsibility Center the default, either by assigning it value 0 or by setting and migrating the field default safely.

Risk assessment and necessity

Risk: This affects CZ sales, purchase, and service reports that call Format Address.GetCompanyAddr. The W1 publisher was verified: it fires before the Responsibility Center branch and exits when IsHandled is true, so the new subscriber can change the address used by all those reports. With the current enum ordering, existing companies can silently print Company Information instead of Responsibility Center.

Necessity: The setting is needed because some companies must print the company billing address even when a document has a Responsibility Center. The scope is suitable, but the default must preserve the existing Responsibility Center behavior.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11251 round=1 by=alexei-dobriansky at=2026-09-09T22:17:22.3165338Z lastSha=ed6053c3a8991177d2d25d6601e2b51f73c3dd95 reviewKey=da32b59e7fd9151e78c3a624db1585132dfd22b86284f04edb64e762297c58b9 suggestions=S1@e163a4f8

@DavidHolusa
David Holuša (DavidHolusa) merged commit e1b478c into releases/29.x Sep 11, 2026
16 checks passed
@DavidHolusa
David Holuša (DavidHolusa) deleted the bugs/649305-29x-FixCompanyAddress branch September 11, 2026 08:21
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.

4 participants