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..6e369396238 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 CZL" = CompanyInfo."Report Address Source CZL"::"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..b457663e992 --- /dev/null +++ b/src/Apps/CZ/CoreLocalizationPack/app/Src/Enums/ReportAddressSourceCZL.Enum.al @@ -0,0 +1,19 @@ +// ------------------------------------------------------------------------------------------------ +// 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..e8b93440563 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 CZL"; Rec."Report Address Source CZL") + { + 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..33abbf508a1 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 CZL"; 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])