From a97a8ee337a5132da76ee8ade3965e090ed69d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Holu=C5=A1a?= Date: Mon, 7 Sep 2026 14:12:32 +0200 Subject: [PATCH 1/3] Add Report Address Source functionality to Company Information --- .../FormatAddressHandlerCZL.Codeunit.al | 15 +++++++++++++- .../Src/Enums/ReportAddressSourceCZL.Enum.al | 20 +++++++++++++++++++ .../CompanyInformationCZL.PageExt.al | 8 ++++++++ .../CompanyInformationCZL.TableExt.al | 7 +++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al index bb60474fcef..9f1f761306a 100644 --- a/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al @@ -1,13 +1,26 @@ namespace Microsoft.Foundation.Address; +using Microsoft.Foundation.Company; + codeunit 31144 "Format Address Handler CZL" { - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Format Address", 'OnAfterGeneratePostCodeCity', '', false, false)] + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Format Address", OnAfterGeneratePostCodeCity, '', false, false)] local procedure ClearCountyOnAfterGeneratePostCodeCity(var Country: Record "Country/Region"; var CountyText: Text[50]) begin ClearCounty(Country, CountyText); end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Format Address", OnBeforeGetCompanyAddr, '', false, false)] + local procedure HandleOnBeforeGetCompanyAddr(var CompanyInfo: Record "Company Information"; var CompanyAddr: array[8] of Text[100]; var IsHandled: Boolean) + var + FormatAddress: Codeunit "Format Address"; + begin + if CompanyInfo."Report Address Source" = CompanyInfo."Report Address Source"::"Company Information" then begin + FormatAddress.Company(CompanyAddr, CompanyInfo); + IsHandled := true; + end; + end; + local procedure ClearCounty(var Country: Record "Country/Region"; var CountyText: Text[50]) var IsHandled: Boolean; diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al new file mode 100644 index 00000000000..57373fa2a49 --- /dev/null +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al @@ -0,0 +1,20 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.Foundation.Address; + +enum 11704 "Report Address Source CZL" +{ + Extensible = true; + + value(0; "Company Information") + { + Caption = 'Company Information'; + } + value(1; "Responsibility Center") + { + Caption = 'Responsibility Center'; + } + +} \ No newline at end of file diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al index 24a565f4699..3a2b78ed7f1 100644 --- a/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al @@ -61,6 +61,14 @@ pageextension 11700 "Company Information CZL" extends "Company Information" { Visible = true; } + addlast(Communication) + { + field("Report Address Source"; Rec."Report Address Source") + { + ApplicationArea = Basic, Suite; + Importance = Additional; + } + } } actions { diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al index 60ebd0aca65..ba84b9587db 100644 --- a/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al @@ -5,6 +5,7 @@ namespace Microsoft.Foundation.Company; using Microsoft.Bank.BankAccount; +using Microsoft.Foundation.Address; tableextension 11747 "Company Information CZL" extends "Company Information" { @@ -56,6 +57,12 @@ tableextension 11747 "Company Information CZL" extends "Company Information" Caption = 'Tax Registration No.'; DataClassification = CustomerContent; } + field(11785; "Report Address Source"; Enum "Report Address Source CZL") + { + Caption = 'Report Address Source'; + DataClassification = CustomerContent; + ToolTip = 'Specifies whether the address used in reports, such as printed sales and purchase documents, is taken from Company Information or from the Responsibility Center.'; + } } procedure UpdateBankInfoCZL(BankAccountCode: Code[20]; BankAccountNo: Text[30]; BankBranchNo: Text[20]; BankName: Text[100]; TransitNo: Text[20]; IBANCode: Code[50]; SWIFTCode: Code[20]) From 25ce560b068c8f02574015b03a3329b94f0b1554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Holu=C5=A1a?= Date: Mon, 7 Sep 2026 14:46:54 +0200 Subject: [PATCH 2/3] fix --- .../app/Src/Enums/ReportAddressSourceCZL.Enum.al | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al index 57373fa2a49..b457663e992 100644 --- a/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al @@ -16,5 +16,4 @@ enum 11704 "Report Address Source CZL" { Caption = 'Responsibility Center'; } - } \ No newline at end of file From ed6053c3a8991177d2d25d6601e2b51f73c3dd95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Holu=C5=A1a?= Date: Wed, 9 Sep 2026 12:24:04 +0200 Subject: [PATCH 3/3] add missing CZL suffix --- .../app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al | 2 +- .../app/Src/PageExtensions/CompanyInformationCZL.PageExt.al | 2 +- .../app/Src/TableExtensions/CompanyInformationCZL.TableExt.al | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al index 9f1f761306a..6e369396238 100644 --- a/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/FormatAddressHandlerCZL.Codeunit.al @@ -15,7 +15,7 @@ codeunit 31144 "Format Address Handler CZL" var FormatAddress: Codeunit "Format Address"; begin - if CompanyInfo."Report Address Source" = CompanyInfo."Report Address Source"::"Company Information" then begin + if CompanyInfo."Report Address Source CZL" = CompanyInfo."Report Address Source CZL"::"Company Information" then begin FormatAddress.Company(CompanyAddr, CompanyInfo); IsHandled := true; end; diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al index 3a2b78ed7f1..e8b93440563 100644 --- a/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CompanyInformationCZL.PageExt.al @@ -63,7 +63,7 @@ pageextension 11700 "Company Information CZL" extends "Company Information" } addlast(Communication) { - field("Report Address Source"; Rec."Report Address Source") + field("Report Address Source CZL"; Rec."Report Address Source CZL") { ApplicationArea = Basic, Suite; Importance = Additional; diff --git a/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al b/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al index ba84b9587db..33abbf508a1 100644 --- a/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CompanyInformationCZL.TableExt.al @@ -57,7 +57,7 @@ tableextension 11747 "Company Information CZL" extends "Company Information" Caption = 'Tax Registration No.'; DataClassification = CustomerContent; } - field(11785; "Report Address Source"; Enum "Report Address Source CZL") + field(11785; "Report Address Source CZL"; Enum "Report Address Source CZL") { Caption = 'Report Address Source'; DataClassification = CustomerContent;