From eaf768e519e87beac083271d8a2ca83f74cb689b Mon Sep 17 00:00:00 2001 From: Jesper Schulz-Wedde Date: Thu, 5 Mar 2026 15:15:57 +0100 Subject: [PATCH] Syncing with version 29.0.47162.0 --- .github/AL-Go-Settings.json | 2 +- .../Src/Pages/PurchAdvanceLettersCZZ.Page.al | 11 - .../Codeunits/AssemblyHandlerCZA.Codeunit.al | 14 - .../DataClassEvalHandlerCZA.Codeunit.al | 23 - .../Src/Codeunits/GLEntryEditCZA.Codeunit.al | 31 - .../GLEntryPostApplicationCZA.Codeunit.al | 11 - .../ProductionOrderHandlerCZA.Codeunit.al | 14 - .../AssemblyOrderCZA.PageExt.al | 12 - .../AssemblyOrderSubformCZA.PageExt.al | 12 - .../AssemblySetupCZA.PageExt.al | 12 - .../ManufacturingSetupCZA.PageExt.al | 12 - .../app/Src/Pages/ApplyGLEntriesCZA.Page.al | 656 ------- .../CZAdvancePackObjectsCZA.PermissionSet.al | 20 - .../AssemblyHeaderCZA.TableExt.al | 5 - .../AssemblyLineCZA.TableExt.al | 5 - .../AssemblySetupCZA.TableExt.al | 5 - .../ManufacturingSetupCZA.TableExt.al | 5 - .../Src/Pages/CashDocumentSubformCZP.Page.al | 10 - .../Pages/PostedCashDocumentListCZP.Page.al | 23 - .../Common/CommonModuleCZ.Codeunit.al | 18 - .../DataClassEvalHandlerCZL.Codeunit.al | 5 - .../VATAttributeCodeMgtCZL.Codeunit.al | 11 - .../VATStmtTemplateHandlerCZL.Codeunit.al | 15 - .../Src/Enums/UserSetupLineTypeCZL.Enum.al | 18 - .../PostedDirectTransferCZL.PageExt.al | 41 - .../PurchaseCreditMemoCZL.PageExt.al | 13 - .../PurchaseInvoiceCZL.PageExt.al | 13 - .../PurchaseOrderCZL.PageExt.al | 13 - .../PurchaseQuoteCZL.PageExt.al | 13 - .../PurchaseReturnOrderCZL.PageExt.al | 13 - .../SalesCreditMemoCZL.PageExt.al | 13 - .../PageExtensions/SalesInvoiceCZL.PageExt.al | 13 - .../PageExtensions/SalesOrderCZL.PageExt.al | 13 - .../PageExtensions/SalesQuoteCZL.PageExt.al | 13 - .../SalesReturnOrderCZL.PageExt.al | 13 - .../ServiceCreditMemoCZL.PageExt.al | 13 - .../ServiceInvoiceCZL.PageExt.al | 13 - .../PageExtensions/ServiceOrderCZL.PageExt.al | 13 - .../PageExtensions/ServiceQuoteCZL.PageExt.al | 13 - .../TransferOrderCZL.PageExt.al | 33 - .../VATStatementTemplatesCZL.PageExt.al | 12 - .../CZCorePackObjectsCZL.PermissionSet.al | 5 - .../CountryRegionCZL.TableExt.al | 44 - .../DirectTransHeaderCZL.TableExt.al | 48 - .../PurchaseHeaderCZL.TableExt.al | 63 - .../SalesHeaderCZL.TableExt.al | 58 - .../ServiceHeaderCZL.TableExt.al | 27 - .../TransferHeaderCZL.TableExt.al | 65 - .../VATStatementTemplateCZL.TableExt.al | 15 - .../test/Src/LibraryTaxCZL.Codeunit.al | 9 - .../DataClassEvalHandlerCZ.Codeunit.al | 6 - .../IntrastatReportManagementCZ.Codeunit.al | 56 - .../IntrastatReportSetupCZ.PageExt.al | 46 - .../IntrastatReportSetupCZ.TableExt.al | 20 - .../PurchaseHeaderCZ.TableExt.al | 20 - .../TableExtensions/SalesHeaderCZ.TableExt.al | 20 - .../TransferHeaderCZ.TableExt.al | 21 - .../Install/ElsterDataMigration.Codeunit.al | 15 - .../app/AppResources/DE_DataExchDefMap.xml | 25 +- .../src/IntrastatReportDEUpgrade.Codeunit.al | 27 + .../IntrastatReportManagementDE.Codeunit.al | 8 +- .../app/src/Init/OIOUBLInitialize.Codeunit.al | 9 - .../upgrade/OIOUBLMigrateToExtV2.Codeunit.al | 16 - .../src/Reports/SuggestVendPayments.Report.al | 2 +- .../ERMPaymentManagementII.Codeunit.al | 35 + .../app/src/page/FixedAssetShifts.Page.al | 18 - .../app/src/table/FixedAssetShift.Table.al | 5 - .../src/Page/SubcontractingOrder.Page.al | 34 - .../TCSOnSales/src/TCSOnSales.Codeunit.al | 819 +-------- .../src/TCSOnSalesDocuments.Codeunit.al | 207 --- .../src/TDSOnPurchaseInvoice.Codeunit.al | 185 -- .../src/TDSOnPurchaseOrder.Codeunit.al | 182 -- .../src/MSCeridianPayrollupgrade.Codeunit.al | 16 - .../HybridGPUSObjects.PermissionSet.al | 3 +- .../Codeunits/GPCloudMigrationUS.Codeunit.al | 7 +- .../GPIRS1099MigrationValidator.Codeunit.al | 190 ++ .../PageExt/GPUpgradeSettingsExt.PageExt.al | 69 + .../app/src/Setup/IRSFormsSetup.Page.al | 50 - .../app/src/Tables/AutoAccPageSetup.Table.al | 5 - .../CompanyCreationWizard.Codeunit.al | 19 - .../app/src/EDocumentIntegration.EnumExt.al | 18 - .../Logiq/app/src/LogiqUpgrade.Codeunit.al | 32 - .../Pagero/app/EDocExtIntegration.EnumExt.al | 18 - .../Pagero/app/Upgrade.Codeunit.al | 31 - .../UpgradeEU3PartyPurchase.Codeunit.al | 108 -- .../app/src/EmailOutlookAPIClient.Codeunit.al | 14 - .../app/src/EmailOutlookAPIHelper.Codeunit.al | 38 - .../Permissions/HBDObjects.PermissionSet.al | 11 +- .../INTELLIGENTCLOUDHBD.PermissionSetExt.al | 6 +- .../d365basicHBD.permissionsetext.al | 6 +- .../d365basicisvHBD.permissionsetext.al | 6 +- .../d365teammemberHBD.permissionsetext.al | 6 +- .../HybridCloudManagement.Codeunit.al | 1 + .../codeunits/MigrationValidation.Codeunit.al | 307 ++++ .../MigrationValidationAssert.Codeunit.al | 312 ++++ .../MigrationValidatorWarning.Codeunit.al | 60 + .../enums/CloudMigrationWarningType.Enum.al | 5 + .../pages/CloudMigrationManagement.Page.al | 51 +- .../app/src/pages/HybridCompaniesList.Page.al | 76 +- .../pages/IntelligentCloudManagement.Page.al | 53 +- .../pages/IntelligentCloudStatFactbox.Page.al | 93 +- .../pages/MigrationValidationErrors.Page.al | 77 + .../pages/MigrationValidationResults.Page.al | 137 ++ .../src/tables/HybridCompanyStatus.Table.al | 4 + .../tables/MigrationValidationError.Table.al | 96 + .../src/tables/ValidationProgress.Table.al | 40 + .../app/src/tables/ValidationSuite.Table.al | 51 + .../src/tables/ValidationSuiteLine.Table.al | 54 + .../HybridCloudManagementTests.Codeunit.al | 220 +++ .../src/MockMigrationValidator.Codeunit.al | 101 ++ .../Permissions/HybridGPEdit.PermissionSet.al | 8 +- .../HybridGPObjects.PermissionSet.al | 20 +- .../Permissions/HybridGPRead.PermissionSet.al | 8 +- .../INTELLIGENTCLOUDHGP.PermissionSetExt.al | 8 +- .../d365basicHGP.permissionsetext.al | 8 +- .../d365basicisvHGP.permissionsetext.al | 3 +- .../d365teammemberHGP.permissionsetext.al | 8 +- .../src/Migration/Accounts/GPAccount.page.al | 83 - .../Accounts/GPFiscalPeriods.page.al | 48 - .../Accounts/GPGLTransactions.page.al | 124 -- .../Migration/Customers/GPCustomer.page.al | 139 -- .../Customers/GPCustomerTransactions.page.al | 106 -- .../GPPopulateCombinedTables.Codeunit.al | 315 ++-- .../History/AI/GPForecastHandler.codeunit.al | 15 - .../History/AI/GPForecastTemp.table.al | 53 - .../app/src/Migration/Items/GPItem.page.al | 132 -- .../GPCheckbookTransactions.table.al | 5 + .../Support/GPPostingAccounts.page.al | 148 -- .../Support/HelperFunctions.codeunit.al | 21 +- .../Support/WizardIntegration.codeunit.al | 12 +- .../src/Migration/Vendors/GPVendor.page.al | 134 -- .../Vendors/GPVendorTransactions.page.al | 101 -- .../GPMigrationValidator.Codeunit.al | 1568 +++++++++++++++++ .../codeunits/HybridGPManagement.codeunit.al | 25 + .../src/codeunits/HybridGPWizard.codeunit.al | 9 + .../pages/GPMigrationConfiguration.Page.al | 8 + .../app/src/pages/GPUpgradeSettings.Page.al | 62 + .../app/src/pages/HybridGPOverviewFb.Page.al | 8 +- .../src/tables/GPPOValidationBuffer.Table.al | 112 ++ .../src/Setup/IntrastatReportSetup.Page.al | 9 - .../src/Setup/IntrastatReportSetup.Table.al | 29 - .../Setup/IntrastatReportSetupWizard.Page.al | 9 - .../app/src/LPMachineLearningSetup.Page.al | 20 - .../src/pages/SalesForecastSetupCard.Page.al | 22 - .../test/src/SustValueEntryTest.Codeunit.al | 287 --- .../src/SustainabilityPostingTest.Codeunit.al | 823 +-------- 146 files changed, 4072 insertions(+), 6137 deletions(-) delete mode 100644 Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/AssemblyHandlerCZA.Codeunit.al delete mode 100644 Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryEditCZA.Codeunit.al delete mode 100644 Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/ProductionOrderHandlerCZA.Codeunit.al delete mode 100644 Apps/CZ/AdvancedLocalizationPack/app/Src/Pages/ApplyGLEntriesCZA.Page.al delete mode 100644 Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoData/Common/CommonModuleCZ.Codeunit.al delete mode 100644 Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATStmtTemplateHandlerCZL.Codeunit.al delete mode 100644 Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedDirectTransferCZL.PageExt.al delete mode 100644 Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/TransferOrderCZL.PageExt.al delete mode 100644 Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CountryRegionCZL.TableExt.al delete mode 100644 Apps/DE/Elster/app/src/Install/ElsterDataMigration.Codeunit.al delete mode 100644 Apps/DK/OIOUBL/app/src/upgrade/OIOUBLMigrateToExtV2.Codeunit.al delete mode 100644 Apps/NA/Ceridian/app/src/MSCeridianPayrollupgrade.Codeunit.al create mode 100644 Apps/US/HybridGP_US/app/src/Codeunits/GPIRS1099MigrationValidator.Codeunit.al create mode 100644 Apps/US/HybridGP_US/app/src/PageExt/GPUpgradeSettingsExt.PageExt.al delete mode 100644 Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/CompanyCreationWizard.Codeunit.al delete mode 100644 Apps/W1/EDocumentConnectors/Logiq/app/src/EDocumentIntegration.EnumExt.al delete mode 100644 Apps/W1/EDocumentConnectors/Pagero/app/EDocExtIntegration.EnumExt.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidation.Codeunit.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidationAssert.Codeunit.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidatorWarning.Codeunit.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationErrors.Page.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationResults.Page.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/tables/MigrationValidationError.Table.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/tables/ValidationProgress.Table.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuite.Table.al create mode 100644 Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuiteLine.Table.al create mode 100644 Apps/W1/HybridBaseDeployment/test/src/MockMigrationValidator.Codeunit.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Accounts/GPFiscalPeriods.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Accounts/GPGLTransactions.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomer.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerTransactions.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastHandler.codeunit.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastTemp.table.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Items/GPItem.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Support/GPPostingAccounts.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al delete mode 100644 Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al create mode 100644 Apps/W1/HybridGP/app/src/codeunits/GPMigrationValidator.Codeunit.al create mode 100644 Apps/W1/HybridGP/app/src/tables/GPPOValidationBuffer.Table.al diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json index 5637b53fdb..ef5482b04e 100644 --- a/.github/AL-Go-Settings.json +++ b/.github/AL-Go-Settings.json @@ -6,7 +6,7 @@ "runs-on": "windows-latest", "cacheImageName": "", "UsePsSession": false, - "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.47023.0/base", + "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.47162.0/base", "country": "base", "useProjectDependencies": true, "repoVersion": "29.0", diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvanceLettersCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvanceLettersCZZ.Page.al index f58c25a351..654f71f50d 100644 --- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvanceLettersCZZ.Page.al +++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/PurchAdvanceLettersCZZ.Page.al @@ -111,17 +111,6 @@ page 31180 "Purch. Advance Letters CZZ" ToolTip = 'Specifies to pay amount.'; Visible = false; } -#if not CLEAN26 - field("To Pay (LCY)"; Rec."To Pay (LCY)") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies to pay (LCY) amount.'; - Visible = false; - ObsoleteTag = '26.0'; - ObsoleteReason = 'This field is obsolete and will be removed in a future release.'; - ObsoleteState = Pending; - } -#endif field("To Use"; Rec."To Use") { ApplicationArea = Basic, Suite; diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/AssemblyHandlerCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/AssemblyHandlerCZA.Codeunit.al deleted file mode 100644 index 1c2decf8a2..0000000000 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/AssemblyHandlerCZA.Codeunit.al +++ /dev/null @@ -1,14 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Assembly; - -codeunit 31259 "Assembly Handler CZA" -{ - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'The codeunit is obsolete and will be removed in version 29.0.'; -} -#endif diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZA.Codeunit.al index 53bec826d5..a96f858cbb 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZA.Codeunit.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZA.Codeunit.al @@ -3,15 +3,9 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ namespace Microsoft.Utilities; -#if not CLEAN26 -using Microsoft.Assembly.Document; -#endif #if not CLEAN27 using Microsoft.Assembly.History; #endif -#if not CLEAN26 -using Microsoft.Assembly.Setup; -#endif using Microsoft.Finance.Dimension; using Microsoft.Finance.GeneralLedger.Ledger; using Microsoft.Inventory.Item; @@ -36,11 +30,6 @@ codeunit 31252 "Data Class. Eval. Handler CZA" procedure ApplyEvaluationClassificationsForPrivacy() var Company: Record Company; -#if not CLEAN26 - AssemblyHeader: Record "Assembly Header"; - AssemblyLine: Record "Assembly Line"; - AssemblySetup: Record "Assembly Setup"; -#endif CopyItemBuffer: Record "Copy Item Buffer"; CapacityLedgerEntry: Record "Capacity Ledger Entry"; DataExchFieldMapping: Record "Data Exch. Field Mapping"; @@ -72,13 +61,6 @@ codeunit 31252 "Data Class. Eval. Handler CZA" if not Company."Evaluation Company" then exit; DataClassificationMgt.SetTableFieldsToNormal(Database::"Detailed G/L Entry CZA"); -#if not CLEAN26 -#pragma warning disable AL0432 - DataClassificationMgt.SetFieldToNormal(Database::"Assembly Header", AssemblyHeader.FieldNo("Gen. Bus. Posting Group CZA")); - DataClassificationMgt.SetFieldToNormal(Database::"Assembly Line", AssemblyLine.FieldNo("Gen. Bus. Posting Group CZA")); - DataClassificationMgt.SetFieldToNormal(Database::"Assembly Setup", AssemblySetup.FieldNo("Default Gen.Bus.Post. Grp. CZA")); -#pragma warning restore AL0432 -#endif DataClassificationMgt.SetFieldToNormal(Database::"Capacity Ledger Entry", CapacityLedgerEntry.FieldNo("User ID CZA")); DataClassificationMgt.SetFieldToNormal(Database::"Copy Item Buffer", CopyItemBuffer.FieldNo("Auto Create Dimension CZA")); DataClassificationMgt.SetFieldToNormal(Database::"Data Exch. Field Mapping", DataExchFieldMapping.FieldNo("Date Formula CZA")); @@ -108,11 +90,6 @@ codeunit 31252 "Data Class. Eval. Handler CZA" DataClassificationMgt.SetFieldToNormal(Database::"Item Ledger Entry", ItemLedgerEntry.FieldNo("Reason Code CZA")); DataClassificationMgt.SetFieldToNormal(Database::"Item Ledger Entry", ItemLedgerEntry.FieldNo("Currency Code CZA")); DataClassificationMgt.SetFieldToNormal(Database::"Item Ledger Entry", ItemLedgerEntry.FieldNo("Currency Factor CZA")); -#if not CLEAN26 -#pragma warning disable AL0432 - DataClassificationMgt.SetFieldToNormal(Database::"Manufacturing Setup", ManufacturingSetup.FieldNo("Default Gen.Bus.Post. Grp. CZA")); -#pragma warning restore AL0432 -#endif DataClassificationMgt.SetFieldToNormal(Database::"Manufacturing Setup", ManufacturingSetup.FieldNo("Exact Cost Rev.Mand. Cons. CZA")); #if not CLEAN27 #pragma warning disable AL0432 diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryEditCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryEditCZA.Codeunit.al deleted file mode 100644 index 0336c8d13c..0000000000 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryEditCZA.Codeunit.al +++ /dev/null @@ -1,31 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Finance.GeneralLedger.Ledger; - -codeunit 31381 "G/L Entry - Edit CZA" -{ - Permissions = tabledata "G/L Entry" = rim; - TableNo = "G/L Entry"; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Use the standard G/L Entry-Edit codeunit instead. The same funcionality of this codeunit is available in codeunit 31177 G/L Entry Edit Handler CZA.'; - - trigger OnRun() - begin - GLEntry := Rec; - GLEntry.LockTable(); - GLEntry.Find(); - GLEntry."Applies-to ID CZA" := Rec."Applies-to ID CZA"; - GLEntry.Validate("Amount to Apply CZA", Rec."Amount to Apply CZA"); - GLEntry.Modify(); - Rec := GLEntry; - end; - - var - GLEntry: Record "G/L Entry"; -} - -#endif \ No newline at end of file diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryPostApplicationCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryPostApplicationCZA.Codeunit.al index b652e719a9..a84271f3cb 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryPostApplicationCZA.Codeunit.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryPostApplicationCZA.Codeunit.al @@ -317,17 +317,6 @@ codeunit 31370 "G/L Entry Post Application CZA" DtldGLEntryNo := 0; end; -#if not CLEAN26 - [Obsolete('The local SetAmountToApply procedure is used instead.', '26.0')] - procedure SetAmountToApply() - var - GLEntry: Record "G/L Entry"; - ApplyingAmount: Decimal; - begin - SetAmountToApply(GLEntry, ApplyingAmount); - end; -#endif - local procedure SetAmountToApply(var GLEntry: Record "G/L Entry"; var ApplyingAmount: Decimal) begin if Abs(GLEntry."Amount to Apply CZA") - Abs(ApplyingAmount) <= 0 then begin diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/ProductionOrderHandlerCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/ProductionOrderHandlerCZA.Codeunit.al deleted file mode 100644 index f470a4c8b4..0000000000 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/ProductionOrderHandlerCZA.Codeunit.al +++ /dev/null @@ -1,14 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Manufacturing.Document; - -codeunit 31258 "Production Order Handler CZA" -{ - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'The codeunit is obsolete and will be removed in version 29.0.'; -} -#endif \ No newline at end of file diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderCZA.PageExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderCZA.PageExt.al index 01120ca3d9..d0b7fd1dae 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderCZA.PageExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderCZA.PageExt.al @@ -10,18 +10,6 @@ pageextension 31253 "Assembly Order CZA" extends "Assembly Order" { addlast(Posting) { -#if not CLEAN26 - field("Gen. Bus. Posting Group CZA"; Rec."Gen. Bus. Posting Group CZA") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies the code for the General Business Posting Group that applies to the entry.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Replaced by "Gen. Bus. Post. Group" field in Assembly Header Name table.'; - Visible = false; - Enabled = false; - } -#endif } } } diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderSubformCZA.PageExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderSubformCZA.PageExt.al index ea3f84d4ff..c048c77e11 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderSubformCZA.PageExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblyOrderSubformCZA.PageExt.al @@ -10,18 +10,6 @@ pageextension 31254 "Assembly Order Subform CZA" extends "Assembly Order Subform { addbefore("Shortcut Dimension 1 Code") { -#if not CLEAN26 - field("Gen. Bus. Posting Group CZA"; Rec."Gen. Bus. Posting Group CZA") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies the code for the General Business Posting Group that applies to the entry.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Replaced by "Gen. Bus. Post. Group" field in Assembly Line Name table.'; - Enabled = false; - } -#endif } } } diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblySetupCZA.PageExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblySetupCZA.PageExt.al index 79513f6c00..98ba5d36e7 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblySetupCZA.PageExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/AssemblySetupCZA.PageExt.al @@ -10,18 +10,6 @@ pageextension 31252 "Assembly Setup CZA" extends "Assembly Setup" { addlast(General) { -#if not CLEAN26 - field("Default Gen.Bus.Post. Grp. CZA"; Rec."Default Gen.Bus.Post. Grp. CZA") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies the default general bussines posting group.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Replaced by "Default Gen. Bus. Post. Group" field in Assembly Setup Name table.'; - Visible = false; - Enabled = false; - } -#endif } } } diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/ManufacturingSetupCZA.PageExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/ManufacturingSetupCZA.PageExt.al index 80d4f7ca44..a98bbd042f 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/ManufacturingSetupCZA.PageExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/PageExtensions/ManufacturingSetupCZA.PageExt.al @@ -10,18 +10,6 @@ pageextension 31251 "Manufacturing Setup CZA" extends "Manufacturing Setup" { addlast(General) { -#if not CLEAN26 - field("Default Gen.Bus.Post. Grp. CZA"; Rec."Default Gen.Bus.Post. Grp. CZA") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies the default general bussines posting group.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Replaced by "Default Gen. Bus. Post. Group" field in Manufacturing Setup Name table.'; - Visible = false; - Enabled = false; - } -#endif field("Exact Cost Rev.Mand. Cons. CZA"; Rec."Exact Cost Rev.Mand. Cons. CZA") { ApplicationArea = Basic, Suite; diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Pages/ApplyGLEntriesCZA.Page.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Pages/ApplyGLEntriesCZA.Page.al deleted file mode 100644 index d4c7381fa2..0000000000 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Pages/ApplyGLEntriesCZA.Page.al +++ /dev/null @@ -1,656 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Finance.GeneralLedger.Ledger; - -using Microsoft.Finance.GeneralLedger.Account; -using Microsoft.Finance.GeneralLedger.Journal; -using Microsoft.Finance.GeneralLedger.Posting; -using Microsoft.Foundation.Navigate; - -page 31284 "Apply G/L Entries CZA" -{ - Caption = 'Apply General Ledger Entries'; - DataCaptionFields = "G/L Account No."; - DeleteAllowed = false; - InsertAllowed = false; - PageType = Worksheet; - Permissions = tabledata "G/L Entry" = m; - SourceTable = "G/L Entry"; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Replaced by "Apply Gen. Ledger Entries CZA" page. The new page is optimized using temporary table.'; - - layout - { - area(content) - { - group(General) - { - Caption = 'General'; - field(TempApplyingGLEntryPostingDateField; TempGLEntry."Posting Date") - { - ApplicationArea = Basic, Suite; - Caption = 'Posting Date'; - Editable = false; - ToolTip = 'Specifies the entry''s Posting Date.'; - } - field(TempApplyingGLEntryDocumentTypeField; TempGLEntry."Document Type") - { - ApplicationArea = Basic, Suite; - Caption = 'Document Type'; - Editable = false; - ToolTip = 'Specifies the original document type which will be applied.'; - } - field(TempApplyingGLEntryDocumentNoField; TempGLEntry."Document No.") - { - ApplicationArea = Basic, Suite; - Caption = 'Document No.'; - Editable = false; - ToolTip = 'Specifies the entry''s Document No.'; - } - field(TempApplyingGLEntryGLAccountNoField; TempGLEntry."G/L Account No.") - { - ApplicationArea = Basic, Suite; - Caption = 'G/L Account No.'; - Editable = false; - ToolTip = 'Specifies the number of the account that the entry has been posted to.'; - } - field(TempApplyingGLEntryDescriptionField; TempGLEntry.Description) - { - ApplicationArea = Basic, Suite; - Caption = 'Description'; - Editable = false; - ToolTip = 'Specifies the description of the entry.'; - } - field(TempApplyingGLEntryAmountField; TempGLEntry.Amount) - { - ApplicationArea = Basic, Suite; - Caption = 'Amount'; - Editable = false; - ToolTip = 'Specifies the amount to apply.'; - } - field(ApplyingRemainingAmountField; ApplyingRemainingAmount) - { - ApplicationArea = Basic, Suite; - AutoFormatType = 1; - AutoFormatExpression = ''; - Caption = 'Remaining Amount'; - Editable = false; - ToolTip = 'Specifies the remaining amount of general ledger entries'; - } - } - repeater(Lines) - { - ShowCaption = false; - field("Applies-to ID"; Rec."Applies-to ID CZA") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies the ID to apply to the general ledger entry.'; - - trigger OnValidate() - begin - AppliestoIDOnAfterValidate(); - end; - } - field("Posting Date"; Rec."Posting Date") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the date when the posting of the apply general ledger entries will be recorded.'; - } - field("Document Type"; Rec."Document Type") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the original document type which will be applied.'; - Visible = false; - } - field("Document No."; Rec."Document No.") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the entry''s Document No.'; - } - field("G/L Account No."; Rec."G/L Account No.") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the number of the account that the entry has been posted to.'; - } - field(Description; Rec.Description) - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the description of the entry to be applied.'; - } - field(Amount; Rec.Amount) - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the amount of the entry.'; - } - field("Amount to Apply"; Rec."Amount to Apply CZA") - { - ApplicationArea = Basic, Suite; - AutoFormatType = 1; - AutoFormatExpression = ''; - ToolTip = 'Specifies the amount to apply.'; - - trigger OnValidate() - begin - AmounttoApplyOnAfterValidate(); - end; - } - field("Applying Entry"; Rec."Applying Entry CZA") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies that the general ledger entry is an applying entry.'; - Visible = false; - } - field("Applied Amount"; Rec."Applied Amount CZA") - { - ApplicationArea = Basic, Suite; - AutoFormatType = 1; - AutoFormatExpression = ''; - Editable = false; - ToolTip = 'Specifies the applied amount for the general ledger entry.'; - } - field(RemainingAmountField; Remaining) - { - ApplicationArea = Basic, Suite; - AutoFormatType = 1; - AutoFormatExpression = ''; - Caption = 'Remaining Amount'; - ToolTip = 'Specifies the remaining amount of general ledger entries'; - Visible = false; - } - field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the code for the Gen. Bus. Posting Group that applies to the entry.'; - Visible = false; - } - field("Gen. Prod. Posting Group"; Rec."Gen. Prod. Posting Group") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies the code for the Gen. Prod. Posting Group that applies to the entry.'; - Visible = false; - } - field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies a VAT business posting group code.'; - Visible = false; - } - field("VAT Prod. Posting Group"; Rec."VAT Prod. Posting Group") - { - ApplicationArea = Basic, Suite; - Editable = false; - ToolTip = 'Specifies a VAT product posting group code for the VAT Statement.'; - Visible = false; - } - } - group(Amounts) - { - ShowCaption = false; - fixed(AmountFields) - { - ShowCaption = false; - group(AmmountToApply) - { - Caption = 'Amount to Apply'; - field(ApplyingAmountField; ApplyingAmount) - { - ApplicationArea = Basic, Suite; - AutoFormatType = 1; - AutoFormatExpression = ''; - Caption = 'Amount to Apply'; - Editable = false; - ShowCaption = false; - ToolTip = 'Specifies the apply amount for the general ledger entry.'; - } - } - group(AvailableAmount) - { - Caption = 'Available Amount'; - field(AvailableAmountField; AvailableAmount) - { - ApplicationArea = Basic, Suite; - AutoFormatType = 1; - AutoFormatExpression = ''; - Caption = 'Available Amount'; - Editable = false; - ToolTip = 'Specifies the amount of the journal entry that you have selected as the applying entry.'; - } - } - group(Balance) - { - Caption = 'Balance'; - field(AvailableAmountPlusApplyingAmountField; AvailableAmount + ApplyingAmount) - { - ApplicationArea = Basic, Suite; - AutoFormatType = 1; - AutoFormatExpression = ''; - Caption = 'Balance'; - Editable = false; - ToolTip = 'Specifies the description of the entry to be applied.'; - } - } - } - } - } - } - - actions - { - area(navigation) - { - group(Entry) - { - Caption = 'Entry'; - action("Applied E&ntries") - { - ApplicationArea = Basic, Suite; - Caption = 'Applied E&ntries'; - Image = Approve; - RunObject = Page "Applied G/L Entries CZA"; - RunPageOnRec = true; - ToolTip = 'Specifies the apllied entries.'; - } - action(Dimensions) - { - ApplicationArea = Basic, Suite; - Caption = 'Dimensions'; - Image = Dimensions; - ShortCutKey = 'Shift+Ctrl+D'; - ToolTip = 'View the dimension sets that are set up for the entry.'; - - trigger OnAction() - begin - Rec.ShowDimensions(); - end; - } - action("Detailed &Ledger Entries") - { - ApplicationArea = Basic, Suite; - Caption = 'Detailed &Ledger Entries'; - Image = View; - RunObject = Page "Detailed G/L Entries CZA"; - RunPageLink = "G/L Entry No." = Field("Entry No."); - RunPageView = sorting("G/L Entry No.", "Posting Date"); - ShortCutKey = 'Ctrl+F7'; - ToolTip = 'Specifies the detailed ledger entries of the entry.'; - } - } - group(Application) - { - Caption = 'Application'; - action("Set Applying Entry") - { - ApplicationArea = Basic, Suite; - Caption = 'Set Applying Entry'; - Image = Line; - ShortCutKey = 'Shift+F11'; - ToolTip = 'Sets applying entry'; - - trigger OnAction() - var - TEntryNo: Integer; - begin - if GenJnlLineApply then - exit; - - TEntryNo := Rec."Entry No."; - if TempGLEntry."Entry No." <> 0 then - RemoveApplyingGLEntry(); - SetApplyingGLEntry(TEntryNo); - end; - } - action("Remove Applying Entry") - { - ApplicationArea = Basic, Suite; - Caption = 'Remove Applying Entry'; - Image = CancelLine; - ShortCutKey = 'Ctrl+F11'; - ToolTip = 'Removes applying entry'; - - trigger OnAction() - begin - if GenJnlLineApply then - exit; - - RemoveApplyingGLEntry(); - end; - } - action("Set Applies-to ID") - { - ApplicationArea = Basic, Suite; - Caption = 'Set Applies-to ID'; - Image = SelectLineToApply; - ShortCutKey = 'F7'; - ToolTip = 'Sets applies to id'; - - trigger OnAction() - begin - SetAppliesToID(); - end; - } - action("Post Application") - { - ApplicationArea = Basic, Suite; - Caption = 'Post Application'; - Ellipsis = true; - Image = PostApplication; - ShortCutKey = 'F9'; - ToolTip = 'This batch job posts G/L entries application.'; - - trigger OnAction() - var - CompareOneGLEntry: Record "G/L Entry"; - CompareTwoGLEntry: Record "G/L Entry"; - begin - if CalcType <> CalcType::GenJnlLine then begin - if TempGLEntry."Entry No." <> 0 then begin - CompareTwoGLEntry.Get(TempGLEntry."Entry No."); - CompareTwoGLEntry.CalcFields("Applied Amount CZA"); - Commit(); - GLEntryPostApplicationCZA.PostApplyGLEntry(TempGLEntry); - CurrPage.Update(false); - CompareOneGLEntry.Get(TempGLEntry."Entry No."); - CompareOneGLEntry.CalcFields("Applied Amount CZA"); - if CompareTwoGLEntry."Applied Amount CZA" <> CompareOneGLEntry."Applied Amount CZA" then - RemoveApplyingGLEntry(); - end else - Error(AppEntryNeedErr); - end else - Error(AppFromWindowErr); - end; - } - action("Show Only Selected Entries to Be Applied") - { - ApplicationArea = Basic, Suite; - Caption = 'Show Only Selected Entries to Be Applied'; - Image = ShowSelected; - ToolTip = 'View the selected ledger entries that will be applied to the specified record. '; - - trigger OnAction() - begin - ShowAppliedEntries := not ShowAppliedEntries; - if ShowAppliedEntries then - Rec.SetRange("Applies-to ID CZA", GLApplID) - else - Rec.SetRange("Applies-to ID CZA"); - end; - } - } - } - area(processing) - { - action(Navigate) - { - ApplicationArea = Basic, Suite; - Caption = 'Find Entries'; - Image = Navigate; - Ellipsis = true; - ShortCutKey = 'Ctrl+Alt+Q'; - ToolTip = 'Find all entries and documents that exist for the document number and posting date on the selected entry or document.'; - - trigger OnAction() - begin - PageNavigate.SetDoc(Rec."Posting Date", Rec."Document No."); - PageNavigate.Run(); - end; - } - } - area(Promoted) - { - group(Category_Process) - { - actionref(Navigate_Promoted; Navigate) - { - } - actionref("Set Applies-to ID_Promoted"; "Set Applies-to ID") - { - } - actionref("Post Application_Promoted"; "Post Application") - { - } - } - } - } - - trigger OnAfterGetRecord() - begin - Rec.CalcFields("Applied Amount CZA"); - Remaining := Rec.Amount - Rec."Applied Amount CZA"; - end; - - trigger OnClosePage() - var - ApplyGLEntry: Record "G/L Entry"; - begin - ShowAppliedEntries := false; - if not PostingDone then - if ApplyGLEntry.Get(TempGLEntry."Entry No.") then - GLEntryPostApplicationCZA.SetApplyingGLEntry(ApplyGLEntry, false, ''); - end; - - trigger OnOpenPage() - var - GLAccount: Record "G/L Account"; - begin - GLAccount.Get(Rec.GetFilter("G/L Account No.")); - PostingDone := false; - - if CalcType = CalcType::GenJnlLine then begin - case ApplnType of - ApplnType::"Applies-to Doc. No.": - GLApplID := GenJournalLine."Applies-to Doc. No."; - ApplnType::"Applies-to ID": - GLApplID := GenJournalLine."Applies-to ID"; - end; - CalcApplnAmount(); - end else - FindApplyingGLEntry(); - end; - - var - GenJournalLine: Record "Gen. Journal Line"; - PageNavigate: Page Navigate; - ShowAppliedEntries: Boolean; - GLApplID: Code[50]; - Remaining: Decimal; - ApplEntryNo: Integer; - PostingDone: Boolean; - GenJnlLineApply: Boolean; - ApplnType: Option " ","Applies-to Doc. No.","Applies-to ID"; - CalcType: Option Direct,GenJnlLine; - AppEntryNeedErr: Label 'You must select an applying entry before posting the application.'; - AppFromWindowErr: Label 'You must post the application from the window where you entered the applying entry.'; - - protected var - TempGLEntry: Record "G/L Entry" temporary; - GLEntry: Record "G/L Entry"; - GLEntryPostApplicationCZA: Codeunit "G/L Entry Post Application CZA"; - ApplyingRemainingAmount: Decimal; - ApplyingAmount: Decimal; - AvailableAmount: Decimal; - - local procedure FindApplyingGLEntry() - begin - GLApplID := CopyStr(UserId(), 1, MaxStrLen(GLApplID)); - if GLApplID = '' then - GLApplID := '***'; - - if ApplEntryNo <> 0 then begin - SetApplyingGLEntry(ApplEntryNo); - ApplEntryNo := 0; - end else begin - GLEntry.SetCurrentKey("G/L Account No.", "Posting Date"); - GLEntry.SetRange("G/L Account No.", Rec."G/L Account No."); - GLEntry.SetRange("Applies-to ID CZA", GLApplID); - GLEntry.SetRange("Closed CZA", false); - GLEntry.SetRange("Applying Entry CZA", true); - if GLEntry.FindFirst() then - SetApplyingGLEntry(GLEntry."Entry No."); - end; - CalcApplnAmount(); - end; - - local procedure SetApplyingGLEntry(EntryNo: Integer) - begin - Rec.Get(EntryNo); - GLEntryPostApplicationCZA.SetApplyingGLEntry(Rec, true, GLApplID); - if Rec.Amount > 0 then - Rec.SetFilter(Amount, '<0') - else - Rec.SetFilter(Amount, '>0'); - OnSetApplyingGLEntryByEntryNoOnAfterSetFilters(Rec, GLEntryPostApplicationCZA); - Rec."Applying Entry CZA" := true; - Rec.Modify(); - - TempGLEntry := Rec; - Rec.SetCurrentKey("Entry No."); - Rec.SetFilter("Entry No.", '<> %1', Rec."Entry No."); - AvailableAmount := Rec.Amount - Rec."Applied Amount CZA"; - ApplyingRemainingAmount := Rec.Amount - Rec."Applied Amount CZA"; - CalcApplnAmount(); - Rec.SetCurrentKey("G/L Account No."); - end; - - local procedure RemoveApplyingGLEntry() - begin - if Rec.Get(TempGLEntry."Entry No.") then begin - GLEntryPostApplicationCZA.SetApplyingGLEntry(Rec, false, ''); - Rec.SetRange(Amount); - Rec."Applying Entry CZA" := false; - Rec.Modify(); - - Clear(TempGLEntry); - Rec.SetCurrentKey("Entry No."); - Rec.SetRange("Entry No."); - AvailableAmount := 0; - ApplyingRemainingAmount := 0; - CalcApplnAmount(); - end; - end; - - local procedure SetAppliesToID() - begin - GLEntry.Reset(); - GLEntry.Copy(Rec); - CurrPage.SetSelectionFilter(GLEntry); - if GLEntry.FindSet(true) then - repeat - SetApplyingGLEntry(GLEntry, false, GLApplID); - until GLEntry.Next() = 0; - Rec := GLEntry; - CalcApplnAmount(); - CurrPage.Update(false); - end; - - local procedure SetApplyingGLEntry(var GLEntry2: Record "G/L Entry"; IsApplyingEntry: Boolean; AppliesToID: Code[50]) - var - IsHandled: Boolean; - begin - OnBeforeSetApplyingGLEntry(GLEntry2, IsApplyingEntry, AppliesToID, GLEntryPostApplicationCZA, IsHandled); - if IsHandled then - exit; - GLEntryPostApplicationCZA.SetApplyingGLEntry(GLEntry2, false, GLApplID); - end; - - procedure CalcApplnAmount() - begin - ApplyingAmount := 0; - GLEntry.Reset(); - GLEntry.Copy(Rec); - GLEntry.SetRange("Applies-to ID CZA", GLApplID); - GLEntry.CalcSums("Amount to Apply CZA"); - ApplyingAmount := GLEntry."Amount to Apply CZA"; - end; - - procedure CheckAppliesToID(var GLEntry2: Record "G/L Entry") - begin - if GLEntry2."Applies-to ID CZA" <> '' then begin - GLApplID := CopyStr(UserId, 1, MaxStrLen(GLApplID)); - if GLApplID = '' then - GLApplID := '***'; - GLEntry2.TestField("Applies-to ID CZA", GLApplID); - end; - end; - - local procedure AppliestoIDOnAfterValidate() - begin - if (Rec."Applies-to ID CZA" = GLApplID) and (Rec."Amount to Apply CZA" = 0) then - SetAppliesToID(); - - if Rec."Applies-to ID CZA" = '' then begin - Rec."Applies-to ID CZA" := ''; - Rec."Amount to Apply CZA" := 0; - Rec.Modify(); - end; - end; - - local procedure AmounttoApplyOnAfterValidate() - begin - if Rec."Amount to Apply CZA" <> 0 then - Rec."Applies-to ID CZA" := GLApplID - else - Rec."Applies-to ID CZA" := ''; - Rec.Modify(); - CalcApplnAmount(); - end; - - procedure SetAplEntry(ApplEntryNo1: Integer) - begin - ApplEntryNo := ApplEntryNo1; - end; - - procedure SetGenJnlLine(NewGenJournalLine: Record "Gen. Journal Line"; ApplnTypeSelect: Integer) - begin - GenJournalLine := NewGenJournalLine; - GenJnlLineApply := true; - - if GenJournalLine."Bal. Account Type" = GenJournalLine."Bal. Account Type"::"G/L Account" then - ApplyingAmount := -GenJournalLine.Amount; - if GenJournalLine."Account Type" = GenJournalLine."Account Type"::"G/L Account" then - ApplyingAmount := GenJournalLine.Amount; - - CalcType := CalcType::GenJnlLine; - - case ApplnTypeSelect of - GenJournalLine.FieldNo("Applies-to Doc. No."): - ApplnType := ApplnType::"Applies-to Doc. No."; - GenJournalLine.FieldNo("Applies-to ID"): - ApplnType := ApplnType::"Applies-to ID"; - end; - - TempGLEntry."Entry No." := 1; - TempGLEntry."Posting Date" := GenJournalLine."Posting Date"; - TempGLEntry."Document Type" := GenJournalLine."Document Type"; - TempGLEntry."Document No." := GenJournalLine."Document No."; - TempGLEntry."G/L Account No." := GenJournalLine."Account No."; - TempGLEntry.Description := GenJournalLine.Description; - TempGLEntry.Amount := GenJournalLine.Amount; - ApplyingRemainingAmount := GenJournalLine.Amount; - CalcApplnAmount(); - end; - - [IntegrationEvent(true, false)] - local procedure OnBeforeSetApplyingGLEntry(var GLEntry: Record "G/L Entry"; IsApplyingEntry: Boolean; AppliesToID: Code[50]; var GLEntryPostApplicationCZA: Codeunit "G/L Entry Post Application CZA"; var IsHandled: Boolean); - begin - end; - - [IntegrationEvent(true, false)] - local procedure OnSetApplyingGLEntryByEntryNoOnAfterSetFilters(var GLEntry: Record "G/L Entry"; var GLEntryPostApplicationCZA: Codeunit Microsoft.Finance.GeneralLedger.Posting."G/L Entry Post Application CZA") - begin - end; -} -#endif \ No newline at end of file diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Permissions/CZAdvancePackObjectsCZA.PermissionSet.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Permissions/CZAdvancePackObjectsCZA.PermissionSet.al index 1d3c4e0490..6b1ef45174 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Permissions/CZAdvancePackObjectsCZA.PermissionSet.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/Permissions/CZAdvancePackObjectsCZA.PermissionSet.al @@ -6,11 +6,6 @@ permissionset 11742 "CZ Advance Pack - Objects CZA" Caption = 'CZ Advance Pack - Objects'; Permissions = -#if not CLEAN26 -#pragma warning disable AL0432 - codeunit "Assembly Handler CZA" = X, -#pragma warning restore AL0432 -#endif codeunit "Calculate Invent. Handler CZA" = X, codeunit "Cancel FA Ldg.Ent. Handler CZA" = X, codeunit "Data Class. Eval. Handler CZA" = X, @@ -21,11 +16,6 @@ permissionset 11742 "CZ Advance Pack - Objects CZA" codeunit "Gen. Jnl.-Apply Handler CZA" = X, codeunit "Gen. Jnl.Post Line Handler CZA" = X, codeunit "Gen. Journal Line Handler CZA" = X, -#if not CLEAN26 -#pragma warning disable AL0432 - codeunit "G/L Entry - Edit CZA" = X, -#pragma warning restore AL0432 -#endif codeunit "G/L Entry Edit Handler CZA" = X, codeunit "G/L Entry Post Application CZA" = X, codeunit "Install Application CZA" = X, @@ -35,11 +25,6 @@ permissionset 11742 "CZ Advance Pack - Objects CZA" codeunit "Item Tracking Line Handler CZA" = X, codeunit "Job Journal Line Handler CZA" = X, codeunit "Process Data Exch. Handler CZA" = X, -#if not CLEAN26 -#pragma warning disable AL0432 - codeunit "Production Order Handler CZA" = X, -#pragma warning restore AL0432 -#endif codeunit "Purchase Line Handler CZA" = X, codeunit "Reversal Entry Handler CZA" = X, codeunit "Req.Wksh.Make Ord. Handler CZA" = X, @@ -54,11 +39,6 @@ permissionset 11742 "CZ Advance Pack - Objects CZA" codeunit "Upgrade Application CZA" = X, codeunit "Upgrade Tag Definitions CZA" = X, page "Applied G/L Entries CZA" = X, -#if not CLEAN26 -#pragma warning disable AL0432 - page "Apply G/L Entries CZA" = X, -#pragma warning restore AL0432 -#endif page "Apply Gen. Ledger Entries CZA" = X, page "Detailed G/L Entries CZA" = X, page "Unapply G/L Entries CZA" = X, diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyHeaderCZA.TableExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyHeaderCZA.TableExt.al index 2c9086d9c1..a25dc51e40 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyHeaderCZA.TableExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyHeaderCZA.TableExt.al @@ -16,13 +16,8 @@ tableextension 31258 "Assembly Header CZA" extends "Assembly Header" Caption = 'Gen. Bus. Posting Group'; TableRelation = "Gen. Business Posting Group"; DataClassification = CustomerContent; -#if not CLEAN26 - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#else ObsoleteState = Removed; ObsoleteTag = '29.0'; -#endif ObsoleteReason = 'Replaced by "Gen. Bus. Posting Group" field in Assembly Header Name table.'; } #endif diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyLineCZA.TableExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyLineCZA.TableExt.al index f6b44dfdbe..1b64899b1d 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyLineCZA.TableExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblyLineCZA.TableExt.al @@ -16,13 +16,8 @@ tableextension 31259 "Assembly Line CZA" extends "Assembly Line" Caption = 'Gen. Bus. Posting Group'; TableRelation = "Gen. Business Posting Group"; DataClassification = CustomerContent; -#if not CLEAN26 - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#else ObsoleteState = Removed; ObsoleteTag = '29.0'; -#endif ObsoleteReason = 'Replaced by "Gen. Bus. Posting Group" field in Assembly Line Name table.'; } #endif diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblySetupCZA.TableExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblySetupCZA.TableExt.al index f3c27a0a43..bd080b27d1 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblySetupCZA.TableExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/AssemblySetupCZA.TableExt.al @@ -16,13 +16,8 @@ tableextension 31257 "Assembly Setup CZA" extends "Assembly Setup" Caption = 'Default Gen. Bus. Posting Group'; TableRelation = "Gen. Business Posting Group"; DataClassification = CustomerContent; -#if not CLEAN26 - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#else ObsoleteState = Removed; ObsoleteTag = '29.0'; -#endif ObsoleteReason = 'Replaced by "Default Gen. Bus. Post. Group" field in Assembly Setup Name table.'; } #endif diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/ManufacturingSetupCZA.TableExt.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/ManufacturingSetupCZA.TableExt.al index fcac111709..a6ab894730 100644 --- a/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/ManufacturingSetupCZA.TableExt.al +++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/TableExtensions/ManufacturingSetupCZA.TableExt.al @@ -16,13 +16,8 @@ tableextension 31256 "Manufacturing Setup CZA" extends "Manufacturing Setup" Caption = 'Default Gen. Bus. Posting Group'; TableRelation = "Gen. Business Posting Group"; DataClassification = CustomerContent; -#if not CLEAN26 - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#else ObsoleteState = Removed; ObsoleteTag = '29.0'; -#endif ObsoleteReason = 'Replaced by "Default Gen. Bus. Post. Group" field in Manufacturing Setup Name table.'; } #endif diff --git a/Apps/CZ/CashDeskLocalization/app/Src/Pages/CashDocumentSubformCZP.Page.al b/Apps/CZ/CashDeskLocalization/app/Src/Pages/CashDocumentSubformCZP.Page.al index 0d3ef05cbd..e4641c800e 100644 --- a/Apps/CZ/CashDeskLocalization/app/Src/Pages/CashDocumentSubformCZP.Page.al +++ b/Apps/CZ/CashDeskLocalization/app/Src/Pages/CashDocumentSubformCZP.Page.al @@ -562,9 +562,6 @@ page 31161 "Cash Document Subform CZP" TotalCashDocumentHeaderCZP: Record "Cash Document Header CZP"; AllocationAccountMgt: Codeunit "Allocation Account Mgt."; CashDocumentTotalsCZP: Codeunit "Cash Document Totals CZP"; -#if not CLEAN26 - AccountTypeIsFilled: Boolean; -#endif VATAmount: Decimal; RelatedAmountToApply: Decimal; ActionOnlyAllowedForAllocationAccountsErr: Label 'This action is only available for lines that have Allocation Account set as Type.'; @@ -593,13 +590,6 @@ page 31161 "Cash Document Subform CZP" CurrPage.Update(SetSaveRecord); end; -#if not CLEAN26 - [Obsolete('The procedure is not used and will be obsoleted', '26.0')] - procedure SetShowMandatoryConditions() - begin - AccountTypeIsFilled := Rec."Account Type" <> Rec."Account Type"::" "; - end; -#endif procedure InsertExtendedText(Unconditionally: Boolean) var TransferExtendedTextCZP: Codeunit "Transfer Extended Text CZP"; diff --git a/Apps/CZ/CashDeskLocalization/app/Src/Pages/PostedCashDocumentListCZP.Page.al b/Apps/CZ/CashDeskLocalization/app/Src/Pages/PostedCashDocumentListCZP.Page.al index 0a18388dd2..7bbe358c52 100644 --- a/Apps/CZ/CashDeskLocalization/app/Src/Pages/PostedCashDocumentListCZP.Page.al +++ b/Apps/CZ/CashDeskLocalization/app/Src/Pages/PostedCashDocumentListCZP.Page.al @@ -191,29 +191,6 @@ page 31167 "Posted Cash Document List CZP" { } } -#if not CLEAN26 - group(Category_Report) - { - Caption = 'Report'; - ObsoleteTag = '22.0'; - ObsoleteState = Pending; - ObsoleteReason = 'This group has been removed.'; - Visible = false; - - actionref(PrinttoAttachmentPromoted; PrintToAttachment) - { - ObsoleteTag = '26.0'; - ObsoleteState = Pending; - ObsoleteReason = 'This action has been removed.'; - } - actionref(PrintPromoted; "&Print") - { - ObsoleteTag = '26.0'; - ObsoleteState = Pending; - ObsoleteReason = 'This action has been removed.'; - } - } -#endif group(Category_Category8) { Caption = 'Print'; diff --git a/Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoData/Common/CommonModuleCZ.Codeunit.al b/Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoData/Common/CommonModuleCZ.Codeunit.al deleted file mode 100644 index 656ddcdeca..0000000000 --- a/Apps/CZ/ContosoCoffeeDemoDatasetCZ/app/DemoData/Common/CommonModuleCZ.Codeunit.al +++ /dev/null @@ -1,18 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ - -namespace Microsoft.DemoData.Common; - -codeunit 31210 "Common Module CZ" -{ - InherentEntitlements = X; - InherentPermissions = X; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'The code from this codeunit has been moved to "Contoso CZ Localization" codeunit.'; -} - -#endif diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al index b0159ee77a..437d07a0f5 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al @@ -545,11 +545,6 @@ codeunit 11710 "Data Class. Eval. Handler CZL" DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Name", VATStatementName.FieldNo("Comments CZL")); DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Name", VATStatementName.FieldNo("Attachments CZL")); DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Name", VATStatementName.FieldNo("XML Format CZL")); -#if not CLEAN26 -#pragma warning disable AL0432 - DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Template", VATStatementTemplate.FieldNo("XML Format CZL")); -#pragma warning restore AL0432 -#endif DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Template", VATStatementTemplate.FieldNo("Allow Comments/Attachments CZL")); DataClassificationMgt.SetFieldToNormal(Database::Vendor, Vendor.FieldNo("Tax Registration No. CZL")); DataClassificationMgt.SetFieldToNormal(Database::Vendor, Vendor.FieldNo("Validate Registration No. CZL")); diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATAttributeCodeMgtCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATAttributeCodeMgtCZL.Codeunit.al index fac477aab3..7b8455398a 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATAttributeCodeMgtCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATAttributeCodeMgtCZL.Codeunit.al @@ -35,17 +35,6 @@ codeunit 11781 "VAT Attribute Code Mgt. CZL" VATStatementExportCZL.InitVATAttributes(VATStatementName."Statement Template Name"); UnbindSubscription(this); end; -#if not CLEAN26 - - [Obsolete('Replaced by InitVATAttributesCZL function with VATStatementName parameter.', '26.0')] - procedure InitVATAttributes(VATStatementTemplate: Record "VAT Statement Template") - var - VATStatementExportCZL: Interface "VAT Statement Export CZL"; - begin - VATStatementExportCZL := VATStatementTemplate."XML Format CZL"; - VATStatementExportCZL.InitVATAttributes(VATStatementTemplate.Name); - end; -#endif procedure DeleteVATAttributes(VATStatementTemplate: Record "VAT Statement Template") var diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATStmtTemplateHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATStmtTemplateHandlerCZL.Codeunit.al deleted file mode 100644 index ebfadf23a6..0000000000 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATStmtTemplateHandlerCZL.Codeunit.al +++ /dev/null @@ -1,15 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Finance.VAT.Reporting; - -#pragma warning disable AL0432 -codeunit 11780 "VAT Stmt. Template Handler CZL" -{ - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'The codeunit is obsolete and will be removed in version 29.0.'; -} -#endif \ No newline at end of file diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Enums/UserSetupLineTypeCZL.Enum.al b/Apps/CZ/CoreLocalizationPack/app/Src/Enums/UserSetupLineTypeCZL.Enum.al index 4df1ce360d..bb40d8d10a 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Enums/UserSetupLineTypeCZL.Enum.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Enums/UserSetupLineTypeCZL.Enum.al @@ -28,15 +28,6 @@ enum 11725 "User Setup Line Type CZL" { Caption = 'Item Journal'; } -#if not CLEAN26 - value(5; "BOM Journal") - { - Caption = 'BOM Journal (Obsolete)'; - ObsoleteState = Pending; - ObsoleteReason = 'The BOM Journal is not used anymore.'; - ObsoleteTag = '26.0'; - } -#endif value(6; "Resource Journal") { Caption = 'Resource Journal'; @@ -45,15 +36,6 @@ enum 11725 "User Setup Line Type CZL" { Caption = 'Job Journal'; } -#if not CLEAN26 - value(8; "Intrastat Journal") - { - Caption = 'Intrastat Journal (Obsolete)'; - ObsoleteState = Pending; - ObsoleteReason = 'Intrastat related functionalities are moved to Intrastat extensions.'; - ObsoleteTag = '26.0'; - } -#endif value(9; "FA Journal") { Caption = 'FA Journal'; diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedDirectTransferCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedDirectTransferCZL.PageExt.al deleted file mode 100644 index 3a59732cf6..0000000000 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedDirectTransferCZL.PageExt.al +++ /dev/null @@ -1,41 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Inventory.Transfer; - -pageextension 31224 "Posted Direct Transfer CZL" extends "Posted Direct Transfer" -{ - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the fields are moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - - layout - { - addafter("Transfer-from") - { - group("Foreign Trade") - { - Caption = 'Foreign Trade'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the group is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } - } - } - } -} -#endif \ No newline at end of file diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseCreditMemoCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseCreditMemoCZL.PageExt.al index e5c4dc10c5..4ab93c8dac 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseCreditMemoCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseCreditMemoCZL.PageExt.al @@ -124,19 +124,6 @@ pageextension 11740 "Purchase Credit Memo CZL" extends "Purchase Credit Memo" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the purchase header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } movebefore("EU 3-Party Intermed. Role CZL"; "EU 3rd Party Trade") addafter("Foreign Trade") diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseInvoiceCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseInvoiceCZL.PageExt.al index e92638db64..d413973db3 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseInvoiceCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseInvoiceCZL.PageExt.al @@ -118,19 +118,6 @@ pageextension 11739 "Purchase Invoice CZL" extends "Purchase Invoice" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the purchase header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } movebefore("EU 3-Party Intermed. Role CZL"; "EU 3rd Party Trade") addafter("Foreign Trade") diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseOrderCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseOrderCZL.PageExt.al index 94f0e540ad..45af2364be 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseOrderCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseOrderCZL.PageExt.al @@ -109,19 +109,6 @@ pageextension 11738 "Purchase Order CZL" extends "Purchase Order" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the purchase header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } movebefore("EU 3-Party Intermed. Role CZL"; "EU 3rd Party Trade") addafter("Foreign Trade") diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseQuoteCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseQuoteCZL.PageExt.al index cddcd28474..46812515a8 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseQuoteCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseQuoteCZL.PageExt.al @@ -63,19 +63,6 @@ pageextension 11737 "Purchase Quote CZL" extends "Purchase Quote" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the sales header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } movebefore("EU 3-Party Intermed. Role CZL"; "EU 3rd Party Trade") addafter("Foreign Trade") diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseReturnOrderCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseReturnOrderCZL.PageExt.al index f662c87ff5..59b373286a 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseReturnOrderCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PurchaseReturnOrderCZL.PageExt.al @@ -133,19 +133,6 @@ pageextension 11741 "Purchase Return Order CZL" extends "Purchase Return Order" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the purchase header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } movebefore("EU 3-Party Intermed. Role CZL"; "EU 3rd Party Trade") addafter("Foreign Trade") diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesCreditMemoCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesCreditMemoCZL.PageExt.al index f453defd5d..f63304e5e4 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesCreditMemoCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesCreditMemoCZL.PageExt.al @@ -158,19 +158,6 @@ pageextension 11729 "Sales Credit Memo CZL" extends "Sales Credit Memo" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the sales header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter("Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesInvoiceCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesInvoiceCZL.PageExt.al index 4944a571b1..04168934c6 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesInvoiceCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesInvoiceCZL.PageExt.al @@ -133,19 +133,6 @@ pageextension 11728 "Sales Invoice CZL" extends "Sales Invoice" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the sales header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter("Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesOrderCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesOrderCZL.PageExt.al index b8b84e91a7..20672c26a1 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesOrderCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesOrderCZL.PageExt.al @@ -121,19 +121,6 @@ pageextension 11727 "Sales Order CZL" extends "Sales Order" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the sales header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter("Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesQuoteCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesQuoteCZL.PageExt.al index 7ae5dfcec7..aa80a0eac2 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesQuoteCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesQuoteCZL.PageExt.al @@ -59,19 +59,6 @@ pageextension 11726 "Sales Quote CZL" extends "Sales Quote" ApplicationArea = BasicEU; ToolTip = 'Specifies when the sales header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter("Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesReturnOrderCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesReturnOrderCZL.PageExt.al index 838edf31f6..cb29c94e08 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesReturnOrderCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/SalesReturnOrderCZL.PageExt.al @@ -155,19 +155,6 @@ pageextension 11730 "Sales Return Order CZL" extends "Sales Return Order" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the sales header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter("Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceCreditMemoCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceCreditMemoCZL.PageExt.al index 71d3122d22..8ca82a6cd8 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceCreditMemoCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceCreditMemoCZL.PageExt.al @@ -96,19 +96,6 @@ pageextension 11750 "Service Credit Memo CZL" extends "Service Credit Memo" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the service header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter("Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceInvoiceCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceInvoiceCZL.PageExt.al index 02aa16282f..477a627222 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceInvoiceCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceInvoiceCZL.PageExt.al @@ -91,19 +91,6 @@ pageextension 11749 "Service Invoice CZL" extends "Service Invoice" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the service header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter("Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceOrderCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceOrderCZL.PageExt.al index dcb04898f2..bcd9493668 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceOrderCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceOrderCZL.PageExt.al @@ -82,19 +82,6 @@ pageextension 11748 "Service Order CZL" extends "Service Order" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the service header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter(" Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceQuoteCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceQuoteCZL.PageExt.al index a9116c50cd..b00140d740 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceQuoteCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ServiceQuoteCZL.PageExt.al @@ -52,19 +52,6 @@ pageextension 11761 "Service Quote CZL" extends "Service Quote" ApplicationArea = Basic, Suite; ToolTip = 'Specifies when the service header will use European Union third-party intermediate trade rules. This option complies with VAT accounting standards for EU third-party trade.'; } -#if not CLEAN26 - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } -#endif } addafter(" Foreign Trade") { diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/TransferOrderCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/TransferOrderCZL.PageExt.al deleted file mode 100644 index 2225ebd826..0000000000 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/TransferOrderCZL.PageExt.al +++ /dev/null @@ -1,33 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Inventory.Transfer; - -pageextension 31128 "Transfer Order CZL" extends "Transfer Order" -{ - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the fields are moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - - layout - { - addfirst("Foreign Trade") - { - field(IsIntrastatTransactionCZL; Rec.IsIntrastatTransactionCZL()) - { - ApplicationArea = Basic, Suite; - Caption = 'Intrastat Transaction'; - Editable = false; - ToolTip = 'Specifies if the entry is an Intrastat transaction.'; - Visible = false; - ObsoleteState = Pending; - ObsoleteReason = 'The declaration of the field is moved to Intrastat CZ extension.'; - ObsoleteTag = '26.0'; - } - } - } -} - -#endif \ No newline at end of file diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATStatementTemplatesCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATStatementTemplatesCZL.PageExt.al index 6a834a697a..e71af14b55 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATStatementTemplatesCZL.PageExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATStatementTemplatesCZL.PageExt.al @@ -10,18 +10,6 @@ pageextension 11758 "VAT Statement Templates CZL" extends "VAT Statement Templat { addlast(Control1) { -#if not CLEAN26 - field("XML Format CZL"; Rec."XML Format CZL") - { - ApplicationArea = VAT; - ToolTip = 'Specifies the XML format for VAT statement reporting.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Replaced by "XML Format CZL" field in VAT Statement Name table.'; - Visible = false; - Enabled = false; - } -#endif field("Allow Comments/Attachments CZL"; Rec."Allow Comments/Attachments CZL") { ApplicationArea = VAT; diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al b/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al index 750e5778b3..751d43b738 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al @@ -136,11 +136,6 @@ permissionset 11732 "CZ Core Pack - Objects CZL" codeunit "VAT Statement DPHDP3 CZL" = X, codeunit "VAT Statement DPHDP3v3 CZL" = X, codeunit "VAT Statement Line Handler CZL" = X, -#if not CLEAN26 -#pragma warning disable AL0432 - codeunit "VAT Stmt. Template Handler CZL" = X, -#pragma warning restore AL0432 -#endif codeunit "VAT Stmt XML Export Helper CZL" = X, codeunit "VAT Stmt XML Export Runner CZL" = X, codeunit "Vendor Bank Acc. Handler CZL" = X, diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CountryRegionCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CountryRegionCZL.TableExt.al deleted file mode 100644 index fa42fd3d78..0000000000 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CountryRegionCZL.TableExt.al +++ /dev/null @@ -1,44 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// 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; - -using Microsoft.Foundation.Company; - -tableextension 11798 "Country/Region CZL" extends "Country/Region" -{ - [Obsolete('Pending removal. Use IsIntrastat from Intrastat Core extension instead.', '26.0')] - procedure IsIntrastatCZL(CountryRegionCode: Code[10]; ShipTo: Boolean): Boolean - var - CompanyInformation: Record "Company Information"; - begin - if CountryRegionCode = '' then - exit(false); - - Get(CountryRegionCode); - if "Intrastat Code" = '' then - exit(false); - - CompanyInformation.Get(); - if ShipTo then - exit(CountryRegionCode <> CompanyInformation."Ship-to Country/Region Code"); - exit(CountryRegionCode <> CompanyInformation."Country/Region Code"); - end; - - [Obsolete('Pending removal. Use IsLocalCountry from Intrastat Core extension instead.', '26.0')] - procedure IsLocalCountryCZL(CountryRegionCode: Code[10]; ShipTo: Boolean): Boolean - var - CompanyInformation: Record "Company Information"; - begin - if CountryRegionCode = '' then - exit(true); - - CompanyInformation.Get(); - if ShipTo then - exit(CountryRegionCode = CompanyInformation."Ship-to Country/Region Code"); - exit(CountryRegionCode = CompanyInformation."Country/Region Code"); - end; -} -#endif \ No newline at end of file diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/DirectTransHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/DirectTransHeaderCZL.TableExt.al index 09a2bc6a69..88dec62124 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/DirectTransHeaderCZL.TableExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/DirectTransHeaderCZL.TableExt.al @@ -4,10 +4,6 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Inventory.Transfer; -#if not CLEAN26 -using Microsoft.Foundation.Address; -using Microsoft.Foundation.Company; -#endif using Microsoft.Inventory.Ledger; tableextension 31054 "Direct Trans. Header CZL" extends "Direct Trans. Header" @@ -25,43 +21,6 @@ tableextension 31054 "Direct Trans. Header CZL" extends "Direct Trans. Header" } } #endif -#if not CLEAN26 - var - GlobalDocumentNo: Code[20]; - GlobalIsIntrastatTransaction: Boolean; - - [Obsolete('Pending removal. Use IsIntrastatTransactionCZ from Intrastat CZ extension instead.', '26.0')] - procedure IsIntrastatTransactionCZL(): Boolean - begin - if ("No." <> GlobalDocumentNo) or ("No." = '') then begin - GlobalDocumentNo := "No."; - GlobalIsIntrastatTransaction := UpdateGlobalIsIntrastatTransaction(); - end; - exit(GlobalIsIntrastatTransaction); - end; - - local procedure UpdateGlobalIsIntrastatTransaction(): Boolean - var - CountryRegion: Record "Country/Region"; - CompanyInformation: Record "Company Information"; - IsHandled: Boolean; - Result: Boolean; - begin - OnBeforeUpdateGlobalIsIntrastatTransactionCZL(Rec, Result, IsHandled); - if IsHandled then - exit(Result); - - if "Trsf.-from Country/Region Code" = "Trsf.-to Country/Region Code" then - exit(false); - - CompanyInformation.Get(); - if "Trsf.-from Country/Region Code" in ['', CompanyInformation."Country/Region Code"] then - exit(CountryRegion.IsIntrastatCZL("Trsf.-to Country/Region Code", false)); - if "Trsf.-to Country/Region Code" in ['', CompanyInformation."Country/Region Code"] then - exit(CountryRegion.IsIntrastatCZL("Trsf.-from Country/Region Code", false)); - exit(false); - end; -#endif procedure GetRegisterUserIDCZL(): Code[50] var @@ -71,11 +30,4 @@ tableextension 31054 "Direct Trans. Header CZL" extends "Direct Trans. Header" if ItemLedgerEntry.FindFirst() then exit(ItemLedgerEntry.GetRegisterUserIDCZL()); end; -#if not CLEAN26 - [Obsolete('Pending removal. Use OnBeforeIsIntrastatTransactionCZ from Intrastat CZ extension instead.', '26.0')] - [IntegrationEvent(true, false)] - local procedure OnBeforeUpdateGlobalIsIntrastatTransactionCZL(DirectTransHeader: Record "Direct Trans. Header"; var Result: Boolean; var IsHandled: Boolean) - begin - end; -#endif } diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al index 7ec53df9a2..6d20baa36b 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al @@ -10,9 +10,6 @@ using Microsoft.Finance.Currency; using Microsoft.Finance.GeneralLedger.Setup; using Microsoft.Finance.VAT.Calculation; using Microsoft.Finance.VAT.Setup; -#if not CLEAN26 -using Microsoft.Foundation.Address; -#endif using Microsoft.Foundation.BatchProcessing; using Microsoft.Purchases.Vendor; using System.Reflection; @@ -329,11 +326,6 @@ tableextension 11705 "Purchase Header CZL" extends "Purchase Header" GeneralLedgerSetup: Record "General Ledger Setup"; UnreliablePayerMgtCZL: Codeunit "Unreliable Payer Mgt. CZL"; ConfirmManagement: Codeunit "Confirm Management"; -#if not CLEAN26 - GlobalDocumentType: Enum "Purchase Document Type"; - GlobalDocumentNo: Code[20]; - GlobalIsIntrastatTransaction: Boolean; -#endif IsConfirmedCZL: Boolean; UpdateVATCurrFactorDisabled: Boolean; UpdateExchRateQst: Label 'Do you want to update the exchange rate for VAT?'; @@ -525,54 +517,6 @@ tableextension 11705 "Purchase Header CZL" extends "Purchase Header" "SWIFT Code CZL" := SWIFTCode; OnAfterUpdateBankInfoCZL(Rec); end; -#if not CLEAN26 - [Obsolete('Pending removal. Replaced by internal ShipOrReceiveInventoriableTypeItems function from Intrastat Core extension. ', '26.0')] - procedure ShipOrReceiveInventoriableTypeItemsCZL(): Boolean - var - PurchaseLine: Record "Purchase Line"; - begin - PurchaseLine.SetRange("Document Type", "Document Type"); - PurchaseLine.SetRange("Document No.", "No."); - PurchaseLine.SetRange(Type, PurchaseLine.Type::Item); - if PurchaseLine.FindSet() then - repeat - if ((PurchaseLine."Qty. to Receive" <> 0) or (PurchaseLine."Return Qty. to Ship" <> 0)) and PurchaseLine.IsInventoriableItem() then - exit(true); - until PurchaseLine.Next() = 0; - end; - - [Obsolete('Pending removal. Use IsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - procedure IsIntrastatTransactionCZL(): Boolean - begin - if ("Document Type" <> GlobalDocumentType) or ("No." <> GlobalDocumentNo) or ("No." = '') then begin - GlobalDocumentType := "Document Type"; - GlobalDocumentNo := "No."; - GlobalIsIntrastatTransaction := UpdateGlobalIsIntrastatTransaction(); - end; - exit(GlobalIsIntrastatTransaction); - end; - - local procedure UpdateGlobalIsIntrastatTransaction(): Boolean - var - CountryRegion: Record "Country/Region"; - IsHandled: Boolean; - Result: Boolean; - begin - OnBeforeUpdateGlobalIsIntrastatTransaction(Rec, Result, IsHandled); - if IsHandled then - exit(Result); - - if "EU 3-Party Intermed. Role CZL" then - exit(false); - if IsCreditDocType() then - exit(CountryRegion.IsIntrastatCZL("VAT Country/Region Code", true)); - if "VAT Country/Region Code" = "Ship-to Country/Region Code" then - exit(false); - if CountryRegion.IsLocalCountryCZL("Ship-to Country/Region Code", true) then - exit(CountryRegion.IsIntrastatCZL("VAT Country/Region Code", true)); - exit(CountryRegion.IsIntrastatCZL("Ship-to Country/Region Code", true)); - end; -#endif procedure GetDefaulBankAccountNoCZL() BankAccountNo: Code[20] var @@ -645,13 +589,6 @@ tableextension 11705 "Purchase Header CZL" extends "Purchase Header" local procedure OnAfterUpdateBankInfoCZL(var PurchaseHeader: Record "Purchase Header") begin end; -#if not CLEAN26 - [Obsolete('Pending removal. Use OnBeforeCheckIsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - [IntegrationEvent(true, false)] - local procedure OnBeforeUpdateGlobalIsIntrastatTransaction(PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean) - begin - end; -#endif [IntegrationEvent(false, false)] local procedure OnValidateVATDateOnBeforeCheckNeedUpdateVATCurrencyFactorCZL(var PurchaseHeader: Record "Purchase Header"; var IsIsConfirmedCZL: Boolean; var NeedUpdateVATCurrencyFactor: Boolean; xPurchaseHeader: Record "Purchase Header") diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesHeaderCZL.TableExt.al index 5552be5f32..242e41ea8a 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesHeaderCZL.TableExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesHeaderCZL.TableExt.al @@ -9,9 +9,6 @@ using Microsoft.Bank.Setup; using Microsoft.Finance.Currency; using Microsoft.Finance.GeneralLedger.Setup; using Microsoft.Finance.VAT.Calculation; -#if not CLEAN26 -using Microsoft.Foundation.Address; -#endif using Microsoft.Foundation.BatchProcessing; using Microsoft.Foundation.Company; using Microsoft.Sales.Customer; @@ -301,11 +298,6 @@ tableextension 11703 "Sales Header CZL" extends "Sales Header" var GeneralLedgerSetup: Record "General Ledger Setup"; ConfirmManagement: Codeunit "Confirm Management"; -#if not CLEAN26 - GlobalDocumentType: Enum "Sales Document Type"; - GlobalDocumentNo: Code[20]; - GlobalIsIntrastatTransaction: Boolean; -#endif IsConfirmedCZL: Boolean; UpdateExchRateQst: Label 'Do you want to update the exchange rate for VAT?'; UpdateExchRateForAddCurrencyQst: Label 'Do you want to update the exchange rate for additional currency?'; @@ -452,49 +444,6 @@ tableextension 11703 "Sales Header CZL" extends "Sales Header" "SWIFT Code CZL" := SWIFTCode; OnAfterUpdateBankInfoCZL(Rec); end; -#if not CLEAN26 - [Obsolete('Pending removal. Replaced by internal ShipOrReceiveInventoriableTypeItems function from Intrastat Core extension. ', '26.0')] - procedure ShipOrReceiveInventoriableTypeItemsCZL(): Boolean - var - SalesLine: Record "Sales Line"; - begin - SalesLine.Reset(); - SalesLine.SetRange("Document Type", "Document Type"); - SalesLine.SetRange("Document No.", "No."); - SalesLine.SetRange(Type, SalesLine.Type::Item); - if SalesLine.FindSet() then - repeat - if ((SalesLine."Qty. to Ship" <> 0) or (SalesLine."Return Qty. to Receive" <> 0)) and SalesLine.IsInventoriableItem() then - exit(true); - until SalesLine.Next() = 0; - end; - - [Obsolete('Pending removal. Use IsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - procedure IsIntrastatTransactionCZL(): Boolean - begin - if ("Document Type" <> GlobalDocumentType) or ("No." <> GlobalDocumentNo) or ("No." = '') then begin - GlobalDocumentType := "Document Type"; - GlobalDocumentNo := "No."; - GlobalIsIntrastatTransaction := UpdateGlobalIsIntrastatTransaction(); - end; - exit(GlobalIsIntrastatTransaction); - end; - - local procedure UpdateGlobalIsIntrastatTransaction(): Boolean - var - CountryRegion: Record "Country/Region"; - IsHandled: Boolean; - Result: Boolean; - begin - OnBeforeUpdateGlobalIsIntrastatTransaction(Rec, Result, IsHandled); - if IsHandled then - exit(Result); - - if "EU 3-Party Intermed. Role CZL" then - exit(false); - exit(CountryRegion.IsIntrastatCZL("VAT Country/Region Code", false)); - end; -#endif procedure GetDefaulBankAccountNoCZL() BankAccountNo: Code[20] var @@ -575,13 +524,6 @@ tableextension 11703 "Sales Header CZL" extends "Sales Header" local procedure OnAfterUpdateBankInfoCZL(var SalesHeader: Record "Sales Header") begin end; -#if not CLEAN26 - [Obsolete('Pending removal. Use OnBeforeCheckIsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - [IntegrationEvent(true, false)] - local procedure OnBeforeUpdateGlobalIsIntrastatTransaction(SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean) - begin - end; -#endif [IntegrationEvent(false, false)] local procedure OnValidateVATDateOnBeforeCheckNeedUpdateVATCurrencyFactorCZL(var SalesHeader: Record "Sales Header"; var IsIsConfirmedCZL: Boolean; var NeedUpdateVATCurrencyFactor: Boolean; xSalesHeader: Record "Sales Header") diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ServiceHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ServiceHeaderCZL.TableExt.al index 8b3faa772e..5be49089b0 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ServiceHeaderCZL.TableExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ServiceHeaderCZL.TableExt.al @@ -8,9 +8,6 @@ using Microsoft.Bank.BankAccount; using Microsoft.Bank.Setup; using Microsoft.Finance.Currency; using Microsoft.Finance.VAT.Calculation; -#if not CLEAN26 -using Microsoft.Foundation.Address; -#endif using Microsoft.Foundation.Company; using Microsoft.Sales.Customer; using Microsoft.Sales.Document; @@ -302,23 +299,6 @@ tableextension 11734 "Service Header CZL" extends "Service Header" "SWIFT Code CZL" := SWIFTCode; OnAfterUpdateBankInfoCZL(Rec); end; -#if not CLEAN26 - [Obsolete('Pending removal. Use IsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - procedure IsIntrastatTransactionCZL(): Boolean - var - CountryRegion: Record "Country/Region"; - IsHandled: Boolean; - Result: Boolean; - begin - OnBeforeIsIntrastatTransactionCZL(Rec, Result, IsHandled); - if IsHandled then - exit(Result); - - if "EU 3-Party Trade" then - exit(false); - exit(CountryRegion.IsIntrastatCZL("VAT Country/Region Code", false)); - end; -#endif procedure GetDefaulBankAccountNoCZL() BankAccountNo: Code[20] var @@ -399,13 +379,6 @@ tableextension 11734 "Service Header CZL" extends "Service Header" local procedure OnBeforeGetDefaulBankAccountNoCZL(var ServiceHeader: Record "Service Header"; var BankAccountNo: Code[20]; var IsHandled: Boolean); begin end; -#if not CLEAN26 - [Obsolete('Pending removal. Use OnBeforeCheckIsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - [IntegrationEvent(true, false)] - local procedure OnBeforeIsIntrastatTransactionCZL(ServiceHeader: Record "Service Header"; var Result: Boolean; var IsHandled: Boolean) - begin - end; -#endif [IntegrationEvent(false, false)] local procedure OnBeforeConfirmProcessCZL(ConfirmQuestion: Text; var IsHandled: Boolean); diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/TransferHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/TransferHeaderCZL.TableExt.al index ccf61e7d79..cbe39b27ee 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/TransferHeaderCZL.TableExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/TransferHeaderCZL.TableExt.al @@ -4,12 +4,6 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Inventory.Transfer; -#if not CLEAN26 -using Microsoft.Foundation.Address; -using Microsoft.Foundation.Company; -using Microsoft.Inventory.Item; - -#endif tableextension 31010 "Transfer Header CZL" extends "Transfer Header" { #if not CLEANSCHEMA25 @@ -25,63 +19,4 @@ tableextension 31010 "Transfer Header CZL" extends "Transfer Header" } } #endif -#if not CLEAN26 - var - GlobalDocumentNo: Code[20]; - GlobalIsIntrastatTransaction: Boolean; - - [Obsolete('Pending removal. Use IsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - procedure IsIntrastatTransactionCZL() IsIntrastat: Boolean - begin - if ("No." <> GlobalDocumentNo) or ("No." = '') then begin - GlobalDocumentNo := "No."; - GlobalIsIntrastatTransaction := UpdateGlobalIsIntrastatTransaction(); - end; - exit(GlobalIsIntrastatTransaction); - end; - - local procedure UpdateGlobalIsIntrastatTransaction(): Boolean - var - CountryRegion: Record "Country/Region"; - CompanyInformation: Record "Company Information"; - IsHandled: Boolean; - Result: Boolean; - begin - OnBeforeUpdateGlobalIsIntrastatTransactionCZL(Rec, Result, IsHandled); - if IsHandled then - exit(Result); - - if "Trsf.-from Country/Region Code" = "Trsf.-to Country/Region Code" then - exit(false); - - CompanyInformation.Get(); - if "Trsf.-from Country/Region Code" in ['', CompanyInformation."Country/Region Code"] then - exit(CountryRegion.IsIntrastatCZL("Trsf.-to Country/Region Code", false)); - if "Trsf.-to Country/Region Code" in ['', CompanyInformation."Country/Region Code"] then - exit(CountryRegion.IsIntrastatCZL("Trsf.-from Country/Region Code", false)); - exit(false); - end; - - [Obsolete('Pending removal. Replaced by internal ShipOrReceiveInventoriableTypeItems function from Intrastat Core extension. ', '26.0')] - procedure ShipOrReceiveInventoriableTypeItemsCZL(): Boolean - var - TransferLine: Record "Transfer Line"; - Item: Record Item; - begin - TransferLine.SetRange("Document No.", "No."); - TransferLine.SetFilter("Item No.", '<>%1', ''); - if TransferLine.FindSet() then - repeat - if Item.Get(TransferLine."Item No.") then - if ((TransferLine."Qty. to Receive" <> 0) or (TransferLine."Qty. to Ship" <> 0)) and Item.IsInventoriableType() then - exit(true); - until TransferLine.Next() = 0; - end; - - [Obsolete('Pending removal. Use OnBeforeCheckIsIntrastatTransaction from Intrastat Core extension instead.', '26.0')] - [IntegrationEvent(true, false)] - local procedure OnBeforeUpdateGlobalIsIntrastatTransactionCZL(TransferHeader: Record "Transfer Header"; var Result: Boolean; var IsHandled: Boolean) - begin - end; -#endif } diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementTemplateCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementTemplateCZL.TableExt.al index 2373019c0c..2f454f2606 100644 --- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementTemplateCZL.TableExt.al +++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementTemplateCZL.TableExt.al @@ -15,13 +15,8 @@ tableextension 11748 "VAT Statement Template CZL" extends "VAT Statement Templat { Caption = 'XML Format (obsoleted)'; DataClassification = CustomerContent; -#if not CLEAN26 - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#else ObsoleteState = Removed; ObsoleteTag = '29.0'; -#endif ObsoleteReason = 'Replaced by "XML Format CZL" field in VAT Statement Name table.'; } #endif @@ -71,14 +66,4 @@ tableextension 11748 "VAT Statement Template CZL" extends "VAT Statement Templat begin VATAttributeCodeMgtCZL.DeleteVATAttributes(Rec); end; -#if not CLEAN26 - - [Obsolete('Replaced by InitVATAttributesCZL function in VAT Statement Name table.', '26.0')] - procedure InitVATAttributesCZL(); - begin -#pragma warning disable AL0432 - VATAttributeCodeMgtCZL.InitVATAttributes(Rec); -#pragma warning restore AL0432 - end; -#endif } diff --git a/Apps/CZ/CoreLocalizationPack/test/Src/LibraryTaxCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/test/Src/LibraryTaxCZL.Codeunit.al index 290920d1ef..f75f45a9c7 100644 --- a/Apps/CZ/CoreLocalizationPack/test/Src/LibraryTaxCZL.Codeunit.al +++ b/Apps/CZ/CoreLocalizationPack/test/Src/LibraryTaxCZL.Codeunit.al @@ -494,15 +494,6 @@ codeunit 148003 "Library - Tax CZL" GeneralLedgerSetup.Modify(); end; -#if not CLEAN26 - [Obsolete('Replaced by SetXMLFormat function with "VAT Statement Name" parameter.', '26.0')] - procedure SetXMLFormat(var VATStatementTemplate: Record "VAT Statement Template"; XMLFormat: Enum "VAT Statement XML Format CZL") - begin - VATStatementTemplate."XML Format CZL" := XMLFormat; - VATStatementTemplate.Modify(); - end; - -#endif procedure SetXMLFormat(var VATStatementName: Record "VAT Statement Name"; XMLFormat: Enum "VAT Statement XML Format CZL") begin VATStatementName."XML Format CZL" := XMLFormat; diff --git a/Apps/CZ/IntrastatCZ/app/src/Codeunits/DataClassEvalHandlerCZ.Codeunit.al b/Apps/CZ/IntrastatCZ/app/src/Codeunits/DataClassEvalHandlerCZ.Codeunit.al index 62062856e5..2ba0b39657 100644 --- a/Apps/CZ/IntrastatCZ/app/src/Codeunits/DataClassEvalHandlerCZ.Codeunit.al +++ b/Apps/CZ/IntrastatCZ/app/src/Codeunits/DataClassEvalHandlerCZ.Codeunit.al @@ -107,12 +107,6 @@ codeunit 31300 "Data Class. Eval. Handler CZ" DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Line", IntrastatReportLine.FieldNo("Internal Note 2 CZ")); DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Header", IntrastatReportHeader.FieldNo("Statement Type CZ")); DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Setup", IntrastatReportSetup.FieldNo("No Item Charges in Int. CZ")); -#if not CLEAN26 - DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Setup", IntrastatReportSetup.FieldNo("Transaction Type Mandatory CZ")); - DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Setup", IntrastatReportSetup.FieldNo("Transaction Spec. Mandatory CZ")); - DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Setup", IntrastatReportSetup.FieldNo("Transport Method Mandatory CZ")); - DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Setup", IntrastatReportSetup.FieldNo("Shipment Method Mandatory CZ")); -#endif DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Setup", IntrastatReportSetup.FieldNo("Intrastat Rounding Type CZ")); DataClassificationMgt.SetFieldToNormal(Database::"Intrastat Report Setup", IntrastatReportSetup.FieldNo("Def. Phys. Trans. - Returns CZ")); DataClassificationMgt.SetFieldToNormal(Database::Item, Item.FieldNo("Statistic Indication CZ")); diff --git a/Apps/CZ/IntrastatCZ/app/src/Codeunits/IntrastatReportManagementCZ.Codeunit.al b/Apps/CZ/IntrastatCZ/app/src/Codeunits/IntrastatReportManagementCZ.Codeunit.al index af72759ab7..f3387479c1 100644 --- a/Apps/CZ/IntrastatCZ/app/src/Codeunits/IntrastatReportManagementCZ.Codeunit.al +++ b/Apps/CZ/IntrastatCZ/app/src/Codeunits/IntrastatReportManagementCZ.Codeunit.al @@ -953,62 +953,6 @@ codeunit 31302 IntrastatReportManagementCZ IsHandled := true; end; end; -#if not CLEAN26 - [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnBeforeUpdateGlobalIsIntrastatTransaction', '', false, false)] - local procedure CheckIntrastatExcludeOnBeforeUpdateGlobalIsIntrastatTransactionPurchase(PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean) - begin - if IsHandled then - exit; - if PurchaseHeader."Intrastat Exclude CZ" then begin - Result := false; - IsHandled := true; - end; - end; - - [EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnBeforeUpdateGlobalIsIntrastatTransaction', '', false, false)] - local procedure CheckIntrastatExcludeOnBeforeUpdateGlobalIsIntrastatTransactionSales(SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean) - begin - if IsHandled then - exit; - if SalesHeader."Intrastat Exclude CZ" then begin - Result := false; - IsHandled := true; - end; - end; - - [EventSubscriber(ObjectType::Table, Database::"Service Header", 'OnBeforeIsIntrastatTransactionCZL', '', false, false)] - local procedure CheckIntrastatExcludeOnBeforeIsIntrastatTransactionCZL(ServiceHeader: Record "Service Header"; var Result: Boolean; var IsHandled: Boolean) - begin - if IsHandled then - exit; - if ServiceHeader."Intrastat Exclude CZ" then begin - Result := false; - IsHandled := true; - end; - end; - - [EventSubscriber(ObjectType::Table, Database::"Transfer Header", 'OnBeforeUpdateGlobalIsIntrastatTransactionCZL', '', false, false)] - local procedure CheckIntrastatExcludeOnBeforeUpdateGlobalIsIntrastatTransactionCZLTransfer(TransferHeader: Record "Transfer Header"; var Result: Boolean; var IsHandled: Boolean) - begin - if IsHandled then - exit; - if TransferHeader."Intrastat Exclude CZ" then begin - Result := false; - IsHandled := true; - end; - end; - - [EventSubscriber(ObjectType::Table, Database::"Direct Trans. Header", 'OnBeforeUpdateGlobalIsIntrastatTransactionCZL', '', false, false)] - local procedure CheckIntrastatExcludeOnBeforeUpdateGlobalIsIntrastatTransactionCZLDirectTransfer(DirectTransHeader: Record "Direct Trans. Header"; var Result: Boolean; var IsHandled: Boolean) - begin - if IsHandled then - exit; - if DirectTransHeader."Intrastat Exclude CZ" then begin - Result := false; - IsHandled := true; - end; - end; -#endif #endregion #region EU 3-Party Trade functions diff --git a/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportSetupCZ.PageExt.al b/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportSetupCZ.PageExt.al index 6d39d1ecbd..5c24b7c24e 100644 --- a/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportSetupCZ.PageExt.al +++ b/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportSetupCZ.PageExt.al @@ -36,51 +36,5 @@ pageextension 31342 "Intrastat Report Setup CZ" extends "Intrastat Report Setup" ApplicationArea = Basic, Suite; } } -#if not CLEAN26 - addafter(Numbering) - { - group("Mandatory Fields") - { - Caption = 'Mandatory Fields'; - Visible = false; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'This group is moved to Intrastat Core extension.'; - - field("Transaction Type Mandatory CZ"; Rec."Transaction Type Mandatory CZ") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies this option to make transaction type specification mandatory.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'This field is moved to Intrastat Core extension.'; - } - field("Transaction Spec. Mandatory CZ"; Rec."Transaction Spec. Mandatory CZ") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies if you are using a mandatory transaction specification for reporting.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'This field is moved to Intrastat Core extension.'; - } - field("Transport Method Mandatory CZ"; Rec."Transport Method Mandatory CZ") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies this option to make transport method specification mandatory.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'This field is moved to Intrastat Core extension.'; - } - field("Shipment Method Mandatory CZ"; Rec."Shipment Method Mandatory CZ") - { - ApplicationArea = Basic, Suite; - ToolTip = 'Specifies this option to make shipment method specification mandatory.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'This field is moved to Intrastat Core extension.'; - } - } - } -#endif } } \ No newline at end of file diff --git a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/IntrastatReportSetupCZ.TableExt.al b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/IntrastatReportSetupCZ.TableExt.al index 3aa384aab3..280c990bee 100644 --- a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/IntrastatReportSetupCZ.TableExt.al +++ b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/IntrastatReportSetupCZ.TableExt.al @@ -33,52 +33,32 @@ tableextension 31326 "Intrastat Report Setup CZ" extends "Intrastat Report Setup Caption = 'Transaction Type Mandatory'; DataClassification = CustomerContent; ObsoleteReason = 'Use "Transaction Type Mandatory" from Intrastat Core extension instead.'; -#if CLEAN26 ObsoleteState = Removed; ObsoleteTag = '29.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#endif } field(31306; "Transaction Spec. Mandatory CZ"; Boolean) { Caption = 'Transaction Spec. Mandatory'; DataClassification = CustomerContent; ObsoleteReason = 'Use "Transaction Spec. Mandatory" from Intrastat Core extension instead.'; -#if CLEAN26 ObsoleteState = Removed; ObsoleteTag = '29.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#endif } field(31307; "Transport Method Mandatory CZ"; Boolean) { Caption = 'Transport Method Mandatory'; DataClassification = CustomerContent; ObsoleteReason = 'Use "Transport Method Mandatory" from Intrastat Core extension instead.'; -#if CLEAN26 ObsoleteState = Removed; ObsoleteTag = '29.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#endif } field(31308; "Shipment Method Mandatory CZ"; Boolean) { Caption = 'Shipment Method Mandatory'; DataClassification = CustomerContent; ObsoleteReason = 'Use "Shipment Method Mandatory" from Intrastat Core extension instead.'; -#if CLEAN26 ObsoleteState = Removed; ObsoleteTag = '29.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#endif } #endif field(31310; "Intrastat Rounding Type CZ"; Enum "Intrastat Rounding Type CZ") diff --git a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/PurchaseHeaderCZ.TableExt.al b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/PurchaseHeaderCZ.TableExt.al index fc04f299e0..2e39a8942b 100644 --- a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/PurchaseHeaderCZ.TableExt.al +++ b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/PurchaseHeaderCZ.TableExt.al @@ -41,26 +41,6 @@ tableextension 31328 "Purchase Header CZ" extends "Purchase Header" IntrastatReportSetup: Record "Intrastat Report Setup"; IntrastatReportManagementCZ: Codeunit IntrastatReportManagementCZ; -#if not CLEAN26 - [Obsolete('Pending removal. Use CheckIntrastatMandatoryFields from Intrastat Core extension instead.', '26.0')] - procedure CheckIntrastatMandatoryFieldsCZ() - begin - if not (Ship or Receive) then - exit; - if not IntrastatReportSetup.Get() then - exit; - if IsIntrastatTransactionCZL() and ShipOrReceiveInventoriableTypeItemsCZL() then begin - if IntrastatReportSetup."Transaction Type Mandatory CZ" then - TestField("Transaction Type"); - if IntrastatReportSetup."Transaction Spec. Mandatory CZ" then - TestField("Transaction Specification"); - if IntrastatReportSetup."Transport Method Mandatory CZ" then - TestField("Transport Method"); - if IntrastatReportSetup."Shipment Method Mandatory CZ" then - TestField("Shipment Method Code"); - end; - end; -#endif procedure GetPartnerBasedOnSetupCZ() Vendor: Record Vendor begin exit(IntrastatReportManagementCZ.GetVendorBasedOnSetup("Buy-from Vendor No.", "Pay-to Vendor No.")); diff --git a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/SalesHeaderCZ.TableExt.al b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/SalesHeaderCZ.TableExt.al index 2340ea2b82..bce2ae9375 100644 --- a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/SalesHeaderCZ.TableExt.al +++ b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/SalesHeaderCZ.TableExt.al @@ -41,26 +41,6 @@ tableextension 31327 "Sales Header CZ" extends "Sales Header" IntrastatReportSetup: Record "Intrastat Report Setup"; IntrastatReportManagementCZ: Codeunit IntrastatReportManagementCZ; -#if not CLEAN26 - [Obsolete('Pending removal. Use CheckIntrastatMandatoryFields from Intrastat Core extension instead.', '26.0')] - procedure CheckIntrastatMandatoryFieldsCZ() - begin - if not (Ship or Receive) then - exit; - if not IntrastatReportSetup.Get() then - exit; - if IsIntrastatTransactionCZL() and ShipOrReceiveInventoriableTypeItemsCZL() then begin - if IntrastatReportSetup."Transaction Type Mandatory CZ" then - TestField("Transaction Type"); - if IntrastatReportSetup."Transaction Spec. Mandatory CZ" then - TestField("Transaction Specification"); - if IntrastatReportSetup."Transport Method Mandatory CZ" then - TestField("Transport Method"); - if IntrastatReportSetup."Shipment Method Mandatory CZ" then - TestField("Shipment Method Code"); - end; - end; -#endif procedure GetPartnerBasedOnSetupCZ() Customer: Record Customer begin exit(IntrastatReportManagementCZ.GetCustomerBasedOnSetup("Sell-to Customer No.", "Bill-to Customer No.")); diff --git a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/TransferHeaderCZ.TableExt.al b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/TransferHeaderCZ.TableExt.al index 74eb0001ad..a279cca51d 100644 --- a/Apps/CZ/IntrastatCZ/app/src/TableExtensions/TransferHeaderCZ.TableExt.al +++ b/Apps/CZ/IntrastatCZ/app/src/TableExtensions/TransferHeaderCZ.TableExt.al @@ -16,25 +16,4 @@ tableextension 31329 "Transfer Header CZ" extends "Transfer Header" DataClassification = CustomerContent; } } - -#if not CLEAN26 - [Obsolete('Pending removal. Use CheckIntrastatMandatoryFields from Intrastat Core extension instead.', '26.0')] - procedure CheckIntrastatMandatoryFieldsCZ() - var - IntrastatReportSetup: Record "Intrastat Report Setup"; - begin - if not IntrastatReportSetup.Get() then - exit; - if IsIntrastatTransactionCZL() and ShipOrReceiveInventoriableTypeItemsCZL() then begin - if IntrastatReportSetup."Transaction Type Mandatory CZ" then - TestField("Transaction Type"); - if IntrastatReportSetup."Transaction Spec. Mandatory CZ" then - TestField("Transaction Specification"); - if IntrastatReportSetup."Transport Method Mandatory CZ" then - TestField("Transport Method"); - if IntrastatReportSetup."Shipment Method Mandatory CZ" then - TestField("Shipment Method Code"); - end; - end; -#endif } \ No newline at end of file diff --git a/Apps/DE/Elster/app/src/Install/ElsterDataMigration.Codeunit.al b/Apps/DE/Elster/app/src/Install/ElsterDataMigration.Codeunit.al deleted file mode 100644 index c82a674d48..0000000000 --- a/Apps/DE/Elster/app/src/Install/ElsterDataMigration.Codeunit.al +++ /dev/null @@ -1,15 +0,0 @@ -#pragma warning disable AA0247 -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ - -codeunit 11022 "Elster - Data Migration" -{ - Subtype = Upgrade; - ObsoleteReason = 'This codeunit is obsolete and will be removed in a future release.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -} -#endif diff --git a/Apps/DE/IntrastatDE/app/AppResources/DE_DataExchDefMap.xml b/Apps/DE/IntrastatDE/app/AppResources/DE_DataExchDefMap.xml index b89d24ffd4..b123be2112 100644 --- a/Apps/DE/IntrastatDE/app/AppResources/DE_DataExchDefMap.xml +++ b/Apps/DE/IntrastatDE/app/AppResources/DE_DataExchDefMap.xml @@ -120,7 +120,7 @@ - + @@ -133,12 +133,11 @@ - - - - - - + + + + + @@ -298,8 +297,7 @@ - - + TRANSACTIONACODE Transaction A Code @@ -319,7 +317,7 @@ - + TRANSACTIONBCODE Transaction B Code @@ -339,8 +337,8 @@ - - + + @@ -348,7 +346,6 @@ - @@ -583,4 +580,4 @@ - \ No newline at end of file + diff --git a/Apps/DE/IntrastatDE/app/src/IntrastatReportDEUpgrade.Codeunit.al b/Apps/DE/IntrastatDE/app/src/IntrastatReportDEUpgrade.Codeunit.al index e7182d7f34..015fed199d 100644 --- a/Apps/DE/IntrastatDE/app/src/IntrastatReportDEUpgrade.Codeunit.al +++ b/Apps/DE/IntrastatDE/app/src/IntrastatReportDEUpgrade.Codeunit.al @@ -14,6 +14,7 @@ codeunit 11034 IntrastatReportDEUpgrade trigger OnUpgradePerCompany() begin UpdateLinesType(); + UpdateDefaultDataExchangeDef(); end; local procedure UpdateLinesType() @@ -37,8 +38,34 @@ codeunit 11034 IntrastatReportDEUpgrade UpgradeTag.SetUpgradeTag(GetIntrastatTypeUpdateTag()); end; + local procedure UpdateDefaultDataExchangeDef() + var + DataExchDef: Record "Data Exch. Def"; + IntrastatReportManagementDE: Codeunit IntrastatReportManagementDE; + UpgradeTag: Codeunit "Upgrade Tag"; + begin + if UpgradeTag.HasUpgradeTag(GetIntrastatDERcptPartnerIDRemovalTag()) then + exit; + + if DataExchDef.Get('INTRA-2022-DE') then + IntrastatReportManagementDE.CreateDefaultDataExchangeDef(); + + UpgradeTag.SetUpgradeTag(GetIntrastatDERcptPartnerIDRemovalTag()); + end; + internal procedure GetIntrastatTypeUpdateTag(): Code[250] begin exit('MS-481518-IntrastatTypeUpdateDE-20230818'); end; + + internal procedure GetIntrastatDERcptPartnerIDRemovalTag(): Code[250] + begin + exit('MS-622161-IntrastatDERcptPartnerIDRemoval-20260301'); + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] + local procedure RegisterUpgradeTags(var PerCompanyUpgradeTags: List of [Code[250]]) + begin + PerCompanyUpgradeTags.Add(GetIntrastatDERcptPartnerIDRemovalTag()); + end; } diff --git a/Apps/DE/IntrastatDE/app/src/IntrastatReportManagementDE.Codeunit.al b/Apps/DE/IntrastatDE/app/src/IntrastatReportManagementDE.Codeunit.al index d0337be900..de163a721e 100644 --- a/Apps/DE/IntrastatDE/app/src/IntrastatReportManagementDE.Codeunit.al +++ b/Apps/DE/IntrastatDE/app/src/IntrastatReportManagementDE.Codeunit.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -472,11 +472,11 @@ codeunit 11029 IntrastatReportManagementDE Locked = true; // will be replaced with file import when available DataExchangeXMLP2Txt: Label '', Locked = true; // will be replaced with file import when available - DataExchangeXMLP3Txt: Label '', + DataExchangeXMLP3Txt: Label '', Locked = true; // will be replaced with file import when available - DataExchangeXMLP4Txt: Label 'ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer', + DataExchangeXMLP4Txt: Label 'ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer', Locked = true; // will be replaced with file import when available - DataExchangeXMLP5Txt: Label '1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=TRANSACTIONACODETransaction A Code41100000.00TRANSACTIONBCODETransaction B Code42100000.00', + DataExchangeXMLP5Txt: Label '1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=TRANSACTIONACODETransaction A Code41100000.00TRANSACTIONBCODETransaction B Code42100000.00', Locked = true; // will be replaced with file import when available DataExchangeXMLP6Txt: Label 'ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer1400ALPHANUM_ONLY00001.00=ALPHANUM_ONLYAlphanumeric Text Only70000000.00ROUNDTOINTRound to integer14', Locked = true; // will be replaced with file import when available diff --git a/Apps/DK/OIOUBL/app/src/Init/OIOUBLInitialize.Codeunit.al b/Apps/DK/OIOUBL/app/src/Init/OIOUBLInitialize.Codeunit.al index 8fe4843cc6..6b73318ee8 100644 --- a/Apps/DK/OIOUBL/app/src/Init/OIOUBLInitialize.Codeunit.al +++ b/Apps/DK/OIOUBL/app/src/Init/OIOUBLInitialize.Codeunit.al @@ -35,16 +35,7 @@ codeunit 13624 "OIOUBL-Initialize" OIOUBLProfileIDTxt: Label 'Procurement-OrdSimR-BilSim-1.0', Locked = true; trigger OnInstallAppPerCompany() -#if not CLEAN26 - var - AppInfo: ModuleInfo; -#endif begin -#if not CLEAN26 - NavApp.GetCurrentModuleInfo(AppInfo); - if AppInfo.DataVersion() = Version.Create('0.0.0.0') then - CODEUNIT.Run(CODEUNIT::"OIOUBL-MigrateToExtV2"); -#endif CompanyInitialize(); end; diff --git a/Apps/DK/OIOUBL/app/src/upgrade/OIOUBLMigrateToExtV2.Codeunit.al b/Apps/DK/OIOUBL/app/src/upgrade/OIOUBLMigrateToExtV2.Codeunit.al deleted file mode 100644 index 00954c1dc9..0000000000 --- a/Apps/DK/OIOUBL/app/src/upgrade/OIOUBLMigrateToExtV2.Codeunit.al +++ /dev/null @@ -1,16 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.EServices.EDocument; - -codeunit 13623 "OIOUBL-MigrateToExtV2" -{ - Subtype = Install; - ObsoleteReason = 'This codeunit is obsolete and will be removed in a future release.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -} - -#endif \ No newline at end of file diff --git a/Apps/FR/PaymentManagementFR/app/src/Reports/SuggestVendPayments.Report.al b/Apps/FR/PaymentManagementFR/app/src/Reports/SuggestVendPayments.Report.al index b9a1db98a9..bcaadac285 100644 --- a/Apps/FR/PaymentManagementFR/app/src/Reports/SuggestVendPayments.Report.al +++ b/Apps/FR/PaymentManagementFR/app/src/Reports/SuggestVendPayments.Report.al @@ -20,7 +20,7 @@ report 10850 "Suggest Vend. Payments" { dataitem(Vendor; Vendor) { - DataItemTableView = sorting("No."); + DataItemTableView = sorting("No.") where(Blocked = filter(" ")); RequestFilterFields = "No.", "Payment Method Code"; trigger OnAfterGetRecord() diff --git a/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al b/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al index 3ff386f660..75feb99251 100644 --- a/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al +++ b/Apps/FR/PaymentManagementFR/test/src/RegularTests/ERMPaymentManagementII.Codeunit.al @@ -405,6 +405,41 @@ codeunit 144017 "ERM Payment Management II" PaymentHeader.TestField("File Export Completed", false); end; + [Test] + [HandlerFunctions('PaymentClassListModalPageHandler,SuggestVendorPaymentsFRRequestPageHandler')] + procedure BlockedPaymentVendorExcludedFromSuggestVendorPayments() + var + Vendor: Record Vendor; + PaymentLine: Record "Payment Line FR"; + PaymentClass: Record "Payment Class FR"; + PaymentSlip: TestPage "Payment Slip FR"; + VendorNo: Code[20]; + PaymentClassCode: Text[30]; + SummarizePer: Option " ",Vendor,"Due date"; + begin + // [SCENARIO 623072] Blocked vendor with Blocked = Payment is excluded from Suggest Vendor Payments report. + + // [GIVEN] A vendor with a posted purchase invoice, then set as Blocked = Payment. + Initialize(); + VendorNo := CreateAndPostPurchaseInvoice(''); + Vendor.Get(VendorNo); + Vendor.Validate(Blocked, Vendor.Blocked::Payment); + Vendor.Modify(true); + + // [GIVEN] A payment slip configured for Vendor suggestions. + PaymentClassCode := CreatePaymentSlip(PaymentClass.Suggestions::Vendor, ''); + OpenPaymentSlip(PaymentSlip, PaymentClassCode); + EnqueueValuesForHandler(VendorNo, '', SummarizePer::" "); + + // [WHEN] Suggest Vendor Payments is invoked. + PaymentSlip.SuggestVendorPayments.Invoke(); + + // [THEN] No payment lines are created for the blocked vendor. + PaymentLine.SetRange("Payment Class", PaymentClassCode); + PaymentLine.SetRange("Account No.", VendorNo); + Assert.RecordIsEmpty(PaymentLine); + end; + local procedure Initialize() var PaymentClass: Record "Payment Class FR"; diff --git a/Apps/IN/INFADepreciation/app/src/page/FixedAssetShifts.Page.al b/Apps/IN/INFADepreciation/app/src/page/FixedAssetShifts.Page.al index 36195a8828..a9e7180322 100644 --- a/Apps/IN/INFADepreciation/app/src/page/FixedAssetShifts.Page.al +++ b/Apps/IN/INFADepreciation/app/src/page/FixedAssetShifts.Page.al @@ -27,24 +27,6 @@ page 18633 "Fixed Asset Shifts" ToolTip = 'Specifies the depreciation book code.'; ApplicationArea = FixedAssets; } -#if not CLEAN26 - field("FA Posting Group"; Rec."FA Posting Group") - { - Editable = false; - ToolTip = 'Specifies the fixed asset posting group.'; - ApplicationArea = FixedAssets; - ObsoleteState = Pending; - ObsoleteReason = 'New field introduced as Fixed Asset Posting Group'; - ObsoleteTag = '23.0'; - - trigger OnValidate() - var - FAPostingGroupsErr: Label 'This field has been depricated, use a new field Fixed Asset Posting Group.'; - begin - Error(FAPostingGroupsErr); - end; - } -#endif field("Fixed Asset Posting Group"; Rec."Fixed Asset Posting Group") { Editable = false; diff --git a/Apps/IN/INFADepreciation/app/src/table/FixedAssetShift.Table.al b/Apps/IN/INFADepreciation/app/src/table/FixedAssetShift.Table.al index e00d27bb81..cbb4866327 100644 --- a/Apps/IN/INFADepreciation/app/src/table/FixedAssetShift.Table.al +++ b/Apps/IN/INFADepreciation/app/src/table/FixedAssetShift.Table.al @@ -198,15 +198,10 @@ table 18633 "Fixed Asset Shift" Caption = 'FA Posting Group'; DataClassification = CustomerContent; ObsoleteReason = 'New field introduced as Fixed Asset Posting Group'; -#if CLEAN26 ObsoleteState = Removed; #pragma warning disable AS0072 ObsoleteTag = '26.0'; #pragma warning restore AS0072 -#else - ObsoleteState = Pending; - ObsoleteTag = '23.0'; -#endif #endif trigger OnValidate() begin diff --git a/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrder.Page.al b/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrder.Page.al index 1c2dc9ff0a..f6c8872188 100644 --- a/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrder.Page.al +++ b/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrder.Page.al @@ -12,9 +12,6 @@ using Microsoft.Purchases.Comment; using Microsoft.Purchases.Document; using Microsoft.Purchases.History; using Microsoft.Purchases.Posting; -#if not CLEAN26 -using Microsoft.Purchases.Setup; -#endif using Microsoft.Purchases.Vendor; using Microsoft.Utilities; using Microsoft.Warehouse.Document; @@ -436,30 +433,6 @@ page 18491 "Subcontracting Order" ShortCutKey = 'Shift+Ctrl+L'; ApplicationArea = Basic, Suite; } -#if not CLEAN26 - action(Statistics) - { - Caption = 'Statistics'; - ToolTip = 'Statistics'; - Image = Statistics; - Promoted = true; - PromotedCategory = Process; - ShortCutKey = 'F7'; - ApplicationArea = Basic, Suite; - ObsoleteReason = 'The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - trigger OnAction() - begin - PurchSetup.Get(); - if PurchSetup."Calc. Inv. Discount" then begin - CurrPage.PurchLines.Page.CalcInvDisc(); - Commit(); - end; - Rec.OpenPurchaseOrderStatistics(); - end; - } -#endif action(PurchaseOrderStatistics) { ApplicationArea = Basic, Suite; @@ -467,11 +440,7 @@ page 18491 "Subcontracting Order" Enabled = Rec."No." <> ''; Image = Statistics; ShortCutKey = 'F7'; -#if CLEAN26 Visible = true; -#else - Visible = false; -#endif ToolTip = 'View statistical information, such as the value of posted entries, for the record.'; RunObject = Page "Purchase Order Statistics"; RunPageOnRec = true; @@ -804,9 +773,6 @@ page 18491 "Subcontracting Order" end; var -#if not CLEAN26 - PurchSetup: Record "Purchases & Payables Setup"; -#endif CopyPurchDoc: Report "Copy Purchase Document"; MoveNegPurchLines: Report "Move Negative Purchase Lines"; ReportPrint: Codeunit "Test Report-Print"; diff --git a/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSales.Codeunit.al b/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSales.Codeunit.al index 31b2527f88..e6bc45f2b0 100644 --- a/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSales.Codeunit.al +++ b/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSales.Codeunit.al @@ -113,85 +113,6 @@ codeunit 18916 "TCS On Sales" Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355108] Check if the program is calculating TCS using Sales Order with G/L Account Invoice in case of shipment only. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderTCSVerifyAndGLShipment() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - DocumentNo: Code[20]; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::"G/L Account", - false); - - // [THEN] TCS and G/L verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - DocumentNo := LibrarySales.PostSalesDocument(SalesHeader, true, false); - TCSLibrary.VerifyGLEntryCount(DocumentNo, 0); - TCSLibrary.VerifyTCSEntryCount(DocumentNo, false, 0, 0); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355109] Check if the program is calculating TCS using Sales Order with Item in case of shipment only. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderTCSVerifyAndItemShipment() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - DocumentNo: Code[20]; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::Item, - false); - - // [THEN] TCS and G/L Entry Verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - DocumentNo := LibrarySales.PostSalesDocument(SalesHeader, true, false); - TCSLibrary.VerifyGLEntryCount(DocumentNo, 0); - TCSLibrary.VerifyTCSEntryCount(DocumentNo, false, 0, 0); - end; -#endif // [SCENARIO] [355108] Check if the program is calculating TCS using Sales Order with G/L Account Invoice in case of shipment only. [Test] [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandlerNM')] @@ -268,77 +189,6 @@ codeunit 18916 "TCS On Sales" TCSLibrary.VerifyTCSEntryCount(DocumentNo, false, 0, 0); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355208] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Credit Memo. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandler')] - procedure SalesCreditMemoWithItemAndStatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Credit Memo - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::"Credit Memo", - Customer."No.", - WorkDate(), - SalesLine.Type::Item, - false); - - // [THEN] Verify Statistics - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355209] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Return Order. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure SalesReturmOrderWithItemStatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Return Order - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::"Return Order", - Customer."No.", - WorkDate(), - SalesLine.Type::Item, - false); - - // [THEN] Verify Statistics - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; -#endif // [SCENARIO] [355208] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Credit Memo. [Test] [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandlerNM')] @@ -1017,50 +867,6 @@ codeunit 18916 "TCS On Sales" Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355120] Check if the program is calculating TCS using Sales Order Charge Items where TCS is applicable only on selected lines. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderWithMultiLineItemChargeAndSingleNoc() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - ItemNo: Code[20]; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::"Charge (Item)", - false); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - SalesLine.Validate("TCS Nature of Collection", ''); - SalesLine.Modify(true); - - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - if SalesLine.FindFirst() then begin - ItemNo := SalesLine."No."; - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; - // [THEN] Show expected error - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, ItemNo)); - end; -#endif // [SCENARIO] [355120] Check if the program is calculating TCS using Sales Order Charge Items where TCS is applicable only on selected lines. [Test] [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandlerNM')] @@ -1103,80 +909,6 @@ codeunit 18916 "TCS On Sales" Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, ItemNo)); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355121] Check if the program is calculating TCS using Sales Invoice Charge Items where TCS is applicable only on selected lines. - // [SCENARIO] [355122] Check if the program is calculating TCS using Sales Invoice Charge Items in case of shipment only. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandler')] - procedure PostFromSalesInvoiceWithMultiLineItemChargeAndSingleNoc() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - ItemNo: Code[20]; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Invoice - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Invoice, - Customer."No.", - WorkDate(), - SalesLine.Type::"Charge (Item)", - false); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - SalesLine.Validate("TCS Nature of Collection", ''); - SalesLine.Modify(true); - - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - if SalesLine.FindFirst() then begin - ItemNo := SalesLine."No."; - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; - // [THEN] Show expected error - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, ItemNo)); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355131] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Order/Invoice Charge Items. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderWithItemChargeStatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Order, Customer."No."); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [THEN] Show expected error - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); - end; -#endif // [SCENARIO] [355121] Check if the program is calculating TCS using Sales Invoice Charge Items where TCS is applicable only on selected lines. // [SCENARIO] [355122] Check if the program is calculating TCS using Sales Invoice Charge Items in case of shipment only. [Test] @@ -1372,12 +1104,10 @@ codeunit 18916 "TCS On Sales" TCSLibrary.VerifyGLEntryWithTCS(DocumentNo, TCSPostingSetup."TCS Account No."); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] // [SCENARIO] [355141] Check if the program is calculating TCS using Sales Order in case of Line Discount with Charge Items [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderTCSWithChargeItemAndLineDisc() + [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandlerNM')] + procedure PostFromSalesOrderTCSWithChargeItemAndLineDiscNM() var Customer: Record Customer; SalesHeader: Record "Sales Header"; @@ -1395,17 +1125,17 @@ codeunit 18916 "TCS On Sales" TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); LibraryVarStorage.Clear(); LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); + VerifyStatisticsForTCSNM(SalesHeader); asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); // [THEN] Show expected error Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); end; -#endif - // [SCENARIO] [355141] Check if the program is calculating TCS using Sales Order in case of Line Discount with Charge Items + + // [SCENARIO] [355142] Check if the program is calculating TCS using Sales Invoice in case of Line Discount with Charge Item [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandlerNM')] - procedure PostFromSalesOrderTCSWithChargeItemAndLineDiscNM() + [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandlerNM')] + procedure PostFromSalesInvoiceTCSWithChargeItemAndLineDiscNM() var Customer: Record Customer; SalesHeader: Record "Sales Header"; @@ -1418,87 +1148,29 @@ codeunit 18916 "TCS On Sales" TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - // [WHEN] Create and Post Sales Order - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Order, Customer."No."); + // [WHEN] Create and Post Sales Invoice + LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Invoice, Customer."No."); TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); LibraryVarStorage.Clear(); LibraryVarStorage.Enqueue(SalesLine); VerifyStatisticsForTCSNM(SalesHeader); - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); // [THEN] Show expected error + asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355142] Check if the program is calculating TCS using Sales Invoice in case of Line Discount with Charge Item + // [SCENARIO] [355248] Check if the program is calculating TCS using Credit Memo in case of Foreign Currency. [Test] - [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandler')] - procedure PostFromSalesInvoiceTCSWithChargeItemAndLineDisc() + [HandlerFunctions('TaxRatePageHandler')] + procedure PostFromSalesCrMemoWithGLForFCY() var Customer: Record Customer; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; TCSPostingSetup: Record "TCS Posting Setup"; ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Invoice - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Invoice, Customer."No."); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - - // [THEN] Show expected error - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); - end; -#endif - // [SCENARIO] [355142] Check if the program is calculating TCS using Sales Invoice in case of Line Discount with Charge Item - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandlerNM')] - procedure PostFromSalesInvoiceTCSWithChargeItemAndLineDiscNM() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Invoice - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Invoice, Customer."No."); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCSNM(SalesHeader); - - // [THEN] Show expected error - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); - end; - - // [SCENARIO] [355248] Check if the program is calculating TCS using Credit Memo in case of Foreign Currency. - [Test] - [HandlerFunctions('TaxRatePageHandler')] - procedure PostFromSalesCrMemoWithGLForFCY() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - DocumentNo: Code[20]; + DocumentNo: Code[20]; begin // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); @@ -2300,41 +1972,7 @@ codeunit 18916 "TCS On Sales" TCSLibrary.VerifyGLEntryCount(DocumentNo, 4); VerifyGLEntryWithTCS(DocumentNo, TCSPostingSetup."TCS Account No."); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355146] Check if the program is calculating TCS using Sales Order in case of Invoice Discount with Charge Items - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler,CustomerInvoiceDiscountPageHandler')] - procedure PostFromSalesOrderWithChargeItemAndInvoiceDiscount() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, true, true); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - CreateCustomerInvoiceDiscount(Customer."No."); - - // [WHEN] Create and Post Sales Order - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Order, Customer."No."); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - SalesLine.Validate("Allow Invoice Disc.", true); - SalesLine.Modify(true); - SalesCalcDiscount.Run(SalesLine); - SalesLine.Validate("Unit Price"); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - // [THEN] Check TCS Amount Show expected error - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); - end; -#endif // [SCENARIO] [355146] Check if the program is calculating TCS using Sales Order in case of Invoice Discount with Charge Items [Test] [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandlerNM,CustomerInvoiceDiscountPageHandler')] @@ -2368,41 +2006,6 @@ codeunit 18916 "TCS On Sales" Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355145] Check if the program is calculating TCS using Sales Invoice in case of Invoice Discount with Charge Items - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandler,CustomerInvoiceDiscountPageHandler')] - procedure PostFromSalesInvoiceWithChargeItemAndInvoiceDiscount() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, true, true); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - CreateCustomerInvoiceDiscount(Customer."No."); - - // [WHEN] Create and Post Sales Order - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Invoice, Customer."No."); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - SalesLine.Validate("Allow Invoice Disc.", true); - SalesLine.Modify(true); - SalesCalcDiscount.Run(SalesLine); - SalesLine.Validate("Unit Price"); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [THEN] Show expected error - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); - end; -#endif // [SCENARIO] [355145] Check if the program is calculating TCS using Sales Invoice in case of Invoice Discount with Charge Items [Test] [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandlerNM,CustomerInvoiceDiscountPageHandler')] @@ -3519,46 +3122,6 @@ codeunit 18916 "TCS On Sales" TCSSalesLibrary.VerifyTCSEntryForFAandResource(DocumentNo); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355110] Check if the program is calculating TCS using Sales Order/Invoice with Fixed Assets in case of shipment only. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderTCSVerifyAndFAShipment() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - DocumentNo: Code[20]; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::"Fixed Asset", - false); - - // [THEN] TCS and G/L verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - DocumentNo := LibrarySales.PostSalesDocument(SalesHeader, true, false); - TCSLibrary.VerifyGLEntryCount(DocumentNo, 0); - TCSLibrary.VerifyTCSEntryCount(DocumentNo, false, 0, 0); - end; -#endif // [SCENARIO] [355110] Check if the program is calculating TCS using Sales Order/Invoice with Fixed Assets in case of shipment only. [Test] [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandlerNM')] @@ -4397,99 +3960,6 @@ codeunit 18916 "TCS On Sales" TCSLibrary.VerifyTCSEntryForAssesseeCode(DocumentNo2, AssesseeCode2.Code); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [354882] Check if the program is calculating TCS using Sales Order in case of different rates for same NOC with different assessee codes with Charge Items. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderWithChargeItemAndDifferentAssesseeCode() - var - Customer: Record Customer; - Customer2: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - AssesseeCode2: Record "Assessee Code"; - ConcessionalCode: Record "Concessional Code"; - TCSNatureOfCollection: Record "TCS Nature Of Collection"; - AssesseeCode: Record "Assessee Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateAccPeriodAndFillCompInfo(); - TCSLibrary.CreateTCSPostingSetupWithNOC(TCSPostingSetup, TCSNatureOfCollection); - - //Create Tax rate with first Assessee Code - TCSLibrary.CreateNOCWithCustomer(TCSPostingSetup."TCS Nature of Collection", Customer); - TCSLibrary.UpdateCustomerAssesseeAndConcessionalCode(Customer, AssesseeCode, ConcessionalCode, TCSPostingSetup."TCS Nature of Collection"); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Invoice for first Assessee Code - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Order, Customer."No."); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [THEN] Show expected error - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); - - //Create Tax rate with second Assessee Code - TCSLibrary.CreateNOCWithCustomer(TCSPostingSetup."TCS Nature of Collection", Customer2); - TCSLibrary.UpdateCustomerAssesseeAndConcessionalCode(Customer2, AssesseeCode2, ConcessionalCode, TCSPostingSetup."TCS Nature of Collection"); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer2."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Invoice for second Assessee Code - LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Order, Customer2."No."); - TCSSalesLibrary.CreateSalesLine(SalesHeader, SalesLine, SalesLine.Type::"Charge (Item)", false); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - asserterror LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [THEN] Show expected error - Assert.ExpectedError(StrSubstNo(ItemChargePostingErr, SalesLine."No.")); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355111] Check if the program is calculating TCS using Sales Order with Resources in case of shipment only. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure PostFromSalesOrderTCSVerifyAndResourceShipment() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - DocumentNo: Code[20]; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::Resource, - false); - - // [THEN] TCS and G/L verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - DocumentNo := LibrarySales.PostSalesDocument(SalesHeader, true, false); - TCSLibrary.VerifyGLEntryCount(DocumentNo, 0); - TCSLibrary.VerifyTCSEntryCount(DocumentNo, false, 0, 0); - end; -#endif // [SCENARIO] [354882] Check if the program is calculating TCS using Sales Order in case of different rates for same NOC with different assessee codes with Charge Items. [Test] [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandlerNM')] @@ -4612,182 +4082,6 @@ codeunit 18916 "TCS On Sales" TCSLibrary.VerifyGLEntryAdditionalCurrencyAmt('', DocumentNo); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355128] Check if the program is calculating TCS using Credit Memo in case of Fixed Assets - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandler')] - procedure SalesInvoiceTCSWithFAAndStatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Return Order - TCSSalesLibrary.CreateSalesDocumentWithFCY( - SalesHeader, - SalesHeader."Document Type"::Invoice, - Customer."No.", - WorkDate(), - SalesLine.Type::"Fixed Asset", - false); - - // [THEN] TCS and G/L Entry Created and Verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355129] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Order with Fixed Assets. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure SalesOrderTCSWithFAAndStatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order for Fixed Asset - TCSSalesLibrary.CreateSalesDocumentWithFCY( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::"Fixed Asset", - false); - - // [THEN] TCS and G/L Entry Created and Verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355130] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Order/Invoice with Resources. - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure SalesOrderTCSWithResourceAndStatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Order for Fixed Asset - TCSSalesLibrary.CreateSalesDocumentWithFCY( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::Resource, - false); - - // [THEN] TCS and G/L Entry Created and Verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355216] Check if the program is calculating TCS using Credit Memo in case of Fixed Assets - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandler')] - procedure SalesCreditMemoTCSWithFAAndStatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Return Order - TCSSalesLibrary.CreateSalesDocumentWithFCY( - SalesHeader, - SalesHeader."Document Type"::"Credit Memo", - Customer."No.", - WorkDate(), - SalesLine.Type::"Fixed Asset", - false); - - // [THEN] TCS and G/L Entry Created and Verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - // [SCENARIO] [355217] Check if the program is calculating TCS using Return Order in case of Fixed Assets - [Test] - [HandlerFunctions('TaxRatePageHandler,SalesOrderStatisticsPageHandler')] - procedure SalesReturnOrderTCSWithFAAndSatsVerify() - var - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - begin - // [GIVEN] Created Setup for NOC, Assessee Code, Customer, TCS Setup, Tax Accounting Period and TCS Rates - TCSLibrary.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - TCSLibrary.UpdateCustomerWithPANWithConcessional(Customer, false, false); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", ConcessionalCode.Code, WorkDate()); - - // [WHEN] Create and Post Sales Return Order - TCSSalesLibrary.CreateSalesDocumentWithFCY( - SalesHeader, - SalesHeader."Document Type"::"Return Order", - Customer."No.", - WorkDate(), - SalesLine.Type::"Fixed Asset", - false); - - // [THEN] TCS and G/L Entry Created and Verified - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindFirst(); - LibraryVarStorage.Clear(); - LibraryVarStorage.Enqueue(SalesLine); - VerifyStatisticsForTCS(SalesHeader); - end; -#endif // [SCENARIO] [355128] Check if the program is calculating TCS using Credit Memo in case of Fixed Assets [Test] [HandlerFunctions('TaxRatePageHandler,SalesStatisticsPageHandlerNM')] @@ -5355,91 +4649,6 @@ codeunit 18916 "TCS On Sales" TCSNatureOfCollections.Filter.SetFilter(Code, Storage.Get(TCSNOCTypeLbl)); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - local procedure VerifyStatisticsForTCS(var Salesheader: Record "Sales Header") - var - PageSalesOrder: TestPage "Sales Order list"; - PageSalesInvoiceList: TestPage "Sales Invoice List"; - PageSalesCreditMemo: TestPage "Sales Credit Memos"; - PageSalesReturnOrder: TestPage "Sales Return Order List"; - begin - case Salesheader."Document Type" of - Salesheader."Document Type"::Order: - begin - PageSalesOrder.OpenView(); - PageSalesOrder.Filter.SetFilter("No.", Salesheader."No."); - PageSalesOrder.Statistics.Invoke(); - end; - Salesheader."Document Type"::Invoice: - begin - PageSalesInvoiceList.OpenView(); - PageSalesInvoiceList.Filter.SetFilter("No.", Salesheader."No."); - PageSalesInvoiceList.Statistics.Invoke(); - end; - Salesheader."Document Type"::"Credit Memo": - begin - PageSalesCreditMemo.OpenView(); - PageSalesCreditMemo.Filter.SetFilter("No.", Salesheader."No."); - PageSalesCreditMemo.Statistics.Invoke(); - end; - Salesheader."Document Type"::"Return Order": - begin - PageSalesReturnOrder.OpenView(); - PageSalesReturnOrder.Filter.SetFilter("No.", Salesheader."No."); - PageSalesReturnOrder.Statistics.Invoke(); - end; - end; - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [ModalPageHandler] - procedure SalesStatisticsPageHandler(var SalesStatistics: TestPage "Sales Statistics") - var - SalesLine: Record "Sales Line"; - TCSAmount: Decimal; - Record: Variant; - begin - LibraryVarStorage.Dequeue(Record); - SalesLine := Record; - case SalesLine.Type of - SalesLine.Type::"Fixed Asset", SalesLine.Type::Resource: - begin - TCSAmount := SalesStatistics."TCS Amount".AsDecimal(); - Assert.Equal(TCSAmount, 0); - end; - SalesLine.Type::Item, SalesLine.Type::"G/L Account", SalesLine.Type::"Charge (Item)": - begin - TCSAmount := SalesStatistics."TCS Amount".AsDecimal(); - Assert.AreNotEqual(TCSAmount, 0, 'TCS Calculated'); - end; - end; - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [ModalPageHandler] - procedure SalesOrderStatisticsPageHandler(var SalesOrderStatistics: TestPage "Sales Order Statistics") - var - SalesLine: Record "Sales Line"; - TCSAmount: Decimal; - Record: Variant; - begin - LibraryVarStorage.Dequeue(Record); - SalesLine := Record; - case SalesLine.Type of - SalesLine.Type::"Fixed Asset", SalesLine.Type::Resource: - begin - TCSAmount := SalesOrderStatistics."TCS Amount".AsDecimal(); - Assert.Equal(TCSAmount, 0); - end; - SalesLine.Type::Item, SalesLine.Type::"G/L Account", SalesLine.Type::"Charge (Item)": - begin - TCSAmount := SalesOrderStatistics."TCS Amount".AsDecimal(); - Assert.AreNotEqual(TCSAmount, 0, 'TCS Calculated'); - end; - end; - end; -#endif local procedure VerifyStatisticsForTCSNM(var Salesheader: Record "Sales Header") var PageSalesOrder: TestPage "Sales Order list"; diff --git a/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSalesDocuments.Codeunit.al b/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSalesDocuments.Codeunit.al index 1e2932c393..fb54717eb8 100644 --- a/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSalesDocuments.Codeunit.al +++ b/Apps/IN/INTCS/test/TCSOnSales/src/TCSOnSalesDocuments.Codeunit.al @@ -1719,127 +1719,6 @@ codeunit 18917 "TCS On Sales Documents" VerifyTCSEntry(DocumentNo, true, true, true); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,StatisticsPageHandler')] - procedure SalesOrderWithGLAccountVerifyStatistics() - var - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - begin - // [SCENARIO] [355124] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Order with G/L Account. - // [GIVEN] Created Setup for NOC, Assessee Code, Customer without PAN, TCS Setup and Tax Accounting Period - LibraryTCS.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - LibraryTCS.UpdateCustomerWithPANWithoutConcessional(Customer, true, true); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", '', WorkDate()); - - // [WHEN] Created Sales Order with G/L Account - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::"G/L Account", - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTCS(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,StatisticsPageHandler')] - procedure SalesOrderWithItemVerifyStatistics() - var - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - begin - // [SCENARIO] [355126] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Order with Item. - // [GIVEN] Created Setup for NOC, Assessee Code, Customer without PAN, TCS Setup and Tax Accounting Period - LibraryTCS.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - LibraryTCS.UpdateCustomerWithPANWithoutConcessional(Customer, true, true); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", '', WorkDate()); - - // [WHEN] Created Sales Order with Item - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Order, - Customer."No.", - WorkDate(), - SalesLine.Type::Item, - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTCS(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,InvoiceStatisticsPageHandler')] - procedure SalesInvoiceWithGLAccountVerifyStatistics() - var - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - begin - // [SCENARIO] [355125] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Invoice with G/L Account. - // [GIVEN] Created Setup for NOC, Assessee Code, Customer without PAN, TCS Setup and Tax Accounting Period - LibraryTCS.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - LibraryTCS.UpdateCustomerWithPANWithoutConcessional(Customer, true, true); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", '', WorkDate()); - - // [WHEN] Created Sales Invoice with G/L Account - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Invoice, - Customer."No.", - WorkDate(), - SalesLine.Type::"G/L Account", - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTCSWithInvoice(SalesHeader); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,InvoiceStatisticsPageHandler')] - procedure SalesInvoiceWithItemVerifyStatistics() - var - TCSPostingSetup: Record "TCS Posting Setup"; - ConcessionalCode: Record "Concessional Code"; - Customer: Record Customer; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - begin - // [SCENARIO] [355127] Check if the program is showing TCS amount should be shown in Statistics while creating Sales Invoice with Item. - // [GIVEN] Created Setup for NOC, Assessee Code, Customer without PAN, TCS Setup and Tax Accounting Period - LibraryTCS.CreateTCSSetup(Customer, TCSPostingSetup, ConcessionalCode); - LibraryTCS.UpdateCustomerWithPANWithoutConcessional(Customer, true, true); - CreateTaxRateSetup(TCSPostingSetup."TCS Nature of Collection", Customer."Assessee Code", '', WorkDate()); - - // [WHEN] Created Sales Invoice with Item - TCSSalesLibrary.CreateSalesDocument( - SalesHeader, - SalesHeader."Document Type"::Invoice, - Customer."No.", - WorkDate(), - SalesLine.Type::Item, - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTCSWithInvoice(SalesHeader); - end; -#endif [Test] [HandlerFunctions('TaxRatePageHandler,StatisticsPageHandlerNM')] procedure SalesOrderWithGLAccountVerifyStatisticsNM() @@ -3743,71 +3622,6 @@ codeunit 18917 "TCS On Sales Documents" exit(SalesInvoiceHeader."Currency Factor"); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - local procedure VerifyStatisticsForTCS(SalesHeader: Record "Sales Header") - var - SalesLine: Record "Sales Line"; - SalesOrders: TestPage "Sales Order List"; - ExpectedTCSAmount, ActualAmount, TCSPercentage, SurchargePercentage, eCessPercentage, SHECessPercentage : Decimal; - begin - Evaluate(TCSPercentage, Storage.Get(TCSPercentageLbl)); - Evaluate(SurchargePercentage, Storage.Get(SurchargePercentageLbl)); - Evaluate(eCessPercentage, Storage.Get(ECessPercentageLbl)); - Evaluate(SHECessPercentage, Storage.Get(SHECessPercentageLbl)); - - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindSet(); - repeat - ExpectedTCSAmount += SalesLine."Amount" * TCSPercentage / 100; - until SalesLine.Next() = 0; - ExpectedTCSAmount += ExpectedTCSAmount * SurchargePercentage / 100; - ExpectedTCSAmount += ExpectedTCSAmount * eCessPercentage / 100 + ExpectedTCSAmount * SHECessPercentage / 100; - ExpectedTCSAmount := LibraryTCS.RoundTCSAmount(ExpectedTCSAmount); - - SalesOrders.OpenEdit(); - SalesOrders.GoToRecord(SalesHeader); - SalesOrders.Statistics.Invoke(); - - Evaluate(ActualAmount, Storage.Get(StatsTCSAmountLbl)); - - Assert.AreNearlyEqual(ExpectedTCSAmount, ActualAmount, LibraryTCS.GetTCSRoundingPrecision(), - StrSubstNo(AmountErr, ActualAmount, ExpectedTCSAmount)); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - local procedure VerifyStatisticsForTCSWithInvoice(SalesHeader: Record "Sales Header") - var - SalesLine: Record "Sales Line"; - SalesOrders: TestPage "Sales Invoice List"; - ExpectedTCSAmount, ActualAmount, TCSPercentage, SurchargePercentage, eCessPercentage, SHECessPercentage : Decimal; - begin - Evaluate(TCSPercentage, Storage.Get(TCSPercentageLbl)); - Evaluate(SurchargePercentage, Storage.Get(SurchargePercentageLbl)); - Evaluate(eCessPercentage, Storage.Get(ECessPercentageLbl)); - Evaluate(SHECessPercentage, Storage.Get(SHECessPercentageLbl)); - - SalesLine.SetRange("Document Type", SalesHeader."Document Type"); - SalesLine.SetRange("Document No.", SalesHeader."No."); - SalesLine.FindSet(); - repeat - ExpectedTCSAmount += SalesLine."Amount" * TCSPercentage / 100; - until SalesLine.Next() = 0; - ExpectedTCSAmount += ExpectedTCSAmount * SurchargePercentage / 100; - ExpectedTCSAmount += ExpectedTCSAmount * eCessPercentage / 100 + ExpectedTCSAmount * SHECessPercentage / 100; - ExpectedTCSAmount := LibraryTCS.RoundTCSAmount(ExpectedTCSAmount); - - SalesOrders.OpenEdit(); - SalesOrders.GoToRecord(SalesHeader); - SalesOrders.Statistics.Invoke(); - - Evaluate(ActualAmount, Storage.Get(StatsTCSAmountLbl)); - - Assert.AreNearlyEqual(ExpectedTCSAmount, ActualAmount, LibraryTCS.GetTCSRoundingPrecision(), - StrSubstNo(AmountErr, ActualAmount, ExpectedTCSAmount)); - end; -#endif local procedure VerifyStatisticsForTCSNM(SalesHeader: Record "Sales Header") var SalesLine: Record "Sales Line"; @@ -4163,27 +3977,6 @@ codeunit 18917 "TCS On Sales Documents" Storage.Set(SurchargeThresholdAmountLbl, Format(LibraryRandom.RandIntInRange(4000, 6000))); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [ModalPageHandler] - procedure InvoiceStatisticsPageHandler(var SalesStatistics: TestPage "Sales Statistics"); - var - Amount: Text; - begin - Amount := SalesStatistics."TCS Amount".Value; - Storage.Set(StatsTCSAmountLbl, Amount); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [ModalPageHandler] - procedure StatisticsPageHandler(var SalesStatistics: TestPage "Sales Order Statistics") - var - Amount: Text; - begin - Amount := SalesStatistics."TCS Amount".Value; - Storage.Set(StatsTCSAmountLbl, Amount); - end; -#endif [PageHandler] procedure InvoiceStatisticsPageHandlerNM(var SalesStatistics: TestPage "Sales Statistics"); var diff --git a/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseInvoice.Codeunit.al b/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseInvoice.Codeunit.al index d2e1be92ed..cb6fbf0d5a 100644 --- a/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseInvoice.Codeunit.al +++ b/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseInvoice.Codeunit.al @@ -1051,37 +1051,6 @@ codeunit 18791 "TDS On Purchase Invoice" VerifyGLEntryCount(DocumentNo, 5); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,Statistics')] - procedure VerifyPurchaseInvoiceStatisticsWithItem() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [1395] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Invoice. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Created and Posted Purchase PurchaseHeader, - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Invoice, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::Item, - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,StatisticsPageHandler')] procedure VerifyPurchInvoiceStatisticsWithItem() @@ -1110,38 +1079,6 @@ codeunit 18791 "TDS On Purchase Invoice" VerifyStatsForTDS(PurchaseHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,Statistics')] - procedure VerifyPurchaseInvoiceStatisticsWithGLAccount() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [1395] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Invoice. - // [GIVEN] Created Setup for AssesseeCode,TDSPostingSetup,TDSSection,ConcessionalCode with Threshold and Surcharge Overlook. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Created Purchase Invoice With G/L Account - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Invoice, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::"G/L Account", - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,StatisticsPageHandler')] procedure VerifyPurchInvoiceStatisticsWithGLAccount() @@ -1171,38 +1108,6 @@ codeunit 18791 "TDS On Purchase Invoice" VerifyStatsForTDS(PurchaseHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,Statistics')] - procedure VerifyPurchaseInvoiceStatisticsWithFixedAsset() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [1395] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Invoice. - // [GIVEN] Created Setup for AssesseeCode,TDSPostingSetup,TDSSection,ConcessionalCode with Threshold and Surcharge Overlook. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Created Purchase Invoice with Fixed Asset - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Invoice, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::"Fixed Asset", - false); - - // [THEN] StatistiCS Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,StatisticsPageHandler')] procedure VerifyPurchInvoiceStatisticsWithFixedAsset() @@ -1232,38 +1137,6 @@ codeunit 18791 "TDS On Purchase Invoice" VerifyStatsForTDS(PurchaseHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,Statistics')] - procedure VerifyPurchaseInvoiceStatisticsWithChargeItem() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [1395] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Invoice. - // [GIVEN] Created Setup for AssesseeCode,TDSPostingSetup,TDSSection,ConcessionalCode with Threshold and Surcharge Overlook. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Create PurchaseInvoice with Charge item - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Invoice, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::"Charge (Item)", - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,StatisticsPageHandler')] procedure VerifyPurchInvoiceStatisticsWithChargeItem() @@ -1953,52 +1826,6 @@ codeunit 18791 "TDS On Purchase Invoice" PageTaxtype.TaxRates.Invoke(); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - local procedure VerifyStatisticsForTDS(var PurchaseHeader: Record "Purchase Header") - var - PurchaseLine: Record "Purchase Line"; - TaxTransactionValue: Record "Tax Transaction Value"; - TDSSetup: Record "TDS Setup"; - PurchaseInvoiceStatistics: TestPage "Purchase Statistics"; - PurchaseInvoice: TestPage "Purchase Invoices"; - RecordIDList: List of [RecordID]; - i: Integer; - ActualAmount: Decimal; - begin - Clear(ExpectedTDSAmount); - if not TDSSetup.Get() then - exit; - PurchaseLine.SetRange("Document Type", PurchaseHeader."Document Type"); - PurchaseLine.SetRange("Document no.", PurchaseHeader."No."); - if PurchaseLine.FindSet() then - repeat - RecordIDList.Add(PurchaseLine.RecordId()); - until PurchaseLine.Next() = 0; - - for i := 1 to RecordIDList.Count() do begin - TaxTransactionValue.SetRange("Tax Record ID", RecordIDList.Get(i)); - TaxTransactionValue.SetRange("Value Type", TaxTransactionValue."Value Type"::COMPONENT); - TaxTransactionValue.SetRange("Tax Type", TDSSetup."Tax Type"); - TaxTransactionValue.SetFilter(Percent, '<>%1', 0); - if not TaxTransactionValue.IsEmpty() then - TaxTransactionValue.CalcSums(Amount); - ExpectedTDSAmount += TaxTransactionValue.Amount; - end; - ExpectedTDSAmount := Round(ExpectedTDSAmount, 1, '='); - PurchaseInvoice.OpenEdit(); - PurchaseInvoice.GoToRecord(PurchaseHeader); - PurchaseInvoiceStatistics.OpenEdit(); - PurchaseInvoice.Statistics.Invoke(); - if (CopyStr(Storage.Get(TDSAmountLbl), StrPos(Storage.Get(TDSAmountLbl), '.'), StrLen(Storage.Get(TDSAmountLbl))) = '.00') then - Evaluate(ActualAmount, CopyStr(Storage.Get(TDSAmountLbl), 1, StrPos(Storage.Get(TDSAmountLbl), '.') - 1)) - else - Evaluate(ActualAmount, Storage.Get(TDSAmountLbl)); - Assert.AreNearlyEqual(Round(ExpectedTDSAmount, 0.01, '='), ActualAmount, 0, - StrSubstNo(AmountErr, ActualAmount, PurchaseInvoiceStatistics."TDS Amount".Caption())); - end; -#endif - local procedure VerifyStatsForTDS(var PurchaseHeader: Record "Purchase Header") var PurchaseLine: Record "Purchase Line"; @@ -2420,18 +2247,6 @@ codeunit 18791 "TDS On Purchase Invoice" TaxRates.OK().Invoke(); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [ModalPageHandler] - procedure Statistics(var PurchaseStatistics: TestPage "Purchase Statistics") - var - Amt: Text; - begin - Amt := (PurchaseStatistics."TDS Amount".Value); - Storage.Set(TDSAmountLbl, Amt); - end; -#endif - [PageHandler] procedure StatisticsPageHandler(var PurchaseStatistics: TestPage "Purchase Statistics") var diff --git a/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseOrder.Codeunit.al b/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseOrder.Codeunit.al index ad8af1792e..d65a8976ef 100644 --- a/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseOrder.Codeunit.al +++ b/Apps/IN/INTDS/test/TDSOnPurchase/src/TDSOnPurchaseOrder.Codeunit.al @@ -929,37 +929,6 @@ codeunit 18792 "TDS On Purchase Order" ; end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,PurchaseOrderStatsHandler')] - procedure VerifyPurchaseOrderStatisticsWithItem() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [354032] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Order. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Created and Posted Purchase Order - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Order, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::Item, - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,PurchOrderStatsHandler')] procedure VerifyPurchOrderStatisticsWithItem() @@ -988,38 +957,6 @@ codeunit 18792 "TDS On Purchase Order" VerifyStatsForTDS(PurchaseHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,PurchaseOrderStatsHandler')] - procedure VerifyPurchaseOrderStatisticsWithGLAccount() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [354032] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Order. - // [GIVEN] Created Setup for AssesseeCode,TDSPostingSetup,TDSSection,ConcessionalCode with Threshold and Surcharge Overlook. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Created and Posted Purchase Order - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Order, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::"G/L Account", - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,PurchOrderStatsHandler')] procedure VerifyPurchOrderStatisticsWithGLAccount() @@ -1049,38 +986,6 @@ codeunit 18792 "TDS On Purchase Order" VerifyStatsForTDS(PurchaseHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,PurchaseOrderStatsHandler')] - procedure VerifyPurchaseOrderStatisticsWithFixedAsset() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [354032] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Order. - // [GIVEN] Created Setup for AssesseeCode,TDSPostingSetup,TDSSection,ConcessionalCode with Threshold and Surcharge Overlook. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Created Purchase Order - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Order, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::"Fixed Asset", - false); - - // [THEN] StatistiCS Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,PurchOrderStatsHandler')] procedure VerifyPurchOrderStatisticsWithFixedAsset() @@ -1110,38 +1015,6 @@ codeunit 18792 "TDS On Purchase Order" VerifyStatsForTDS(PurchaseHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('TaxRatePageHandler,PurchaseOrderStatsHandler')] - procedure VerifyPurchaseOrderStatisticsWithChargeItem() - var - ConcessionalCode: Record "Concessional Code"; - TDSPostingSetup: Record "TDS Posting Setup"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - Vendor: Record Vendor; - begin - // [SCENARIO] [354032] Check if the program is showing TDS amount should be shown in Statistics while creating Purchase Order. - // [GIVEN] Created Setup for AssesseeCode,TDSPostingSetup,TDSSection,ConcessionalCode with Threshold and Surcharge Overlook. - LibraryTDS.CreateTDSSetup(Vendor, TDSPostingSetup, ConcessionalCode); - LibraryTDS.UpdateVendorWithPANWithoutConcessional(Vendor, true, true); - CreateTaxRateSetup(TDSPostingSetup."TDS Section", Vendor."Assessee Code", '', WorkDate()); - - // [WHEN] Purchase Order Created - CreatePurchaseDocument( - PurchaseHeader, - PurchaseHeader."Document Type"::Order, - Vendor."No.", - WorkDate(), - PurchaseLine.Type::"Charge (Item)", - false); - - // [THEN] Statistics Verified - VerifyStatisticsForTDS(PurchaseHeader); - end; -#endif - [Test] [HandlerFunctions('TaxRatePageHandler,PurchOrderStatsHandler')] procedure VerifyPurchOrderStatisticsWithChargeItem() @@ -1831,49 +1704,6 @@ codeunit 18792 "TDS On Purchase Order" PageTaxtype.TaxRates.Invoke(); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - local procedure VerifyStatisticsForTDS(var PurchaseHeader: Record "Purchase Header") - var - PurchaseLine: Record "Purchase Line"; - TaxTransactionValue: Record "Tax Transaction Value"; - TDSSetup: Record "TDS Setup"; - PurchaseOrderStatistics: TestPage "Purchase Order Statistics"; - PurchaseOrder: TestPage "Purchase Order List"; - RecordIDList: List of [RecordID]; - i: Integer; - ActualAmount: Decimal; - begin - Clear(ExpectedTDSAmount); - if not TDSSetup.Get() then - exit; - PurchaseLine.SetRange("Document Type", PurchaseHeader."Document Type"); - PurchaseLine.SetRange("Document no.", PurchaseHeader."No."); - if PurchaseLine.FindSet() then - repeat - RecordIDList.Add(PurchaseLine.RecordId()); - until PurchaseLine.Next() = 0; - - for i := 1 to RecordIDList.Count() do begin - TaxTransactionValue.SetRange("Tax Record ID", RecordIDList.Get(i)); - TaxTransactionValue.SetRange("Value Type", TaxTransactionValue."Value Type"::COMPONENT); - TaxTransactionValue.SetRange("Tax Type", TDSSetup."Tax Type"); - TaxTransactionValue.SetFilter(Percent, '<>%1', 0); - if not TaxTransactionValue.IsEmpty() then - TaxTransactionValue.CalcSums(Amount); - ExpectedTDSAmount += TaxTransactionValue.Amount; - end; - PurchaseOrder.OpenEdit(); - PurchaseOrder.GoToRecord(PurchaseHeader); - PurchaseOrderStatistics.OpenEdit(); - PurchaseOrder.Statistics.Invoke(); - PurchaseOrder.Statistics.Invoke(); - Evaluate(ActualAmount, Storage.Get(TDSAmountLbl)); - Assert.AreNearlyEqual(Round(ExpectedTDSAmount, 0.01, '='), ActualAmount, LibraryTDS.GetTDSRoundingPrecision(), - StrSubstNo(AmountErr, ActualAmount, PurchaseOrderStatistics."TDS Amount".Caption())); - end; -#endif - local procedure VerifyStatsForTDS(var PurchaseHeader: Record "Purchase Header") var PurchaseLine: Record "Purchase Line"; @@ -2197,18 +2027,6 @@ codeunit 18792 "TDS On Purchase Order" Assert.RecordCount(ToPurchaseLine, ExpectedCount); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [ModalPageHandler] - procedure PurchaseOrderStatsHandler(var PurchaseOrderStatistics: TestPage "Purchase Order Statistics") - var - Amt: Text; - begin - Amt := PurchaseOrderStatistics."TDS Amount".Value; - Storage.Set(TDSAmountLbl, Amt); - end; -#endif - [PageHandler] procedure PurchOrderStatsHandler(var PurchaseOrderStatistics: TestPage "Purchase Order Statistics") var diff --git a/Apps/NA/Ceridian/app/src/MSCeridianPayrollupgrade.Codeunit.al b/Apps/NA/Ceridian/app/src/MSCeridianPayrollupgrade.Codeunit.al deleted file mode 100644 index 6961e0b160..0000000000 --- a/Apps/NA/Ceridian/app/src/MSCeridianPayrollupgrade.Codeunit.al +++ /dev/null @@ -1,16 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.Payroll.Ceridian; - -codeunit 1665 "MS Ceridian Payroll upgrade" -{ - Subtype = Upgrade; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'No upgrade code left.'; - - trigger OnUpgradePerCompany() - begin - - end; -} -#endif diff --git a/Apps/US/HybridGP_US/app/Permissions/HybridGPUSObjects.PermissionSet.al b/Apps/US/HybridGP_US/app/Permissions/HybridGPUSObjects.PermissionSet.al index eba1882ab5..78a0a0f5b5 100644 --- a/Apps/US/HybridGP_US/app/Permissions/HybridGPUSObjects.PermissionSet.al +++ b/Apps/US/HybridGP_US/app/Permissions/HybridGPUSObjects.PermissionSet.al @@ -17,5 +17,6 @@ permissionset 4713 "HybridGPUS - Objects" codeunit "GP Vendor 1099 Mapping Helpers" = X, codeunit "GP IRS Form Data" = X, page "GP 1099 Migration Log" = X, - page "GP 1099 Migration Log Factbox" = X; + page "GP 1099 Migration Log Factbox" = X, + codeunit "GP IRS1099 Migration Validator" = X; } \ No newline at end of file diff --git a/Apps/US/HybridGP_US/app/src/Codeunits/GPCloudMigrationUS.Codeunit.al b/Apps/US/HybridGP_US/app/src/Codeunits/GPCloudMigrationUS.Codeunit.al index 392a0fb191..b20e54c45a 100644 --- a/Apps/US/HybridGP_US/app/src/Codeunits/GPCloudMigrationUS.Codeunit.al +++ b/Apps/US/HybridGP_US/app/src/Codeunits/GPCloudMigrationUS.Codeunit.al @@ -5,13 +5,12 @@ using System.Integration; codeunit 42004 "GP Cloud Migration US" { - - [EventSubscriber(ObjectType::Codeunit, CodeUnit::"Data Migration Mgt.", 'OnAfterMigrationFinished', '', false, false)] - local procedure OnAfterMigrationFinishedSubscriber(var DataMigrationStatus: Record "Data Migration Status"; WasAborted: Boolean; StartTime: DateTime; Retry: Boolean) + [EventSubscriber(ObjectType::Codeunit, CodeUnit::"Data Migration Mgt.", OnCreatePostMigrationData, '', false, false)] + local procedure OnCreatePostMigrationDataSubscriber(var DataMigrationStatus: Record "Data Migration Status") var HelperFunctions: Codeunit "Helper Functions"; begin - if not (DataMigrationStatus."Migration Type" = HelperFunctions.GetMigrationTypeTxt()) then + if DataMigrationStatus."Migration Type" <> HelperFunctions.GetMigrationTypeTxt() then exit; RunPostMigration(); diff --git a/Apps/US/HybridGP_US/app/src/Codeunits/GPIRS1099MigrationValidator.Codeunit.al b/Apps/US/HybridGP_US/app/src/Codeunits/GPIRS1099MigrationValidator.Codeunit.al new file mode 100644 index 0000000000..a9042a63c7 --- /dev/null +++ b/Apps/US/HybridGP_US/app/src/Codeunits/GPIRS1099MigrationValidator.Codeunit.al @@ -0,0 +1,190 @@ +namespace Microsoft.DataMigration.GP; + +using Microsoft.DataMigration; +using Microsoft.Finance.VAT.Reporting; +using Microsoft.Purchases.Payables; +using Microsoft.Purchases.Vendor; + +codeunit 42006 "GP IRS1099 Migration Validator" +{ + trigger OnRun() + var + GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; + begin + if not GPCompanyAdditionalSettings.GetMigrateVendor1099Enabled() then + exit; + + ValidationSuiteIdTxt := GetValidationSuiteId(); + CompanyNameTxt := CompanyName(); + + RunVendor1099MigrationValidation(GPCompanyAdditionalSettings); + end; + + local procedure RunVendor1099MigrationValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + GPPM00200: Record "GP PM00200"; + Vendor: Record Vendor; + VendorLedgerEntry: Record "Vendor Ledger Entry"; + IRS1099VendorFormBoxSetup: Record "IRS 1099 Vendor Form Box Setup"; + GPVendor1099MappingHelpers: Codeunit "GP Vendor 1099 Mapping Helpers"; + IRS1099Code: Code[10]; + ActualIRS1099Code: Code[20]; + TaxAmount: Decimal; + VendorYear1099AmountDictionary: Dictionary of [Code[10], Decimal]; + EntityType: Text[50]; + VendorNo: Code[20]; + begin + EntityType := Vendor1099EntityCaptionLbl; + + if GPCompanyAdditionalSettings.GetMigrateVendor1099Enabled() then begin + GPPM00200.SetRange(TEN99TYPE, 2, 5); + GPPM00200.SetFilter(VENDORID, '<>%1', ''); + if GPPM00200.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTxt, GPPM00200) then + continue; + + VendorNo := CopyStr(GPPM00200.VENDORID.TrimEnd(), 1, MaxStrLen(VendorNo)); + Vendor.SetLoadFields("No.", Name, "Federal ID No."); + if not Vendor.Get(VendorNo) then + continue; + + MigrationValidationAssert.SetContext(ValidationSuiteIdTxt, EntityType, VendorNo); + IRS1099Code := GPVendor1099MappingHelpers.GetIRS1099BoxCode(System.Date2DMY(System.Today(), 3), GPPM00200.TEN99TYPE, GPPM00200.TEN99BOXNUMBER); + + Clear(ActualIRS1099Code); + if IRS1099VendorFormBoxSetup.Get(Format(GPCompanyAdditionalSettings.Get1099TaxYear()), VendorNo) then + ActualIRS1099Code := IRS1099VendorFormBoxSetup."Form Box No."; + + MigrationValidationAssert.ValidateAreEqual(Test_VEND1099IRS1099CODE_Tok, IRS1099Code, ActualIRS1099Code, IRS1099CodeLbl); + MigrationValidationAssert.ValidateAreEqual(Test_VEND1099FEDIDNO_Tok, CopyStr(GPPM00200.TXIDNMBR.TrimEnd(), 1, MaxStrLen(Vendor."Federal ID No.")), Vendor."Federal ID No.", FederalIdNoLbl); + + Clear(VendorYear1099AmountDictionary); + BuildVendor1099Entries(VendorNo, VendorYear1099AmountDictionary); + foreach IRS1099Code in VendorYear1099AmountDictionary.Keys() do begin + TaxAmount := VendorYear1099AmountDictionary.Get(IRS1099Code); + + if TaxAmount > 0 then begin + Clear(VendorLedgerEntry); + VendorLedgerEntry.SetLoadFields(Description); + VendorLedgerEntry.SetRange("Vendor No.", VendorNo); + VendorLedgerEntry.SetRange("Document Type", VendorLedgerEntry."Document Type"::Payment); + VendorLedgerEntry.SetRange(Description, IRS1099Code); + + if not MigrationValidationAssert.ValidateRecordExists(Test_VEND1099TRXEXISTS_Tok, VendorLedgerEntry.FindFirst(), StrSubstNo(MissingBoxAndAmountLbl, IRS1099Code, TaxAmount)) then + continue; + + VendorLedgerEntry.CalcFields(Amount); + + MigrationValidationAssert.ValidateAreEqual(Test_VEND1099TEN99BOX_Tok, IRS1099Code, VendorLedgerEntry.Description, Vendor1099BoxLbl); + MigrationValidationAssert.ValidateAreEqual(Test_VEND1099TEN99TRXAMT_Tok, TaxAmount, VendorLedgerEntry.Amount, Vendor1099BoxAmountLbl); + end; + end; + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTxt, GPPM00200); + until GPPM00200.Next() = 0; + end; + Commit(); + end; + + local procedure BuildVendor1099Entries(VendorNo: Code[20]; var VendorYear1099AmountDictionary: Dictionary of [Code[10], Decimal]) + var + GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; + GPPM00204: Record "GP PM00204"; + GPVendor1099MappingHelpers: Codeunit "GP Vendor 1099 Mapping Helpers"; + IRS1099Code: Code[10]; + TaxAmount: Decimal; + TaxYear: Integer; + begin + TaxYear := GPCompanyAdditionalSettings.Get1099TaxYear(); + GPPM00204.SetRange(VENDORID, VendorNo); + GPPM00204.SetRange(YEAR1, TaxYear); + GPPM00204.SetFilter(TEN99AMNT, '>0'); + if GPPM00204.FindSet() then + repeat + IRS1099Code := GPVendor1099MappingHelpers.GetIRS1099BoxCode(TaxYear, GPPM00204.TEN99TYPE, GPPM00204.TEN99BOXNUMBER); + if IRS1099Code <> '' then + if VendorYear1099AmountDictionary.Get(IRS1099Code, TaxAmount) then + VendorYear1099AmountDictionary.Set(IRS1099Code, TaxAmount + GPPM00204.TEN99AMNT) + else + VendorYear1099AmountDictionary.Add(IRS1099Code, GPPM00204.TEN99AMNT); + until GPPM00204.Next() = 0; + end; + + internal procedure GetValidationSuiteId(): Code[20] + begin + exit('GP-US'); + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Migration Validation", OnPrepareValidation, '', false, false)] + local procedure OnPrepareValidation(ProductID: Text[250]) + var + HybridGPWizard: Codeunit "Hybrid GP Wizard"; + begin + if ProductID <> HybridGPWizard.ProductId() then + exit; + + RegisterValidator(); + + AddTest(Test_VEND1099IRS1099CODE_Tok, Vendor1099EntityCaptionLbl, IRS1099CodeLbl); + AddTest(Test_VEND1099FEDIDNO_Tok, Vendor1099EntityCaptionLbl, FederalIdNoLbl); + AddTest(Test_VEND1099TRXEXISTS_Tok, Vendor1099EntityCaptionLbl, Vendor1099MissingTrxLbl); + AddTest(Test_VEND1099TEN99BOX_Tok, Vendor1099EntityCaptionLbl, Vendor1099TrxBoxNoLbl); + AddTest(Test_VEND1099TEN99TRXAMT_Tok, Vendor1099EntityCaptionLbl, Vendor1099TrxAmtLbl); + end; + + local procedure RegisterValidator() + var + ValidationSuite: Record "Validation Suite"; + HybridGPWizard: Codeunit "Hybrid GP Wizard"; + ValidationSuiteId: Code[20]; + MigrationType: Text[250]; + ValidatorCodeunitId: Integer; + begin + ValidationSuiteId := GetValidationSuiteId(); + MigrationType := HybridGPWizard.ProductId(); + ValidatorCodeunitId := Codeunit::"GP IRS1099 Migration Validator"; + if not ValidationSuite.Get(ValidationSuiteId) then begin + ValidationSuite.Validate(Id, ValidationSuiteId); + ValidationSuite.Validate("Migration Type", MigrationType); + ValidationSuite.Validate(Description, ValidatorDescriptionLbl); + ValidationSuite.Validate("Codeunit Id", ValidatorCodeunitId); + ValidationSuite.Validate(Automatic, true); + ValidationSuite.Validate("Errors should fail migration", false); + ValidationSuite.Insert(true); + end; + end; + + local procedure AddTest(Code: Code[30]; Entity: Text[50]; Description: Text) + var + ValidationSuiteLine: Record "Validation Suite Line"; + begin + if not ValidationSuiteLine.Get(Code, GetValidationSuiteId()) then begin + ValidationSuiteLine.Validate(Code, Code); + ValidationSuiteLine.Validate("Validation Suite Id", GetValidationSuiteId()); + ValidationSuiteLine.Validate(Entity, Entity); + ValidationSuiteLine.Validate("Test Description", Description); + ValidationSuiteLine.Insert(true); + end; + end; + + var + MigrationValidationAssert: Codeunit "Migration Validation Assert"; + ValidationSuiteIdTxt: Code[20]; + CompanyNameTxt: Text; + FederalIdNoLbl: Label 'Federal ID No.'; + IRS1099CodeLbl: Label 'IRS 1099 Code'; + MissingBoxAndAmountLbl: Label 'Missing 1099 Box Payment. 1099 Box = %1, Amount = %2', Comment = '%1 = 1099 Box Code, %2 = Amount of the payment'; + Vendor1099BoxLbl: Label '1099 Box'; + Vendor1099BoxAmountLbl: Label '1099 Box Amount'; + Vendor1099MissingTrxLbl: Label 'Missing 1099 transaction'; + Vendor1099TrxBoxNoLbl: Label '1099 transaction Box No/Description'; + Vendor1099TrxAmtLbl: Label '1099 transaction amount'; + Vendor1099EntityCaptionLbl: Label 'Vendor 1099', MaxLength = 50; + ValidatorDescriptionLbl: Label 'GP IRS 1099 migration validator', MaxLength = 250; + Test_VEND1099IRS1099CODE_Tok: Label 'VEND1099IRS1099CODE', Locked = true; + Test_VEND1099FEDIDNO_Tok: Label 'VEND1099FEDIDNO', Locked = true; + Test_VEND1099TRXEXISTS_Tok: Label 'VEND1099TRXEXISTS', Locked = true; + Test_VEND1099TEN99BOX_Tok: Label 'VEND1099TEN99BOX', Locked = true; + Test_VEND1099TEN99TRXAMT_Tok: Label 'VEND1099TEN99TRXAMT', Locked = true; +} \ No newline at end of file diff --git a/Apps/US/HybridGP_US/app/src/PageExt/GPUpgradeSettingsExt.PageExt.al b/Apps/US/HybridGP_US/app/src/PageExt/GPUpgradeSettingsExt.PageExt.al new file mode 100644 index 0000000000..12b085f81a --- /dev/null +++ b/Apps/US/HybridGP_US/app/src/PageExt/GPUpgradeSettingsExt.PageExt.al @@ -0,0 +1,69 @@ +namespace Microsoft.DataMigration.GP; + +using Microsoft.DataMigration; + +pageextension 41105 "GP Upgrade Settings Ext" extends "GP Upgrade Settings" +{ + layout + { + addafter(GPAutomaticValidation) + { + field(GPUSAutomaticValidation; GPIRS1099AutoValidation) + { + ApplicationArea = All; + Caption = 'GP-US (1099)'; + ToolTip = 'Specifies whether automatic validation is enabled for the GP-US (1099) migration.'; + + trigger OnValidate() + begin + if not GPIRS1099AutoValidation then + GPIRS1099ValidationErrorsShouldFailMigration := false; + + UpdateValidatorConfig(); + end; + } + } + addafter(GPValidationErrorHandling) + { + field(GPUSValidationErrorHandling; GPIRS1099ValidationErrorsShouldFailMigration) + { + ApplicationArea = All; + Caption = 'GP-US (1099)'; + ToolTip = 'Specifies whether GP-US (1099) validation errors should fail the migration. Only applies when automatic validation is enabled.'; + + trigger OnValidate() + begin + GPIRS1099AutoValidation := GPIRS1099ValidationErrorsShouldFailMigration; + UpdateValidatorConfig(); + end; + } + } + } + + trigger OnOpenPage() + var + ValidationSuite: Record "Validation Suite"; + GPIRS1099MigrtionValidator: Codeunit "GP IRS1099 Migration Validator"; + begin + if ValidationSuite.Get(GPIRS1099MigrtionValidator.GetValidationSuiteId()) then begin + GPIRS1099AutoValidation := ValidationSuite.Automatic; + GPIRS1099ValidationErrorsShouldFailMigration := ValidationSuite."Errors should fail migration"; + end; + end; + + local procedure UpdateValidatorConfig() + var + ValidationSuite: Record "Validation Suite"; + GPIRS1099MigrtionValidator: Codeunit "GP IRS1099 Migration Validator"; + begin + if ValidationSuite.Get(GPIRS1099MigrtionValidator.GetValidationSuiteId()) then begin + ValidationSuite.Validate(Automatic, GPIRS1099AutoValidation); + ValidationSuite.Validate("Errors should fail migration", GPIRS1099ValidationErrorsShouldFailMigration); + ValidationSuite.Modify(true); + end; + end; + + var + GPIRS1099AutoValidation: Boolean; + GPIRS1099ValidationErrorsShouldFailMigration: Boolean; +} \ No newline at end of file diff --git a/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al b/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al index 2cf7e3dea0..57e982fd9f 100644 --- a/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al +++ b/Apps/US/IRSForms/app/src/Setup/IRSFormsSetup.Page.al @@ -47,51 +47,6 @@ page 10030 "IRS Forms Setup" } } } -#if not CLEAN26 - group(EmailSubject) - { - Caption = 'Email Subject'; - Visible = false; - ObsoleteReason = 'The group was moved to the new page IRS 1099 Email Content Setup.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - field("Email Subject"; Rec."Email Subject") - { - ShowCaption = false; - Importance = Additional; - ToolTip = 'Specifies the subject of the email with 1099 form that is sent to the vendor.'; - Visible = false; - ObsoleteReason = 'The field was moved to the new page IRS 1099 Email Content Setup.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - } - } - group(EmailBody) - { - Caption = 'Email Body'; - Visible = false; - ObsoleteReason = 'The group was moved to the new page IRS 1099 Email Content Setup.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - field("Email Body"; EmailBody) - { - ExtendedDatatype = RichContent; - MultiLine = true; - Importance = Additional; - Caption = 'Email Body'; - ToolTip = 'Specifies the body of the email with 1099 form that is sent to the vendor.'; - Visible = false; - ObsoleteReason = 'The field was moved to the new page IRS 1099 Email Content Setup.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - - trigger OnValidate() - begin - Rec."Email Body" := CopyStr(EmailBody, 1, MaxStrLen(Rec."Email Body")); - end; - } - } -#endif } } @@ -145,11 +100,6 @@ page 10030 "IRS Forms Setup" } } -#if not CLEAN26 - var - EmailBody: Text; -#endif - trigger OnOpenPage() var IRSReportingPeriod: Codeunit "IRS Reporting Period"; diff --git a/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccPageSetup.Table.al b/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccPageSetup.Table.al index fcdbadf259..54cc402dea 100644 --- a/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccPageSetup.Table.al +++ b/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccPageSetup.Table.al @@ -19,13 +19,8 @@ table 4857 "Auto. Acc. Page Setup" field(1; Id; Enum "AAC Page Setup Key") { DataClassification = SystemMetadata; -#if CLEAN26 ObsoleteState = Removed; ObsoleteTag = '29.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#endif ObsoleteReason = 'Automatic Acc.functionality will be moved to a new app.'; } #pragma warning restore AS0105 diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/CompanyCreationWizard.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/CompanyCreationWizard.Codeunit.al deleted file mode 100644 index 2982611e6f..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/CompanyCreationWizard.Codeunit.al +++ /dev/null @@ -1,19 +0,0 @@ -#pragma warning disable AA0247 -#if not CLEAN26 -#pragma warning disable AS0049, AS0072 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ - -namespace Microsoft.DemoTool; - -using Microsoft.Utilities; - -codeunit 4786 "Company Creation Wizard" -{ - Permissions = tabledata "Assisted Company Setup Status" = rm; - Access = Internal; -} -#pragma warning restore AS0049, AS0072 -#endif diff --git a/Apps/W1/EDocumentConnectors/Logiq/app/src/EDocumentIntegration.EnumExt.al b/Apps/W1/EDocumentConnectors/Logiq/app/src/EDocumentIntegration.EnumExt.al deleted file mode 100644 index 6380ffcf35..0000000000 --- a/Apps/W1/EDocumentConnectors/Logiq/app/src/EDocumentIntegration.EnumExt.al +++ /dev/null @@ -1,18 +0,0 @@ -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.EServices.EDocumentConnector.Logiq; - - -// Kept for reference for upgrade -// enumextension 6431 "E-Document Integration" extends "E-Document Integration" -// { -// value(6431; "Logiq") -// { -// Caption = 'Logiq'; -// Implementation = "E-Document Integration" = "Logiq Integration Impl."; -// } -// } -#endif \ No newline at end of file diff --git a/Apps/W1/EDocumentConnectors/Logiq/app/src/LogiqUpgrade.Codeunit.al b/Apps/W1/EDocumentConnectors/Logiq/app/src/LogiqUpgrade.Codeunit.al index 537fe4e963..91df5eed47 100644 --- a/Apps/W1/EDocumentConnectors/Logiq/app/src/LogiqUpgrade.Codeunit.al +++ b/Apps/W1/EDocumentConnectors/Logiq/app/src/LogiqUpgrade.Codeunit.al @@ -4,10 +4,6 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.EServices.EDocumentConnector.Logiq; -#if not CLEAN26 -using Microsoft.eServices.EDocument; -using Microsoft.eServices.EDocument.Integration; -#endif using System.Upgrade; #pragma warning disable AS0130 @@ -23,35 +19,7 @@ codeunit 6435 "Logiq Upgrade" var begin -#if not CLEAN26 - // Upgrade code per company - UpdateServiceIntegration(); -#endif - - end; - -#if not CLEAN26 - local procedure UpdateServiceIntegration() - var - EDocumentService: Record "E-Document Service"; - UpgradeTag: Codeunit "Upgrade Tag"; - begin - if UpgradeTag.HasUpgradeTag(UpgradeServiceIntegrationTag()) then - exit; - - // 6431 - Logiq Integration - EDocumentService.SetRange("Service Integration", 6431); - if EDocumentService.FindSet() then - repeat - EDocumentService."Service Integration V2" := Enum::"Service Integration"::Logiq; - EDocumentService."Service Integration" := Enum::"E-Document Integration"::"No Integration"; - EDocumentService.Modify(); - until EDocumentService.Next() = 0; - - UpgradeTag.SetUpgradeTag(UpgradeServiceIntegrationTag()); end; -#endif - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]]) diff --git a/Apps/W1/EDocumentConnectors/Pagero/app/EDocExtIntegration.EnumExt.al b/Apps/W1/EDocumentConnectors/Pagero/app/EDocExtIntegration.EnumExt.al deleted file mode 100644 index f647503835..0000000000 --- a/Apps/W1/EDocumentConnectors/Pagero/app/EDocExtIntegration.EnumExt.al +++ /dev/null @@ -1,18 +0,0 @@ -#pragma warning disable AA0247 -#if not CLEAN26 -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -// -// Intentionally left as documentation for the upgrade codeunit -// -// enumextension 6363 "E-Doc. Ext. Integration" extends "E-Document Integration" -// { -// // Leave commented out as 6361 is used in Upgrade Codeunit -// // value(6361; "Pagero") -// // { -// // Implementation = "E-Document Integration" = "E-Document No Integration"; -// // } -// } -#endif diff --git a/Apps/W1/EDocumentConnectors/Pagero/app/Upgrade.Codeunit.al b/Apps/W1/EDocumentConnectors/Pagero/app/Upgrade.Codeunit.al index c0ac28be3e..4a37316bf1 100644 --- a/Apps/W1/EDocumentConnectors/Pagero/app/Upgrade.Codeunit.al +++ b/Apps/W1/EDocumentConnectors/Pagero/app/Upgrade.Codeunit.al @@ -5,9 +5,6 @@ namespace Microsoft.EServices.EDocumentConnector; using Microsoft.eServices.EDocument; -#if not CLEAN26 -using Microsoft.eServices.EDocument.Integration; -#endif using System.Upgrade; #pragma warning disable AS0130 @@ -24,35 +21,7 @@ codeunit 6370 Upgrade var begin -#if not CLEAN26 - // Upgrade code per company - UpdateServiceIntegration(); -#endif - - end; - -#if not CLEAN26 - local procedure UpdateServiceIntegration() - var - EDocumentService: Record "E-Document Service"; - UpgradeTag: Codeunit "Upgrade Tag"; - begin - if UpgradeTag.HasUpgradeTag(UpgradeServiceIntegrationTag()) then - exit; - - // 6361 - Pagero (removed) - EDocumentService.SetRange("Service Integration", 6361); - if EDocumentService.FindSet() then - repeat - EDocumentService."Service Integration V2" := Enum::"Service Integration"::Pagero; - EDocumentService."Service Integration" := Enum::"E-Document Integration"::"No Integration"; - EDocumentService.Modify(); - until EDocumentService.Next() = 0; - - UpgradeTag.SetUpgradeTag(UpgradeServiceIntegrationTag()); end; -#endif - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]]) diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/UpgradeEU3PartyPurchase.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/UpgradeEU3PartyPurchase.Codeunit.al index b4e3f6d0bc..ba213e3737 100644 --- a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/UpgradeEU3PartyPurchase.Codeunit.al +++ b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/UpgradeEU3PartyPurchase.Codeunit.al @@ -5,16 +5,6 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Finance.EU3PartyTrade; -#if not CLEAN26 -using Microsoft.Finance.VAT.Reporting; -using Microsoft.Finance.VAT.Setup; -using Microsoft.Purchases.Document; -using Microsoft.Purchases.History; -using System.Environment; -using System.Environment.Configuration; -using System.Upgrade; -#endif - codeunit 4888 "Upgrade EU3 Party Purchase" { ObsoleteReason = 'EU 3rd party purchase app is moved to a new app.'; @@ -26,105 +16,7 @@ codeunit 4888 "Upgrade EU3 Party Purchase" trigger OnUpgradePerCompany() var -#if not CLEAN26 - UpgradeTag: Codeunit "Upgrade Tag"; - UpgTagDefEU3PartyPurchase: Codeunit "Upg. Tag Def. EU3 Party Purch."; - EnvironmentInformation: Codeunit "Environment Information"; - EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt."; - Localization: Text; -#endif - begin -#if not CLEAN26 - // app was available since v23 as EU3 Party trade feature key was introduced for SE - if IsFeatureKeyEnabled() then - exit; - - if UpgradeTag.HasUpgradeTag(UpgTagDefEU3PartyPurchase.GetEU3PartyPurchaseUpgradeTag()) then - exit; - - Localization := EnvironmentInformation.GetApplicationFamily(); - if (Localization <> 'SE') or EU3PartyTradeFeatureMgt.IsEnabled() then begin - UpgradeTag.SetUpgradeTag(UpgTagDefEU3PartyPurchase.GetEU3PartyPurchaseUpgradeTag()); - exit; - end; - - UpgradeEU3PartyPurchase(); - UpdateVATSetup(); - UpgradeTag.SetUpgradeTag(UpgTagDefEU3PartyPurchase.GetEU3PartyPurchaseUpgradeTag()); -#endif - end; - -#if not CLEAN26 - local procedure UpgradeEU3PartyPurchase() - var - PurchaseHeader: Record "Purchase Header"; - PurchInvHeader: Record "Purch. Inv. Header"; - PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; - VATStatementLine: Record "VAT Statement Line"; - begin - UpdatePurchRecords(Database::"Purchase Header", 11200, PurchaseHeader.FieldNo("EU 3 Party Trade")); - UpdatePurchRecords(Database::"Purch. Inv. Header", 11200, PurchInvHeader.FieldNo("EU 3 Party Trade")); - UpdatePurchRecords(Database::"Purch. Cr. Memo Hdr.", 11200, PurchCrMemoHdr.FieldNo("EU 3 Party Trade")); - UpdateStatementRecords(Database::"VAT Statement Line", 11200, VATStatementLine.FieldNo("EU 3 Party Trade")); - end; -#endif - -#if not CLEAN26 - local procedure UpdatePurchRecords(SourceTableId: Integer; SourceFieldId: Integer; TargetFieldId: Integer) - var - DataTransfer: DataTransfer; - begin - DataTransfer.SetTables(SourceTableId, SourceTableId); - DataTransfer.AddSourceFilter(SourceFieldId, '=%1', true); - DataTransfer.AddFieldValue(SourceFieldId, TargetFieldId); - DataTransfer.CopyFields(); - Clear(DataTransfer); - end; -#endif - -#if not CLEAN26 - local procedure UpdateStatementRecords(SourceTableId: Integer; SourceFieldId: Integer; TargetFieldId: Integer) - var - DataTransfer: DataTransfer; - begin - DataTransfer.SetTables(SourceTableId, SourceTableId); - DataTransfer.AddSourceFilter(SourceFieldId, '=%1', true); - DataTransfer.AddConstantValue("EU3 Party Trade Filter"::EU3, TargetFieldId); - DataTransfer.CopyFields(); - Clear(DataTransfer); - - DataTransfer.SetTables(SourceTableId, SourceTableId); - DataTransfer.AddSourceFilter(SourceFieldId, '=%1', false); - DataTransfer.AddConstantValue("EU3 Party Trade Filter"::"non-EU3", TargetFieldId); - DataTransfer.CopyFields(); - Clear(DataTransfer); - end; -#endif - -#if not CLEAN26 - [Obsolete('The feature key EU3PartyTradePurchase is deleted in v26', '26.0')] - local procedure UpdateVATSetup() - var - VATSetup: Record "VAT Setup"; - begin - if not VATSetup.Get() then - VATSetup.Insert(); - VATSetup."Enable EU 3-Party Purchase" := true; - VATSetup.Modify(true); - end; -#endif - -#if not CLEAN26 - [Obsolete('The feature key EU3PartyTradePurchase is deleted in v26', '26.0')] - local procedure IsFeatureKeyEnabled(): Boolean - var - VATSetup: Record "VAT Setup"; - FeatureManagementFacade: Codeunit "Feature Management Facade"; begin - if not VATSetup.Get() then - exit(false); - exit(FeatureManagementFacade.IsEnabled('EU3PartyTradePurchase') or VATSetup."Enable EU 3-Party Purchase"); end; -#endif } #endif \ No newline at end of file diff --git a/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIClient.Codeunit.al b/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIClient.Codeunit.al index 4e2e8a5b73..d8ae297d43 100644 --- a/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIClient.Codeunit.al +++ b/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIClient.Codeunit.al @@ -9,15 +9,11 @@ using System.Azure.Identity; using System.Text; using System.Utilities; -#if not CLEAN26 -codeunit 4508 "Email - Outlook API Client" implements "Email - Outlook API Client v2", "Email - Outlook API Client v3", "Email - Outlook API Client v4", "Email - Outlook API Client v5", "Email - Outlook API Client v6" -#else #if not CLEAN28 codeunit 4508 "Email - Outlook API Client" implements "Email - Outlook API Client v2", "Email - Outlook API Client v4", "Email - Outlook API Client v5", "Email - Outlook API Client v6" #else codeunit 4508 "Email - Outlook API Client" implements "Email - Outlook API Client v5", "Email - Outlook API Client v6" #endif -#endif { var OutlookCategoryLbl: Label 'Outlook', Locked = true; @@ -145,16 +141,6 @@ codeunit 4508 "Email - Outlook API Client" implements "Email - Outlook API Clien end; end; -#if not CLEAN26 - [Obsolete('Replaced by RetrieveEmails with an additional parameter for filters.', '26.0')] - procedure RetrieveEmails(AccessToken: SecretText; MarkAsRead: Boolean; OutlookAccount: Record "Email - Outlook Account"): JsonArray - var - TempFilters: Record "Email Retrieval Filters" temporary; - begin - exit(RetrieveEmails(AccessToken, OutlookAccount, TempFilters)); - end; -#endif - procedure GetMailboxFolders(AccessToken: SecretText; OutlookAccount: Record "Email - Outlook Account"): JsonArray var MailHttpRequestMessage: HttpRequestMessage; diff --git a/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIHelper.Codeunit.al b/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIHelper.Codeunit.al index 8f29f76b9b..a2c6319289 100644 --- a/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIHelper.Codeunit.al +++ b/Apps/W1/Email - Outlook REST API/app/src/EmailOutlookAPIHelper.Codeunit.al @@ -275,20 +275,6 @@ codeunit 4509 "Email - Outlook API Helper" end; #pragma warning restore AL0432 #endif -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('Update OutlookAPIClient to v4.', '26.0')] - procedure InitializeClients(var OutlookAPIClient: interface "Email - Outlook API Client v3"; var OAuthClient: interface "Email - OAuth Client v2") - var - DefaultAPIClient: Codeunit "Email - Outlook API Client"; - DefaultOAuthClient: Codeunit "Email - OAuth Client"; - begin - OutlookAPIClient := DefaultAPIClient; - OAuthClient := DefaultOAuthClient; - OnAfterInitializeClientsV3(OutlookAPIClient, OAuthClient); - end; -#pragma warning restore AL0432 -#endif #if not CLEAN28 #pragma warning disable AL0432 [Obsolete('Update OutlookAPIClient to v5.', '28.0')] @@ -350,22 +336,6 @@ codeunit 4509 "Email - Outlook API Helper" OAuthClient.GetAccessToken(AccessToken); APIClient.SendEmail(AccessToken, EmailMessageToJson(EmailMessage)); end; -#if not CLEAN26 - [Obsolete('Replaced by an overload without the MarkEmailsAsRead parameter.', '26.0')] - procedure RetrieveEmails(AccountId: Guid; MarkEmailsAsRead: Boolean; var EmailInbox: Record "Email Inbox") - var - TempFilters: Record "Email Retrieval Filters" temporary; - begin - TempFilters.Init(); - RetrieveEmails(AccountId, EmailInbox, TempFilters); - end; - - [Obsolete('Replaced by an overload without the MarkEmailsAsRead parameter.', '26.0')] - procedure RetrieveEmails(AccountId: Guid; MarkEmailsAsRead: Boolean; var EmailInbox: Record "Email Inbox"; var Filters: Record "Email Retrieval Filters") - begin - RetrieveEmails(AccountId, EmailInbox, Filters); - end; -#endif procedure RetrieveEmails(AccountId: Guid; var EmailInbox: Record "Email Inbox") var @@ -825,14 +795,6 @@ codeunit 4509 "Email - Outlook API Helper" end; #pragma warning restore AL0432 #endif -#if not CLEAN26 -#pragma warning disable AL0432 - [InternalEvent(false)] - local procedure OnAfterInitializeClientsV3(var OutlookAPIClient: interface "Email - Outlook API Client v3"; var OAuthClient: interface "Email - OAuth Client v2") - begin - end; -#pragma warning restore AL0432 -#endif #if not CLEAN28 #pragma warning disable AL0432 [InternalEvent(false)] diff --git a/Apps/W1/HybridBaseDeployment/app/Permissions/HBDObjects.PermissionSet.al b/Apps/W1/HybridBaseDeployment/app/Permissions/HBDObjects.PermissionSet.al index a2c8e356d3..c5b0c985f8 100644 --- a/Apps/W1/HybridBaseDeployment/app/Permissions/HBDObjects.PermissionSet.al +++ b/Apps/W1/HybridBaseDeployment/app/Permissions/HBDObjects.PermissionSet.al @@ -14,5 +14,14 @@ permissionset 4006 "HBD - Objects" Permissions = page "Hybrid DA Approval" = X, page "Add Migration Table Mappings" = X, table "Hybrid Company Status" = X, - table "Hybrid DA Approval" = X; + table "Hybrid DA Approval" = X, + table "Migration Validation Error" = X, + page "Migration Validation Errors" = X, + codeunit "Migration Validation Assert" = X, + codeunit "Migration Validation" = X, + table "Validation Suite" = X, + table "Validation Suite Line" = X, + page "Migration Validation Results" = X, + table "Validation Progress" = X, + codeunit "Migration Validator Warning" = X; } diff --git a/Apps/W1/HybridBaseDeployment/app/Permissions/INTELLIGENTCLOUDHBD.PermissionSetExt.al b/Apps/W1/HybridBaseDeployment/app/Permissions/INTELLIGENTCLOUDHBD.PermissionSetExt.al index 9819a433a8..11dd40f6a7 100644 --- a/Apps/W1/HybridBaseDeployment/app/Permissions/INTELLIGENTCLOUDHBD.PermissionSetExt.al +++ b/Apps/W1/HybridBaseDeployment/app/Permissions/INTELLIGENTCLOUDHBD.PermissionSetExt.al @@ -25,5 +25,9 @@ permissionsetextension 4003 "INTELLIGENT CLOUD - HBD" extends "INTELLIGENT CLOUD tabledata "Hybrid DA Approval" = rmi, tabledata "Replication Record Link Buffer" = RIMD, tabledata "Record Link Mapping" = RIMD, - tabledata "Cloud Migration Warning" = RIMD; + tabledata "Cloud Migration Warning" = RIMD, + tabledata "Validation Suite" = RIMD, + tabledata "Migration Validation Error" = RIMD, + tabledata "Validation Suite Line" = RIMD, + tabledata "Validation Progress" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicHBD.permissionsetext.al b/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicHBD.permissionsetext.al index 668c9cbb65..69deb83a95 100644 --- a/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicHBD.permissionsetext.al +++ b/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicHBD.permissionsetext.al @@ -25,5 +25,9 @@ permissionsetextension 4000 "D365 BASIC - HBD" extends "D365 BASIC" tabledata "Replication Run Completed Arg" = RIMD, tabledata "Replication Record Link Buffer" = RIMD, tabledata "Record Link Mapping" = RIMD, - tabledata "Cloud Migration Warning" = RIMD; + tabledata "Cloud Migration Warning" = RIMD, + tabledata "Validation Suite" = RIMD, + tabledata "Migration Validation Error" = RIMD, + tabledata "Validation Suite Line" = RIMD, + tabledata "Validation Progress" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicisvHBD.permissionsetext.al b/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicisvHBD.permissionsetext.al index ea6c575d8d..e45185b852 100644 --- a/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicisvHBD.permissionsetext.al +++ b/Apps/W1/HybridBaseDeployment/app/Permissions/d365basicisvHBD.permissionsetext.al @@ -26,5 +26,9 @@ permissionsetextension 4001 "D365 BASIC ISV - HBD" extends "D365 BASIC ISV" tabledata "Hybrid DA Approval" = rmi, tabledata "Replication Record Link Buffer" = RIMD, tabledata "Record Link Mapping" = RIMD, - tabledata "Cloud Migration Warning" = RIMD; + tabledata "Cloud Migration Warning" = RIMD, + tabledata "Validation Suite" = RIMD, + tabledata "Migration Validation Error" = RIMD, + tabledata "Validation Suite Line" = RIMD, + tabledata "Validation Progress" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/Permissions/d365teammemberHBD.permissionsetext.al b/Apps/W1/HybridBaseDeployment/app/Permissions/d365teammemberHBD.permissionsetext.al index 8a12124adb..ea0ca45c7c 100644 --- a/Apps/W1/HybridBaseDeployment/app/Permissions/d365teammemberHBD.permissionsetext.al +++ b/Apps/W1/HybridBaseDeployment/app/Permissions/d365teammemberHBD.permissionsetext.al @@ -24,5 +24,9 @@ permissionsetextension 4002 "D365 TEAM MEMBER - HBD" extends "D365 TEAM MEMBER" tabledata "Replication Run Completed Arg" = RIMD, tabledata "Replication Record Link Buffer" = RIMD, tabledata "Record Link Mapping" = RIMD, - tabledata "Cloud Migration Warning" = RIMD; + tabledata "Cloud Migration Warning" = RIMD, + tabledata "Validation Suite" = RIMD, + tabledata "Migration Validation Error" = RIMD, + tabledata "Validation Suite Line" = RIMD, + tabledata "Validation Progress" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al index 42e5aa71c8..9b48c669e9 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al +++ b/Apps/W1/HybridBaseDeployment/app/src/codeunits/HybridCloudManagement.Codeunit.al @@ -695,6 +695,7 @@ codeunit 4001 "Hybrid Cloud Management" end; RefreshIntelligentCloudStatusTable(); + SelectLatestVersion(Database::"Intelligent Cloud Status"); CreateCompanies(); FeatureTelemetry.LogUptake('0000JMU', GetFeatureTelemetryName(), Enum::"Feature Uptake Status"::"Set up"); diff --git a/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidation.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidation.Codeunit.al new file mode 100644 index 0000000000..3f472fc5f2 --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidation.Codeunit.al @@ -0,0 +1,307 @@ +namespace Microsoft.DataMigration; + +using System.Environment; +using System.Integration; +using System.Security.User; +using System.Threading; + +codeunit 40032 "Migration Validation" +{ + trigger OnRun() + begin + RunTests(false); + end; + + /// + /// Run the configured Validation Suites for the current company + /// + /// Should only run validation suites that are set to run automatically + procedure RunTests(RunOnlyAutomatic: Boolean) + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + ValidationSuite: Record "Validation Suite"; + CloudMigrationWarning: Record "Cloud Migration Warning"; + begin + if not IntelligentCloudSetup.Get() then + exit; + + CommitAfterXValidatedRecordCount := GetDefaultCommitAfterXValidatedRecordCount(); + OnBeforeStartValidation(IntelligentCloudSetup."Product ID", CommitAfterXValidatedRecordCount); + + ValidationSuite.SetRange("Migration Type", IntelligentCloudSetup."Product ID"); + + if RunOnlyAutomatic then + ValidationSuite.SetRange(Automatic, true); + + if not ValidationSuite.FindSet() then + exit; + + repeat + Commit(); + if not Codeunit.Run(ValidationSuite."Codeunit Id") then begin + Clear(CloudMigrationWarning); + CloudMigrationWarning."Entry No." := 0; + CloudMigrationWarning."Warning Type" := CloudMigrationWarning."Warning Type"::"Migration Validator"; + CloudMigrationWarning.Message := CopyStr(StrSubstNo(CloudMigrationWarningErr, ValidationSuite.Id, GetLastErrorText()), 1, MaxStrLen(CloudMigrationWarning.Message)); + CloudMigrationWarning.Insert(); + end; + until ValidationSuite.Next() = 0; + + SetCompanyValidated(); + Commit(); + OnMigrationValidated(IntelligentCloudSetup."Product ID", CompanyName()); + end; + + /// + /// Report that the Company has had validation tests run. + /// + procedure SetCompanyValidated() + var + HybridCompanyStatus: Record "Hybrid Company Status"; + begin + if HybridCompanyStatus.Get(CompanyName()) then + if not HybridCompanyStatus.Validated then begin + HybridCompanyStatus.Validate(Validated, true); + HybridCompanyStatus.Modify(true); + end; + end; + + /// + /// Schedule validation for a Company. + /// + /// The Company context to schedule validation testing. + /// The index number for this scheduled validation. Used to calculate the start time for the scheduled job. + procedure ScheduleCompanyValidation(Company: Text; ScheduledEntryNumber: Integer) + var + TimeoutDuration: Duration; + MaxAttempts: Integer; + TimeBetweenScheduledJobs: Integer; + QueueCategory: Code[10]; + IsHandled: Boolean; + OverrideTimeoutDuration: Duration; + OverrideMaxAttempts: Integer; + OverrideTimeBetweenScheduledJobs: Integer; + StartDateTime: DateTime; + FailoverToSession: Boolean; + SessionId: Integer; + begin + TimeoutDuration := GetDefaultJobTimeout(); + MaxAttempts := GetDefaultJobMaxAttempts(); + TimeBetweenScheduledJobs := GetDefaultTimeBetweenScheduledJobs(); + OverrideTimeoutDuration := TimeoutDuration; + OverrideMaxAttempts := MaxAttempts; + OverrideTimeBetweenScheduledJobs := TimeBetweenScheduledJobs; + QueueCategory := GetJobQueueCategory(); + + OnBeforeCreateMigrationValidationJob(IsHandled, OverrideTimeoutDuration, OverrideMaxAttempts, OverrideTimeBetweenScheduledJobs); + if IsHandled then begin + TimeoutDuration := OverrideTimeoutDuration; + MaxAttempts := OverrideMaxAttempts; + TimeBetweenScheduledJobs := OverrideTimeBetweenScheduledJobs; + end; + + FailoverToSession := not CanStartBackgroundJob(); + + if not FailoverToSession then begin + SendStartValidationResultMessage(StrSubstNo(TelemetryValidationToBeScheduledMsg, JobQueueLbl), false, false); + + StartDateTime := CurrentDateTime(); + if ScheduledEntryNumber > 1 then + StartDateTime += (TimeBetweenScheduledJobs * (ScheduledEntryNumber - 1)); + + CreateAndScheduleBackgroundJob(Company, + Codeunit::"Migration Validation", + TimeoutDuration, + MaxAttempts, + QueueCategory, + MigrationValidationJobDescriptionTxt, + StartDateTime); + + SendStartValidationResultMessage(StrSubstNo(TelemetryValidationScheduledMsg, JobQueueLbl), false, true); + end; + + if FailoverToSession then begin + SendStartValidationResultMessage(StrSubstNo(TelemetryValidationToBeScheduledMsg, SessionLbl), false, false); + + if Session.StartSession(SessionId, Codeunit::"Migration Validation", Company) then + SendStartValidationResultMessage(StrSubstNo(TelemetryValidationScheduledMsg, SessionLbl), false, true) + else + SendStartValidationResultMessage(TelemetryValidationFailedToStartSessionMsg, true, true); + end; + end; + + /// + /// Delete the past validation errors and other entries for the current Company. + /// + /// The Company that needs the migration validation errors deleted. + procedure DeleteMigrationValidationEntriesForCompany() + begin + DeleteMigrationValidationEntriesForCompany(CompanyName()); + end; + + /// + /// Delete the past validation errors and other entries for the specified Company. + /// + /// The Company that needs the migration validation errors deleted. + procedure DeleteMigrationValidationEntriesForCompany(Company: Text) + var + MigrationValidationError: Record "Migration Validation Error"; + ValidationProgress: Record "Validation Progress"; + HybridCompanyStatus: Record "Hybrid Company Status"; + begin + MigrationValidationError.SetRange("Company Name", Company); + if not MigrationValidationError.IsEmpty() then + MigrationValidationError.DeleteAll(true); + + ValidationProgress.SetRange("Company Name", Company); + if not ValidationProgress.IsEmpty() then + ValidationProgress.DeleteAll(true); + + if not HybridCompanyStatus.Get(Company) then + exit; + + HybridCompanyStatus.Validate(Validated, false); + HybridCompanyStatus.Modify(true); + end; + + procedure PrepareValidation() + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + begin + IntelligentCloudSetup.Get(); + + OnPrepareValidation(IntelligentCloudSetup."Product ID"); + end; + + internal procedure GetCommitAfterXValidatedRecordCount(): Integer + begin + exit(CommitAfterXValidatedRecordCount); + end; + + local procedure CanStartBackgroundJob(): Boolean + var + JobQueueEntry: Record "Job Queue Entry"; + UserPermissions: Codeunit "User Permissions"; + begin + if not UserPermissions.IsSuper(UserSecurityId()) then + exit(false); + + if not TaskScheduler.CanCreateTask() then + exit(false); + + if not JobQueueEntry.WritePermission then + exit(false); + + exit(true); + end; + + local procedure SendStartValidationResultMessage(MessageText: Text; IsError: Boolean; ShouldShowMessage: Boolean) + begin + if IsError then + Session.LogMessage('0000SEU', MessageText, Verbosity::Error, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', CloudMigrationTok) + else + Session.LogMessage('0000SEV', MessageText, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', CloudMigrationTok); + + if ShouldShowMessage and GuiAllowed() then + Message(MessageText); + end; + + local procedure CreateAndScheduleBackgroundJob(Company: Text; ObjectIdToRun: Integer; TimeoutDuration: Duration; MaxAttempts: Integer; CategoryCode: Code[10]; Description: Text[250]; StartDateTime: DateTime): Guid + var + JobQueueEntry: Record "Job Queue Entry"; + JobQueueEntryBuffer: Record "Job Queue Entry Buffer"; + begin + JobQueueEntry.ChangeCompany(Company); + JobQueueEntryBuffer.ChangeCompany(Company); + + JobQueueEntry.Init(); + JobQueueEntry."Object Type to Run" := JobQueueEntry."Object Type to Run"::Codeunit; + JobQueueEntry."Object ID to Run" := ObjectIdToRun; + JobQueueEntry."Maximum No. of Attempts to Run" := MaxAttempts; + JobQueueEntry."Job Queue Category Code" := CategoryCode; + JobQueueEntry.Description := Description; + JobQueueEntry."Job Timeout" := TimeoutDuration; + JobQueueEntry."Earliest Start Date/Time" := StartDateTime; + Codeunit.Run(Codeunit::"Job Queue - Enqueue", JobQueueEntry); + + JobQueueEntryBuffer.Init(); + JobQueueEntryBuffer.TransferFields(JobQueueEntry); + JobQueueEntryBuffer."Job Queue Entry ID" := JobQueueEntry.SystemId; + JobQueueEntryBuffer."Start Date/Time" := StartDateTime; + JobQueueEntryBuffer.Insert(); + + exit(JobQueueEntryBuffer.SystemId); + end; + + local procedure GetDefaultJobMaxAttempts(): Integer + begin + exit(10); + end; + + local procedure GetDefaultJobTimeout(): Duration + begin + exit(48 * 60 * 60 * 1000); // 48 hours + end; + + internal procedure GetDefaultTimeBetweenScheduledJobs(): Integer + begin + exit(60 * 1000 * 2); // 2 minutes + end; + + local procedure GetJobQueueCategory(): Code[10] + begin + exit(JobQueueCategoryTok); + end; + + local procedure GetDefaultCommitAfterXValidatedRecordCount(): Integer + begin + exit(500); + end; + + var + CloudMigrationWarningErr: Label '%1 - %2', Comment = '%1 = Validator Code, %2 = Error message'; + TelemetryValidationToBeScheduledMsg: Label 'Migration validation is about to be scheduled. Mode: %1', Comment = '%1 is the mode.', Locked = true; + TelemetryValidationScheduledMsg: Label 'Migration validation is now scheduled. Mode: %1', Comment = '%1 is the mode.', Locked = true; + TelemetryValidationFailedToStartSessionMsg: Label 'Migration validation could not start a new Session.', Locked = true; + MigrationValidationJobDescriptionTxt: Label 'Migration Validation'; + JobQueueLbl: Label 'Job Queue', Locked = true; + SessionLbl: Label 'Session', Locked = true; + JobQueueCategoryTok: Label 'VALIDATION', Locked = true; + CloudMigrationTok: Label 'CloudMigration', Locked = true; + CommitAfterXValidatedRecordCount: Integer; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Data Migration Mgt.", OnBeforeMigrationStarted, '', false, false)] + local procedure BeforeMigrationStarted(var DataMigrationStatus: Record "Data Migration Status"; Retry: Boolean) + begin + DeleteMigrationValidationEntriesForCompany(); + end; + + [EventSubscriber(ObjectType::Table, Database::"Company", OnAfterDeleteEvent, '', false, false)] + local procedure CleanupAfterCompanyDelete(var Rec: Record Company; RunTrigger: Boolean) + begin + if Rec.IsTemporary() then + exit; + + DeleteMigrationValidationEntriesForCompany(Rec.Name); + end; + + [IntegrationEvent(false, false)] + local procedure OnPrepareValidation(ProductID: Text[250]) + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnBeforeStartValidation(MigrationType: Text[250]; var OverrideCommitAfterXValidatedRecordCount: Integer) + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnBeforeCreateMigrationValidationJob(var IsHandled: Boolean; var TimeoutDuration: Duration; var MaxAttempts: Integer; var TimeBetweenScheduledJobs: Integer) + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnMigrationValidated(MigrationType: Text[250]; Company: Text) + begin + end; +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidationAssert.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidationAssert.Codeunit.al new file mode 100644 index 0000000000..c23aa3e56c --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidationAssert.Codeunit.al @@ -0,0 +1,312 @@ +namespace Microsoft.DataMigration; + +using System.Reflection; + +codeunit 40033 "Migration Validation Assert" +{ + /// + /// Set the context for this series of migration validation tests. + /// + /// The validation suite executing the tests. + /// The entity type being tested. + /// The entity Id context. + procedure SetContext(EntryValidationSuiteId: Code[20]; EntryEntityType: Text[50]; EntryContext: Text[250]) + var + ValidationSuite: Record "Validation Suite"; + begin + ContextIsSet := false; + + EntityType := EntryEntityType; + Context := EntryContext; + + if ValidationSuiteId <> EntryValidationSuiteId then begin + ValidationSuiteId := EntryValidationSuiteId; + + ValidationSuite.Get(ValidationSuiteId); + ContextMigrationType := ValidationSuite."Migration Type"; + end; + + if ContextMigrationType = '' then + exit; + + if EntityType = '' then + exit; + + if Context = '' then + exit; + + ContextIsSet := true; + end; + + /// + /// Validate that the actual value matches the expected value. + /// + /// The expected value for the test. + /// The actual value being tested. + /// Description of the test. + procedure ValidateAreEqual(TestCode: Code[30]; Expected: Variant; Actual: Variant; TestDescription: Text[250]): Boolean + begin + exit(ValidateAreEqual(TestCode, Expected, Actual, TestDescription, false)); + end; + + /// + /// Validate that the actual value matches the expected value. + /// + /// The expected value for the test. + /// The actual value being tested. + /// Description of the test. + /// Should the test be handled as a warning. + procedure ValidateAreEqual(TestCode: Code[30]; Expected: Variant; Actual: Variant; TestDescription: Text[250]; ShouldBeWarning: Boolean): Boolean + begin + exit(ValidateAreEqual(TestCode, Expected, Actual, TestDescription, ShouldBeWarning, false)); + end; + + /// + /// Validate that the actual value matches the expected value. + /// + /// The expected value for the test. + /// The actual value being tested. + /// Description of the test. + /// Should the test be handled as a warning. + /// Should the Expected and Actual values be redacted when logged as a validation error. + procedure ValidateAreEqual(TestCode: Code[30]; Expected: Variant; Actual: Variant; TestDescription: Text[250]; ShouldBeWarning: Boolean; ShouldRedact: Boolean): Boolean + begin + AssertContextIsSet(); + + if Equal(Expected, Actual) then + exit(true); + + CreateValidationError(TestCode, Expected, Actual, TestDescription, ShouldBeWarning, ShouldRedact); + end; + + /// + /// Validate that a record exists. + /// + /// Return value of the Get() call on the record being validated. + /// Description of the test. + procedure ValidateRecordExists(TestCode: Code[30]; GetReturnValue: Boolean; TestDescription: Text[250]): Boolean + begin + AssertContextIsSet(); + + if GetReturnValue then + exit(true); + + CreateValidationError(TestCode, MissingExpectedLbl, MissingActualLbl, TestDescription, false, false); + end; + + /// + /// Validate that a record exists. + /// + /// Return value of the Get() call on the record being validated. + /// Description of the test. + /// Should the test be handled as a warning. + procedure ValidateRecordExists(TestCode: Code[30]; GetReturnValue: Boolean; TestDescription: Text[250]; ShouldBeWarning: Boolean): Boolean + begin + AssertContextIsSet(); + + if GetReturnValue then + exit(true); + + CreateValidationError(TestCode, MissingExpectedLbl, MissingActualLbl, TestDescription, ShouldBeWarning, false); + end; + + local procedure CreateValidationError(TestCode: Code[30]; Expected: Variant; Actual: Variant; TestDescription: Text[250]; ShouldBeWarning: Boolean; ShouldRedact: Boolean) + var + MigrationValidationError: Record "Migration Validation Error"; + ValidationSuiteLine: record "Validation Suite Line"; + OverrideIsWarning: Boolean; + OverrideShouldRedact: Boolean; + ActualIsWarning: Boolean; + ActualShouldRedact: Boolean; + begin + ValidationSuiteLine.SetRange(Code, TestCode); + ValidationSuiteLine.SetRange("Validation Suite Id", ValidationSuiteId); + ValidationSuiteLine.SetRange(Ignore, true); + if not ValidationSuiteLine.IsEmpty() then + exit; + + ActualIsWarning := ShouldBeWarning; + OverrideIsWarning := ShouldBeWarning; + ActualShouldRedact := ShouldRedact; + OverrideShouldRedact := ShouldRedact; + + OnTestOverrideWarning(ValidationSuiteId, TestCode, Context, ShouldBeWarning, OverrideIsWarning); + ActualIsWarning := OverrideIsWarning; + + OnTestOverrideShouldRedact(ValidationSuiteId, TestCode, Context, ShouldRedact, OverrideShouldRedact); + ActualShouldRedact := OverrideShouldRedact; + + if ActualShouldRedact then begin + Expected := RedactedLbl; + Actual := RedactedLbl; + end; + + MigrationValidationError."Entry No." := 0; + MigrationValidationError.Validate("Company Name", CompanyName()); + MigrationValidationError.Validate("Test Code", TestCode); + MigrationValidationError.Validate("Validation Suite Id", ValidationSuiteId); + MigrationValidationError.Validate("Migration Type", ContextMigrationType); + MigrationValidationError.Validate("Entity Type", EntityType); + MigrationValidationError.Validate("Entity Display Name", Context); + MigrationValidationError.Validate("Test Description", TestDescription); + MigrationValidationError.Validate(Expected, Expected); + MigrationValidationError.Validate(Actual, Actual); + MigrationValidationError.Validate("Is Warning", ActualIsWarning); + MigrationValidationError.Insert(true); + end; + + /// + /// Report that the source record has been validated. + /// + /// Validator used for testing this source record + /// Source record that was validated + procedure SetSourceRowValidated(EntryValidationSuiteId: Code[20]; SourceRecRef: RecordRef) + var + ValidationProgress: Record "Validation Progress"; + MigrationValidation: Codeunit "Migration Validation"; + SourceTableId: Integer; + ValidatedRowSystemId: Guid; + begin + SourceTableId := SourceRecRef.Number(); + ValidatedRowSystemId := SourceRecRef.Field(SourceRecRef.SystemIdNo()).Value; + + if not ValidationProgress.Get(CompanyName(), EntryValidationSuiteId, SourceTableId, ValidatedRowSystemId) then begin + ValidationProgress.Validate("Company Name", CompanyName()); + ValidationProgress.Validate("Validation Suite Id", EntryValidationSuiteId); + ValidationProgress.Validate("Source Table Id", SourceTableId); + ValidationProgress.Validate("Validated Row System Id", ValidatedRowSystemId); + ValidationProgress.Insert(true); + + CurrentValidatedRecordCount += 1; + if CurrentValidatedRecordCount >= MigrationValidation.GetCommitAfterXValidatedRecordCount() then begin + Commit(); + CurrentValidatedRecordCount := 0; + end; + end; + end; + + /// + /// Check to see if a source record has been validated. + /// + /// Validator used for testing this source record + /// The source record to check if it has already been validated. + /// + procedure IsSourceRowValidated(SourceValidationSuiteId: Code[20]; SourceRecRef: RecordRef): Boolean + var + ValidationProgress: Record "Validation Progress"; + SourceTableId: Integer; + ValidatedRowSystemId: Guid; + begin + SourceTableId := SourceRecRef.Number(); + ValidatedRowSystemId := SourceRecRef.Field(SourceRecRef.SystemIdNo()).Value; + + ValidationProgress.SetRange("Company Name", CompanyName()); + ValidationProgress.SetRange("Validation Suite Id", SourceValidationSuiteId); + ValidationProgress.SetRange("Source Table Id", SourceTableId); + ValidationProgress.SetRange("Validated Row System Id", ValidatedRowSystemId); + exit(not ValidationProgress.IsEmpty()); + end; + + local procedure Equal(Left: Variant; Right: Variant): Boolean + begin + if IsNumber(Left) and IsNumber(Right) then + exit(EqualNumbers(Left, Right)); + + if Left.IsDotNet or Right.IsDotNet then + exit((Format(Left, 0, 2) = Format(Right, 0, 2))); + + exit((TypeOf(Left) = TypeOf(Right)) and (Format(Left, 0, 2) = Format(Right, 0, 2))) + end; + + local procedure EqualNumbers(Left: Decimal; Right: Decimal): Boolean + begin + exit(Left = Right) + end; + + local procedure IsNumber(Value: Variant): Boolean + begin + exit(Value.IsDecimal or Value.IsInteger or Value.IsChar) + end; + + local procedure TypeOf(Value: Variant): Integer + var + "Field": Record "Field"; + begin + case true of + Value.IsBoolean: + exit(Field.Type::Boolean); + Value.IsOption or Value.IsInteger or Value.IsByte: + exit(Field.Type::Integer); + Value.IsBigInteger: + exit(Field.Type::BigInteger); + Value.IsDecimal: + exit(Field.Type::Decimal); + Value.IsText or Value.IsCode or Value.IsChar or Value.IsTextConstant: + exit(Field.Type::Text); + Value.IsDate: + exit(Field.Type::Date); + Value.IsTime: + exit(Field.Type::Time); + Value.IsDuration: + exit(Field.Type::Duration); + Value.IsDateTime: + exit(Field.Type::DateTime); + Value.IsDateFormula: + exit(Field.Type::DateFormula); + Value.IsGuid: + exit(Field.Type::GUID); + Value.IsRecordId: + exit(Field.Type::RecordID); + else + Error(UnsupportedTypeErr, UnsupportedTypeName(Value)) + end + end; + + local procedure UnsupportedTypeName(Value: Variant): Text + begin + case true of + Value.IsRecord: + exit('Record'); + Value.IsRecordRef: + exit('RecordRef'); + Value.IsFieldRef: + exit('FieldRef'); + Value.IsCodeunit: + exit('Codeunit'); + Value.IsAutomation: + exit('Automation'); + Value.IsFile: + exit('File'); + end; + exit('Unsupported Type'); + end; + + local procedure AssertContextIsSet() + begin + if not ContextIsSet then + Error(SetContextErr); + end; + + var + ValidationSuiteId: Code[20]; + ContextMigrationType: Text[250]; + EntityType: Text[50]; + Context: Text[250]; + ContextIsSet: Boolean; + MissingExpectedLbl: Label 'Expected to exist'; + MissingActualLbl: Label 'Does not exist'; + RedactedLbl: Label ''; + SetContextErr: Label 'Context must be set before calling this procedure.'; + CurrentValidatedRecordCount: Integer; + UnsupportedTypeErr: Label 'Equality assertions only support Boolean, Option, Integer, BigInteger, Decimal, Code, Text, Date, DateFormula, Time, Duration, and DateTime values. Current value:%1.', Comment = '%1 = The unsupported variant type.'; + + [IntegrationEvent(false, false)] + local procedure OnTestOverrideWarning(Validator: Code[20]; Test: Code[30]; TestContext: Text[250]; EntryIsWarning: Boolean; var OverrideIsWarning: Boolean) + begin + end; + + [IntegrationEvent(false, false)] + local procedure OnTestOverrideShouldRedact(Validator: Code[20]; Test: Code[30]; TestContext: Text[250]; EntryShouldRedact: Boolean; var OverrideShouldRedact: Boolean) + begin + end; +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidatorWarning.Codeunit.al b/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidatorWarning.Codeunit.al new file mode 100644 index 0000000000..fc1b98b1d8 --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/codeunits/MigrationValidatorWarning.Codeunit.al @@ -0,0 +1,60 @@ +namespace Microsoft.DataMigration; + +codeunit 40031 "Migration Validator Warning" implements "Cloud Migration Warning" +{ + var + MigrationValidatorWarningMsg: Label 'Number of migration validators that had an error during the last migration.'; + + procedure CheckWarning(): Boolean + begin + exit(GetWarningCount() > 0); + end; + + procedure FixWarning() + begin + // Not sure what to put here. + // The migration validators should not fail, and if one does it cannot be fixed by the one running the migration. + // The issue should be reported. + end; + + procedure ShowWarning(var CloudMigrationWarning: Record "Cloud Migration Warning"): Text + var + SearchCloudMigrationWarning: Record "Cloud Migration Warning"; + HybridReplicationSummary: Record "Hybrid Replication Summary"; + FilterTxt: Text; + begin + SearchCloudMigrationWarning.SetRange("Warning Type", SearchCloudMigrationWarning."Warning Type"::"Migration Validator"); + HybridReplicationSummary.SetCurrentKey("Start Time"); + if HybridReplicationSummary.FindLast() then + SearchCloudMigrationWarning.SetFilter(SystemCreatedAt, '>%1', HybridReplicationSummary."End Time"); + + if not SearchCloudMigrationWarning.FindSet() then + exit; + + repeat + FilterTxt := FilterTxt + Format(SearchCloudMigrationWarning."Entry No.") + '|' + until SearchCloudMigrationWarning.Next() = 0; + FilterTxt := FilterTxt.TrimEnd('|'); + + exit(FilterTxt); + end; + + procedure GetWarningMessage(): Text[1024] + begin + exit(MigrationValidatorWarningMsg); + end; + + procedure GetWarningCount(): Integer + var + CloudMigrationWarning: Record "Cloud Migration Warning"; + HybridReplicationSummary: Record "Hybrid Replication Summary"; + begin + CloudMigrationWarning.SetRange("Warning Type", CloudMigrationWarning."Warning Type"::"Migration Validator"); + CloudMigrationWarning.SetRange(Ignored, false); + HybridReplicationSummary.SetCurrentKey("Start Time"); + if HybridReplicationSummary.FindLast() then + CloudMigrationWarning.SetFilter(SystemCreatedAt, '>%1', HybridReplicationSummary."End Time"); + + exit(CloudMigrationWarning.Count()); + end; +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/enums/CloudMigrationWarningType.Enum.al b/Apps/W1/HybridBaseDeployment/app/src/enums/CloudMigrationWarningType.Enum.al index a89fe0bba2..dde720453c 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/enums/CloudMigrationWarningType.Enum.al +++ b/Apps/W1/HybridBaseDeployment/app/src/enums/CloudMigrationWarningType.Enum.al @@ -19,4 +19,9 @@ enum 40010 "Cloud Migration Warning Type" implements "Cloud Migration Warning" Caption = 'Tenant Media'; Implementation = "Cloud Migration Warning" = "Tenant Media Warning"; } + value(3; "Migration Validator") + { + Caption = 'Migration Validator'; + Implementation = "Cloud Migration Warning" = "Migration Validator Warning"; + } } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al index 954e0533c4..6120a78af5 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/CloudMigrationManagement.Page.al @@ -192,6 +192,24 @@ page 40063 "Cloud Migration Management" end; } } + group(MigrationValidationErrors) + { + ShowCaption = false; + + field("Validation Errors"; ValidationErrors) + { + ApplicationArea = All; + Caption = 'Validation Errors'; + Style = Unfavorable; + StyleExpr = (ValidationErrors > 0); + ToolTip = 'Indicates the total number of failed post migration validation tests, for all migrated companies.'; + + trigger OnDrillDown() + begin + Page.Run(Page::"Migration Validation Errors"); + end; + } + } } } } @@ -317,31 +335,6 @@ page 40063 "Cloud Migration Management" WarnAboutNonInitializedCompanies(); end; } -#if not CLEAN26 - action(ResetAllCloudData) - { - Enabled = IsSuper and IsSetupComplete; - Visible = false; - ApplicationArea = All; - Caption = 'Reset cloud data'; - ToolTip = 'Resets migration enabled data in the cloud tenant.'; - Image = Restore; - ObsoleteReason = 'This action is being obsoleted. Disable the cloud migration, delete the company and replicate it again. See official documentation for more details.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - - trigger OnAction() - var - HybridCloudManagement: Codeunit "Hybrid Cloud Management"; - begin - if not Dialog.Confirm(ResetCloudDataConfirmQst, false) then - exit; - - HybridCloudManagement.ResetCloudData(); - Message(ResetCompletedTxt); - end; - } -#endif action(PrepareTables) { Enabled = IsSuper and IsSetupComplete; @@ -786,6 +779,7 @@ page 40063 "Cloud Migration Management" var HybridReplicationSummary: Record "Hybrid Replication Summary"; HybridReplicationDetail: Record "Hybrid Replication Detail"; + MigrationValidationError: Record "Migration Validation Error"; TempHybridReplicationDetail: Record "Hybrid Replication Detail" temporary; HybridReplicationStatistics: Codeunit "Hybrid Replication Statistics"; HybridCloudManagement: Codeunit "Hybrid Cloud Management"; @@ -809,6 +803,8 @@ page 40063 "Cloud Migration Management" HybridReplicationSummary.CalcFields("Companies Not Initialized"); NotInitializedCompaniesCount := HybridReplicationSummary."Companies Not Initialized"; end; + + ValidationErrors := MigrationValidationError.Count(); end; local procedure UpdateControlProperties() @@ -1017,10 +1013,6 @@ page 40063 "Cloud Migration Management" RunReplicationTxt: Label 'Data replication has been successfully started. You can track the status on the management page.'; IntegrationKeyTxt: Label 'Primary key for the integration runtime is: %1', Comment = '%1 = Integration Runtime Key'; NewIntegrationKeyTxt: Label 'New Primary key for the integration runtime is: %1', Comment = '%1 = Integration Runtime Key'; -#if not CLEAN26 - ResetCloudDataConfirmQst: Label 'Reset cloud data is being obsoleted. Disable the cloud migration, delete the company and replicate it again. See official documentation for more details.\\If you choose to reset cloud data, all migrated data will be deleted for all companies in the next migration run. Are you sure you want to reset cloud data?'; - ResetCompletedTxt: Label 'Reset has been successfully run. All migration enabled data will be reset in the next migration run.'; -#endif TablesReadyForReplicationMsg: Label 'All tables have been successfully prepared for migration.'; NonInitializedCompaniesMsg: Label 'One or more companies have been successfully migrated but are not yet initialized. Manage the companies in the Hybrid Companies List page.'; OpenPageMsg: Label 'Start setup'; @@ -1061,4 +1053,5 @@ page 40063 "Cloud Migration Management" RecordLinkBufferNotEmpty: Boolean; HideManageCustomTables: Boolean; HideChangeTheWayDataIsReplicated: Boolean; + ValidationErrors: Integer; } diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCompaniesList.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCompaniesList.Page.al index 1e841bc75e..707eeb8e39 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCompaniesList.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCompaniesList.Page.al @@ -47,7 +47,14 @@ page 40015 "Hybrid Companies List" Tooltip = 'Specifies whether to migrate the data from this company.'; Editable = true; } - + field(Validated; CompanyValidated) + { + ApplicationArea = All; + Caption = 'Validated'; + ToolTip = 'Indicates if the company has been validated.'; + Editable = false; + Visible = (NumberOfRegisteredValidators > 0); + } field("Company Initialization Status"; Rec."Company Initialization Status") { ApplicationArea = Basic, Suite; @@ -111,6 +118,55 @@ page 40015 "Hybrid Companies List" end; } + action(RunAllValidation) + { + ApplicationArea = All; + Caption = 'Run All Validation'; + Image = Confirm; + Promoted = true; + PromotedCategory = Process; + PromotedIsBig = true; + PromotedOnly = true; + ToolTip = 'Run validation on all migrated companies that have yet to be validated.'; + Visible = (NumberOfRegisteredValidators > 0); + + trigger OnAction() + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + HybridCompanyStatus: Record "Hybrid Company Status"; + MigrationValidation: Codeunit "Migration Validation"; + ScheduledEntryNumber: Integer; + ForceRun: Boolean; + begin + if not IntelligentCloudSetup.Get() then + exit; + + ForceRun := Dialog.Confirm(ShouldForceValidateQst, false); + + HybridCompanyStatus.SetFilter(Name, '<>%1', ''); + + if not ForceRun then + HybridCompanyStatus.SetRange(Validated, false); + + if not HybridCompanyStatus.FindSet() then begin + Message(NoCompaniesToValidateMsg); + exit; + end; + + ScheduledEntryNumber := 1; + repeat + if ForceRun then + MigrationValidation.DeleteMigrationValidationEntriesForCompany(HybridCompanyStatus.Name); + + MigrationValidation.ScheduleCompanyValidation(HybridCompanyStatus.Name, ScheduledEntryNumber); + + ScheduledEntryNumber += 1; + until HybridCompanyStatus.Next() = 0; + + Message(ValidationScheduledMsg); + end; + } + action(MarkCompanyAsInitialized) { ApplicationArea = All; @@ -152,6 +208,10 @@ page 40015 "Hybrid Companies List" } trigger OnAfterGetRecord() + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + ValidationSuite: Record "Validation Suite"; + HybridCompanyStatus: Record "Hybrid Company Status"; begin if Rec."Company Initialization Status" = Rec."Company Initialization Status"::"Initialization Failed" then CompanyInitializationFailureTxt := Rec.GetCompanyInitFailureMessage() @@ -162,6 +222,15 @@ page 40015 "Hybrid Companies List" FieldStyleTxt := 'Unfavorable' else FieldStyleTxt := 'Standard'; + + CompanyValidated := false; + if IntelligentCloudSetup.Get() then begin + ValidationSuite.SetRange("Migration Type", IntelligentCloudSetup."Product ID"); + NumberOfRegisteredValidators := ValidationSuite.Count(); + + if HybridCompanyStatus.Get(Rec.Name) then + CompanyValidated := HybridCompanyStatus.Validated; + end; end; var @@ -169,4 +238,9 @@ page 40015 "Hybrid Companies List" FieldStyleTxt: Text; CompanyInitializationScheduledMsg: Label 'Company initialization has been scheduled.'; RunCompanyInitQst: Label 'This will start the process of company initialization. Do you want to continue?'; + NumberOfRegisteredValidators: Integer; + CompanyValidated: Boolean; + ShouldForceValidateQst: Label 'Do you want to force validation on all companies, even if it was previously validated?'; + NoCompaniesToValidateMsg: Label 'No companies need to be validated.'; + ValidationScheduledMsg: Label 'Validation is scheduled.'; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al index 5493cdd415..d3e6d7f46e 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al @@ -189,31 +189,6 @@ page 4003 "Intelligent Cloud Management" WarnAboutNonInitializedCompanies(); end; } -#if not CLEAN26 - action(ResetAllCloudData) - { - Enabled = IsSuper and IsSetupComplete; - Visible = false; - ApplicationArea = Basic, Suite; - Caption = 'Reset Cloud Data'; - ToolTip = 'Resets migration enabled data in the cloud tenant.'; - Image = Restore; - ObsoleteReason = 'This action is being obsoleted. Disable the cloud migration, delete the company and replicate it again. See official documentation for more details.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - - trigger OnAction() - var - HybridCloudManagement: Codeunit "Hybrid Cloud Management"; - begin - if not Dialog.Confirm(ResetCloudDataConfirmQst, false) then - exit; - - HybridCloudManagement.ResetCloudData(); - Message(ResetTriggeredTxt); - end; - } -#endif action(PrepareTables) { Enabled = IsSuper and IsSetupComplete; @@ -451,6 +426,22 @@ page 4003 "Intelligent Cloud Management" begin HybridCloudManagement.EnableDisableOnPremDevelopment(); end; + } + action(ValidationStatus) + { + ApplicationArea = Basic, Suite; + Caption = 'Validation Status'; + Image = Process; + ToolTip = 'View the Company migration status page to manually run validation.'; + Visible = (NumberOfRegisteredValidators > 0); + + trigger OnAction() + var + HybridCompaniesList: Page "Hybrid Companies List"; + begin + HybridCompaniesList.RunModal(); + CurrPage.Update(false); + end; } } } @@ -463,6 +454,7 @@ page 4003 "Intelligent Cloud Management" trigger OnOpenPage() var IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + ValidationSuite: Record "Validation Suite"; PermissionManager: Codeunit "Permission Manager"; UserPermissions: Codeunit "User Permissions"; IntelligentCloudNotifier: Codeunit "Intelligent Cloud Notifier"; @@ -493,9 +485,13 @@ page 4003 "Intelligent Cloud Management" CanShowUpdateReplicationCompanies(UpdateReplicationCompaniesEnabled); CanMapCustomTables(CustomTablesEnabled); - if IntelligentCloudSetup.Get() then + if IntelligentCloudSetup.Get() then begin HybridDeployment.Initialize(IntelligentCloudSetup."Product ID"); + ValidationSuite.SetRange("Migration Type", IntelligentCloudSetup."Product ID"); + NumberOfRegisteredValidators := ValidationSuite.Count(); + end; + IntelligentCloudNotifier.ShowICUpdateNotification(); WarnAboutNonInitializedCompanies(); @@ -686,10 +682,6 @@ page 4003 "Intelligent Cloud Management" RunReplicationTxt: Label 'Migration has been successfully triggered. You can track the status on the management page.'; IntegrationKeyTxt: Label 'Primary key for the integration runtime is: %1', Comment = '%1 = Integration Runtime Key'; NewIntegrationKeyTxt: Label 'New Primary key for the integration runtime is: %1', Comment = '%1 = Integration Runtime Key'; -#if not CLEAN26 - ResetCloudDataConfirmQst: Label 'Reset cloud data is being obsoleted. Disable the cloud migration, delete the company and replicate it again. See official documentation for more details.\\If you choose to reset cloud data, all migrated data will be deleted for all companies in the next migration run. Are you sure you want to reset cloud data?'; - ResetTriggeredTxt: Label 'Reset has been successfully triggered. All migration enabled data will be reset in the next migration run.'; -#endif TablesReadyForReplicationMsg: Label 'All tables have been successfully prepared for migration.'; NonInitializedCompaniesMsg: Label 'One or more companies have been successfully migrated but are not yet initialized. Manage the companies in the Hybrid Companies List page.'; OpenPageMsg: Label 'Open page'; @@ -698,4 +690,5 @@ page 4003 "Intelligent Cloud Management" IntelligentCloudNotSetupMsg: Label 'Cloud migration was not set up. To migrate data to the cloud, complete the wizard.'; RunReplicationConfirmQst: Label 'Are you sure you want to trigger migration?'; DataRepairNotCompletedMsg: Label 'Data repair has not completed. Before you complete the cloud migration or trigger an upgrade, invoke the ''Repair Companion Table Records'' action'; + NumberOfRegisteredValidators: Integer; } \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudStatFactbox.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudStatFactbox.Page.al index afab8147fe..4b75f097ff 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudStatFactbox.Page.al +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudStatFactbox.Page.al @@ -185,6 +185,54 @@ page 4008 "Intelligent Cloud Stat Factbox" Page.Run(Page::"Hybrid Companies List"); end; } + + field(Warnings; NumberOfWarnings) + { + ApplicationArea = All; + Editable = false; + Caption = 'Warnings'; + ToolTip = 'Specifies the number of warnings for the selected migration.'; + Style = Unfavorable; + StyleExpr = (NumberOfWarnings > 0); + + trigger OnDrillDown() + begin + Page.Run(Page::"Cloud Migration Warnings"); + end; + } + + field("Validation Errors"; ValidationErrors) + { + ApplicationArea = All; + Caption = 'Validation Errors'; + Style = Unfavorable; + StyleExpr = (ValidationErrors > 0); + ToolTip = 'Indicates the total number of failed post migration validation tests, for all migrated companies.'; + Visible = (NumberOfRegisteredValidators > 0); + + trigger OnDrillDown() + var + ValidationSuite: Record "Validation Suite"; + ValidationSuiteLine: Record "Validation Suite Line"; + MigrationValidationResults: Page "Migration Validation Results"; + ValidatorFilter: Text; + SeparatorChar: Text; + begin + ValidationSuite.SetRange("Migration Type", MigrationType); + if ValidationSuite.FindSet() then + repeat + if ValidatorFilter <> '' then + SeparatorChar := '|'; + + ValidatorFilter := SeparatorChar + ValidatorFilter; + until ValidationSuite.Next() = 0; + + ValidationSuiteLine.SetFilter("Validation Suite Id", ValidatorFilter); + MigrationValidationResults.SetTableView(ValidationSuiteLine); + MigrationValidationResults.RunModal(); + RefreshStats(); + end; + } } field(Spacer3; '') @@ -208,16 +256,40 @@ page 4008 "Intelligent Cloud Stat Factbox" if TablesNotMigratedEnabled then TotalTablesNotMigrated := HybridCloudManagement.GetTotalTablesNotMigrated(); - if IntelligentCloudSetup.Get() then + if IntelligentCloudSetup.Get() then begin NextScheduledRun := IntelligentCloudSetup.GetNextScheduledRunDateTime(CurrentDateTime()); + MigrationType := IntelligentCloudSetup."Product ID"; + end; ShowNextScheduled := NextScheduledRun <> 0DT; + RefreshStats(); + end; + + trigger OnAfterGetRecord() + begin + RefreshStats(); + end; + + procedure RefreshStats() + var + MigrationValidationSuite: Record "Validation Suite"; + MigrationValidationError: Record "Migration Validation Error"; + HybridCloudManagement: Codeunit "Hybrid Cloud Management"; + begin if Rec."Run ID" <> '' then begin TotalSuccessfulTables := HybridCloudManagement.GetTotalSuccessfulTables(); TotalTablesNotMigrated := HybridCloudManagement.GetTotalTablesNotMigrated(); SourceProduct := HybridCloudManagement.GetChosenProductName(); end; + + UpdateWarningCounts(); + + MigrationValidationSuite.SetRange("Migration Type", MigrationType); + NumberOfRegisteredValidators := MigrationValidationSuite.Count(); + + MigrationValidationError.SetRange("Migration Type", MigrationType); + ValidationErrors := MigrationValidationError.Count(); end; local procedure ShowTablesNotMigrated() @@ -267,6 +339,21 @@ page 4008 "Intelligent Cloud Stat Factbox" Page.Run(4019, TempIntelligentCloudNotMigrated); end; + local procedure UpdateWarningCounts() + var + ICloudMigrationWarning: Interface "Cloud Migration Warning"; + CloudMigrationWarningType: Enum "Cloud Migration Warning Type"; + WarningImplementations: List of [Integer]; + WarningImplementation: Integer; + begin + NumberOfWarnings := 0; + WarningImplementations := CloudMigrationWarningType.Ordinals(); + foreach WarningImplementation in WarningImplementations do begin + ICloudMigrationWarning := "Cloud Migration Warning Type".FromInteger(WarningImplementation); + NumberOfWarnings += ICloudMigrationWarning.GetWarningCount(); + end; + end; + [IntegrationEvent(false, false)] local procedure CanShowTablesNotMigrated(var Enabled: Boolean) begin @@ -279,5 +366,9 @@ page 4008 "Intelligent Cloud Stat Factbox" TotalTablesNotMigrated: Integer; ShowNextScheduled: Boolean; TablesNotMigratedEnabled: Boolean; + MigrationType: Text; + NumberOfWarnings: Integer; + NumberOfRegisteredValidators: Integer; + ValidationErrors: Integer; } diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationErrors.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationErrors.Page.al new file mode 100644 index 0000000000..bda6506be0 --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationErrors.Page.al @@ -0,0 +1,77 @@ +namespace Microsoft.DataMigration; + +page 40065 "Migration Validation Errors" +{ + ApplicationArea = All; + Caption = 'Migration Validation Errors'; + PageType = List; + SourceTable = "Migration Validation Error"; + UsageCategory = Lists; + Editable = false; + DeleteAllowed = false; + InsertAllowed = false; + + layout + { + area(Content) + { + repeater(General) + { + field("Company Name"; Rec."Company Name") + { + } + field("Entity Type"; Rec."Entity Type") + { + } + field(Context; Rec."Entity Display Name") + { + } + field("Test Description"; Rec."Test Description") + { + } + field(Expected; Rec.Expected) + { + } + field(Actual; Rec.Actual) + { + } + field("Is Warning"; Rec."Is Warning") + { + } + field("Migration Type"; Rec."Migration Type") + { + Visible = false; + } + field("Validation Suite Id"; Rec."Validation Suite Id") + { + Visible = false; + } + } + } + } + + actions + { + area(Promoted) + { + actionref(CompanyMigrationStatus_Promoted; CompanyMigrationStatus) + { + } + } + area(Navigation) + { + action(CompanyMigrationStatus) + { + ApplicationArea = All; + Caption = 'Company Migration Status'; + Image = Navigate; + ToolTip = 'Open the Company Migration Status page.'; + + trigger OnAction() + begin + Page.Run(Page::"Hybrid Companies List"); + end; + } + } + } +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationResults.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationResults.Page.al new file mode 100644 index 0000000000..5fcbd1a2bd --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/pages/MigrationValidationResults.Page.al @@ -0,0 +1,137 @@ +namespace Microsoft.DataMigration; + +page 40067 "Migration Validation Results" +{ + ApplicationArea = All; + Caption = 'Migration Validation Results'; + PageType = Worksheet; + SourceTable = "Validation Suite Line"; + UsageCategory = Lists; + DeleteAllowed = false; + InsertAllowed = false; + + layout + { + area(Content) + { + group(Filters) + { + Caption = 'Filters'; + + field(CurrentCompany; CurrentCompanyFilter) + { + Caption = 'Current company only'; + Visible = false; + ToolTip = 'Filter on the current company only or show tests results from all validated companies.'; + + trigger OnValidate() + begin + CurrPage.Update(false); + end; + } + + field(HidePassingTests; HidePassingTestsFilter) + { + Caption = 'Hide passing tests'; + ToolTip = 'Hide test records that do not have any issues found from any validated company.'; + + trigger OnValidate() + begin + ApplyFilterHidePassingTests(); + CurrPage.Update(false); + end; + } + } + + repeater(General) + { + field(FailCount; Rec."Fail Count") + { + trigger OnDrillDown() + var + MigrationValidationError: Record "Migration Validation Error"; + MigrationValidationErrors: Page "Migration Validation Errors"; + begin + MigrationValidationError.SetRange("Validation Suite Id", Rec."Validation Suite Id"); + MigrationValidationError.SetRange("Test Code", Rec.Code); + + MigrationValidationErrors.SetTableView(MigrationValidationError); + MigrationValidationErrors.Run(); + end; + } + field(Entity; Rec.Entity) + { + Editable = false; + } + field("Test Description"; Rec."Test Description") + { + Editable = false; + } + field("Code"; Rec."Code") + { + Editable = false; + } + field("Validation Suite Id"; Rec."Validation Suite Id") + { + Editable = false; + } + field(Ignore; Rec.Ignore) + { + } + } + } + } + + actions + { + area(Promoted) + { + actionref(CompanyMigrationStatus_Promoted; CompanyMigrationStatus) + { + } + } + + area(Navigation) + { + action(CompanyMigrationStatus) + { + ApplicationArea = All; + Caption = 'Company Migration Status'; + Image = Process; + ToolTip = 'Open the Company Migration Status page.'; + + trigger OnAction() + var + HybridCompaniesList: Page "Hybrid Companies List"; + begin + HybridCompaniesList.RunModal(); + CurrPage.Update(false); + end; + } + } + } + + trigger OnOpenPage() + begin + HidePassingTestsFilter := true; + + ApplyFilterHidePassingTests(); + Rec.CalcFields("Fail Count"); + Rec.SetCurrentKey("Fail Count"); + Rec.Ascending(false); + + CurrPage.SetTableView(Rec); + end; + + local procedure ApplyFilterHidePassingTests() + begin + if HidePassingTestsFilter then + Rec.SetFilter("Fail Count", '>0') + else + Rec.SetRange("Fail Count"); + end; + + var + CurrentCompanyFilter: Boolean; + HidePassingTestsFilter: Boolean; +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/tables/HybridCompanyStatus.Table.al b/Apps/W1/HybridBaseDeployment/app/src/tables/HybridCompanyStatus.Table.al index 512ce05a6b..3510470728 100644 --- a/Apps/W1/HybridBaseDeployment/app/src/tables/HybridCompanyStatus.Table.al +++ b/Apps/W1/HybridBaseDeployment/app/src/tables/HybridCompanyStatus.Table.al @@ -65,6 +65,10 @@ table 40027 "Hybrid Company Status" Description = 'Tenant Media Count'; DataClassification = SystemMetadata; } + field(10; Validated; Boolean) + { + Description = 'Indicates if the company has been validated.'; + } } keys diff --git a/Apps/W1/HybridBaseDeployment/app/src/tables/MigrationValidationError.Table.al b/Apps/W1/HybridBaseDeployment/app/src/tables/MigrationValidationError.Table.al new file mode 100644 index 0000000000..4d828d2104 --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/tables/MigrationValidationError.Table.al @@ -0,0 +1,96 @@ +namespace Microsoft.DataMigration; + +table 40043 "Migration Validation Error" +{ + Caption = 'Migration Validation Error'; + DataClassification = CustomerContent; + DataPerCompany = false; + + fields + { + field(1; "Entry No."; Integer) + { + Caption = 'Entry No.'; + AutoIncrement = true; + ToolTip = 'Specifies the Entry No. of this validation error.'; + } + field(2; "Company Name"; Text[30]) + { + Caption = 'Company Name'; + NotBlank = true; + ToolTip = 'Specifies the Company that was tested.'; + } + field(3; "Test Code"; Code[30]) + { + Caption = 'Test Code'; + NotBlank = true; + TableRelation = "Validation Suite Line"; + ToolTip = 'Specifies the identification code of this test.'; + } + field(4; "Validation Suite Id"; Code[20]) + { + Caption = 'Validation Suite Id'; + NotBlank = true; + TableRelation = "Validation Suite"; + ToolTip = 'Specifies the Validation Suite used for this test.'; + } + field(5; "Migration Type"; Text[250]) + { + Caption = 'Migration Type'; + ToolTip = 'Specifies the applicable Migration Type for the test.'; + } + field(6; "Entity Type"; Text[50]) + { + Caption = 'Entity Type'; + NotBlank = true; + ToolTip = 'Specifies the type of entity that was tested.'; + } + field(7; "Entity Display Name"; Text[2048]) + { + Caption = 'Entity Display Name'; + ToolTip = 'Specifies the identifying name of the entity record being tested.'; + } + field(8; "Test Description"; Text[2048]) + { + Caption = 'Test Description'; + ToolTip = 'Specifies the description of the test.'; + } + field(9; Expected; Text[2048]) + { + Caption = 'Expected'; + ToolTip = 'Specifies the expected value of the tested field.'; + } + field(10; Actual; Text[2048]) + { + Caption = 'Actual'; + ToolTip = 'Specifies the actual value of the tested field.'; + } + field(11; "Is Warning"; Boolean) + { + Caption = 'Is Warning'; + ToolTip = 'Specifies if the failed validation test should be considered just a warning.'; + } + field(12; "Errors should fail migration"; Boolean) + { + Caption = 'Indicates if validation errors should fail the migration'; + ToolTip = 'Specifies whether validation errors should fail the migration or not. Only applies to automatic validation.'; + FieldClass = FlowField; + CalcFormula = exist("Validation Suite" where(Id = field("Validation Suite Id"), + "Migration Type" = field("Migration Type"), + "Errors should fail migration" = const(true))); + } + } + keys + { + key(PK; "Entry No.") + { + Clustered = true; + } + key(Key2; "Company Name", "Migration Type", "Is Warning") + { + } + key(Key3; "Validation Suite Id", "Test Code") + { + } + } +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationProgress.Table.al b/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationProgress.Table.al new file mode 100644 index 0000000000..e7dacfd2b9 --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationProgress.Table.al @@ -0,0 +1,40 @@ +namespace Microsoft.DataMigration; + +table 40045 "Validation Progress" +{ + Caption = 'Validation Progress'; + DataClassification = CustomerContent; + DataPerCompany = false; + + fields + { + field(1; "Company Name"; Text[30]) + { + Caption = 'Company Name'; + NotBlank = true; + } + field(2; "Validation Suite Id"; Code[20]) + { + Caption = 'Validation Suite Id'; + NotBlank = true; + TableRelation = "Validation Suite"; + } + field(3; "Source Table Id"; Integer) + { + Caption = 'Source Table Id'; + NotBlank = true; + } + field(4; "Validated Row System Id"; Guid) + { + Caption = 'Validated Row System Id'; + NotBlank = true; + } + } + keys + { + key(PK; "Company Name", "Validation Suite Id", "Source Table Id", "Validated Row System Id") + { + Clustered = true; + } + } +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuite.Table.al b/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuite.Table.al new file mode 100644 index 0000000000..c0599fec14 --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuite.Table.al @@ -0,0 +1,51 @@ +namespace Microsoft.DataMigration; + +table 40042 "Validation Suite" +{ + Caption = 'Validation Suite'; + DataClassification = SystemMetadata; + DataPerCompany = false; + + fields + { + field(1; Id; Code[20]) + { + Caption = 'Id'; + ToolTip = 'Specifies the identification code for this Validator.'; + } + field(2; "Migration Type"; Text[250]) + { + Caption = 'Migration Type'; + ToolTip = 'Specifies the applicable Migration Type for this Validator.'; + } + field(3; "Codeunit Id"; Integer) + { + Caption = 'Codeunit Id'; + ToolTip = 'Specifies the Codeunit Id used to conduct the validation tests.'; + } + field(5; Description; Text[2048]) + { + Caption = 'Description'; + ToolTip = 'Specifies the description of this Validator.'; + } + field(6; Automatic; Boolean) + { + Caption = 'Automatic'; + InitValue = true; + ToolTip = 'Specifies if the validation tests should be executed automatically after the migration tranforms are completed.'; + } + field(7; "Errors should fail migration"; Boolean) + { + Caption = 'Errors should fail migration'; + InitValue = true; + ToolTip = 'Specifies whether validation errors should fail the migration or not. Only applies to automatic validation.'; + } + } + keys + { + key(PK; Id) + { + Clustered = true; + } + } +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuiteLine.Table.al b/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuiteLine.Table.al new file mode 100644 index 0000000000..88e1fb34e9 --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/app/src/tables/ValidationSuiteLine.Table.al @@ -0,0 +1,54 @@ +namespace Microsoft.DataMigration; + +table 40044 "Validation Suite Line" +{ + Caption = 'Validation Suite Line'; + DataClassification = SystemMetadata; + DataPerCompany = false; + + fields + { + field(1; "Code"; Code[30]) + { + Caption = 'Code'; + ToolTip = 'Specifies the identification code of this test.'; + } + field(2; "Validation Suite Id"; Code[20]) + { + Caption = 'Validation Suite Id'; + ToolTip = 'Specifies the Validation Suite used during this test.'; + } + field(3; Entity; Text[50]) + { + Caption = 'Entity'; + ToolTip = 'Specifies the type of entity that will be tested.'; + } + field(4; "Test Description"; Text[2048]) + { + Caption = 'Test Description'; + ToolTip = 'Specifies the description of the test.'; + } + field(5; "Fail Count"; Integer) + { + Caption = 'Fail Count'; + ToolTip = 'Specifies the total number of validation errors related to this test.'; + FieldClass = FlowField; + CalcFormula = count("Migration Validation Error" where("Validation Suite Id" = field("Validation Suite Id"), "Test Code" = field(Code))); + } + field(6; Ignore; Boolean) + { + Caption = 'Ignore'; + ToolTip = 'Specifies that this test can be ignored or not. Ignored tests will not log any validation failures.'; + } + } + keys + { + key(PK; "Code", "Validation Suite Id") + { + Clustered = true; + } + key(Key2; Ignore) + { + } + } +} \ No newline at end of file diff --git a/Apps/W1/HybridBaseDeployment/test/src/HybridCloudManagementTests.Codeunit.al b/Apps/W1/HybridBaseDeployment/test/src/HybridCloudManagementTests.Codeunit.al index 2f57af6fa5..2e1b2eedcf 100644 --- a/Apps/W1/HybridBaseDeployment/test/src/HybridCloudManagementTests.Codeunit.al +++ b/Apps/W1/HybridBaseDeployment/test/src/HybridCloudManagementTests.Codeunit.al @@ -13,6 +13,8 @@ codeunit 139656 "Hybrid Cloud Management Tests" TableNotMarkedForDeltaSyncErr: Label 'Table %1 was not correctly marked for delta sync'; IntelligentCloudStatusRecordNotFoundErr: Label 'Intelligent cloud status record for table %1 not found'; TableNotMarkedForReplicationErr: Label 'Table %1 was not correctly marked for replication'; + CustomerId1Tok: Label 'TEST-1', Locked = true; + CustomerId2Tok: Label 'TEST-2', Locked = true; local procedure Initialize() var @@ -723,6 +725,224 @@ codeunit 139656 "Hybrid Cloud Management Tests" Assert.IsTrue(HybridCompanyStatus."Record Link Move Completed", 'Record links migration status not updated'); end; + [Test] + procedure TestMigrationValidation() + var + MigrationValidationError: Record "Migration Validation Error"; + Customer: Record Customer; + HybridCompanyStatus: Record "Hybrid Company Status"; + MigrationValidation: Codeunit "Migration Validation"; + begin + // [GIVEN] A company migration is being validated + InitMigrationValidationTests(); + + // [WHEN] No customers were migrated, but were expected + MigrationValidation.RunTests(false); + + // [THEN] The migration will fail, and there will be corresponding validation error entries + HybridCompanyStatus.Get(CompanyName()); + Assert.IsTrue(HybridCompanyStatus.Validated, 'The company should have been validated.'); + Assert.RecordCount(MigrationValidationError, 1); + MigrationValidationError.FindFirst(); + Assert.AreEqual('Missing TEST-1', MigrationValidationError."Test Description", 'Incorrect test description'); + Assert.AreEqual(false, MigrationValidationError."Is Warning", 'Incorrect value for Is Warning'); + Assert.IsTrue(GetDidValiationErrorFailTheMigration(), 'The migration should be in a failed state.'); + + // Reset + MigrationValidation.DeleteMigrationValidationEntriesForCompany(); + + // [WHEN] Some of the customers were created + // Create Customer TEST-1 + InitMigrationValidationTest_CustomerTest1(); + MigrationValidation.RunTests(false); + + // [THEN] The migration will fail, and there will be corresponding validation error entries + Assert.IsTrue(GetDidValiationErrorFailTheMigration(), 'The migration should be in a failed state.'); + Assert.RecordCount(MigrationValidationError, 1); + MigrationValidationError.FindFirst(); + Assert.AreEqual('Missing TEST-2', MigrationValidationError."Test Description", 'Incorrect test description'); + Assert.AreEqual(false, MigrationValidationError."Is Warning", 'Incorrect value for Is Warning'); + + // Reset + MigrationValidation.DeleteMigrationValidationEntriesForCompany(); + + // [WHEN] All the customers were created and correct + InitMigrationValidationTest_CustomerTest1(); + InitMigrationValidationTest_CustomerTest2(); + + // [THEN] No validation progress should be recorded for either Customers. + // Note: The source table will normally be the staging table, but for testing the Customer table is sufficient + Assert.IsFalse(CustomerHasNotBeenValidated(CustomerId1Tok), 'Customer 1 should not have validation progress recorded.'); + Assert.IsFalse(CustomerHasNotBeenValidated(CustomerId2Tok), 'Customer 2 should not have validation progress recorded.'); + + MigrationValidation.RunTests(false); + + // [THEN] The migration will be successful, and there won't be any validation error entries + Assert.IsFalse(GetDidValiationErrorFailTheMigration(), 'The migration should be in a failed state.'); + Assert.RecordCount(MigrationValidationError, 0); + + // [THEN] Validation progress will be recorded for both Customers. + // Note: The source table will normally be the staging table, but for testing the Customer table is sufficient + Assert.IsTrue(CustomerHasNotBeenValidated(CustomerId1Tok), 'Customer 1 should have validation progress recorded.'); + Assert.IsTrue(CustomerHasNotBeenValidated(CustomerId2Tok), 'Customer 2 should have validation progress recorded.'); + + // Reset + MigrationValidation.DeleteMigrationValidationEntriesForCompany(); + + // [WHEN] Some values are unexpected + Customer.GET(CustomerId1Tok); + Customer.Name := 'Wrong name'; + Customer."Name 2" := 'Wrong name 2'; + Customer.Modify(); + + MigrationValidation.RunTests(false); + + // [TEST] The correct validation error records will be added + // The migration will be in a failed state because there is an entry that isn't a warning + Assert.RecordCount(MigrationValidationError, 2); + Assert.IsTrue(GetDidValiationErrorFailTheMigration(), 'The migration should be in a failed state.'); + + MigrationValidationError.FindSet(); + Assert.AreEqual('Name', MigrationValidationError."Test Description", 'Incorrect test description'); + Assert.AreEqual('Test 1', MigrationValidationError.Expected, 'Incorrect Expected value'); + Assert.AreEqual('Wrong name', MigrationValidationError.Actual, 'Incorrect Actual value'); + Assert.AreEqual(false, MigrationValidationError."Is Warning", 'Incorrect value for Is Warning'); + + MigrationValidationError.Next(); + Assert.AreEqual('Name 2', MigrationValidationError."Test Description", 'Incorrect test description'); + Assert.AreEqual('Test name 2', MigrationValidationError.Expected, 'Incorrect Expected value'); + Assert.AreEqual('Wrong name 2', MigrationValidationError.Actual, 'Incorrect Actual value'); + Assert.AreEqual(true, MigrationValidationError."Is Warning", 'Incorrect value for Is Warning'); + + // Reset + MigrationValidation.DeleteMigrationValidationEntriesForCompany(); + + // [WHEN] Some values are unexpected, but nothing considered major + Customer.GET(CustomerId1Tok); + Customer.Name := 'Test 1'; // Back to expected value + Customer."Name 2" := 'Wrong name 2'; + Customer.Modify(); + + // [THEN] The migration should NOT be in a failed state + MigrationValidation.RunTests(false); + Assert.RecordCount(MigrationValidationError, 1); + Assert.IsFalse(GetDidValiationErrorFailTheMigration(), 'The migration should NOT be in a failed state.'); + end; + + local procedure GetDidValiationErrorFailTheMigration(): Boolean + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + MigrationValidationError: Record "Migration Validation Error"; + begin + IntelligentCloudSetup.Get(); + + MigrationValidationError.SetRange("Migration Type", IntelligentCloudSetup."Product ID"); + MigrationValidationError.SetRange("Company Name", CompanyName()); + MigrationValidationError.SetRange("Is Warning", false); + MigrationValidationError.SetRange("Errors should fail migration", true); + exit(not MigrationValidationError.IsEmpty()) + end; + + local procedure CustomerHasNotBeenValidated(CustomerNo: Code[20]): Boolean + var + Customer: Record Customer; + MigrationValidationAssert: Codeunit "Migration Validation Assert"; + MockMigrationValidator: Codeunit "Mock Migration Validator"; + begin + // The source table will normally be the staging table, but for testing the Customer table is sufficient + if Customer.Get(CustomerNo) then + exit(MigrationValidationAssert.IsSourceRowValidated(MockMigrationValidator.GetValidationSuiteId(), Customer)); + end; + + local procedure InitMigrationValidationTests() + var + ValidationSuite: Record "Validation Suite"; + MigrationValidationError: Record "Migration Validation Error"; + DataMigrationStatus: Record "Data Migration Status"; + HybridCompany: Record "Hybrid Company"; + HybridCompanyStatus: Record "Hybrid Company Status"; + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + MockMigrationValidator: Codeunit "Mock Migration Validator"; + ValidatorCode: Code[20]; + MigrationType: Text[250]; + ValidatorCodeunitId: Integer; + begin + ValidatorCode := MockMigrationValidator.GetValidationSuiteId(); + ValidatorCodeunitId := Codeunit::"Mock Migration Validator"; + + if not IntelligentCloudSetup.Get() then begin + IntelligentCloudSetup."Product ID" := GetDefaultTestMigrationType(); + IntelligentCloudSetup.Insert(); + end; + + MigrationType := IntelligentCloudSetup."Product ID"; + + if not DataMigrationStatus.IsEmpty() then + DataMigrationStatus.DeleteAll(); + + if not MigrationValidationError.IsEmpty() then + MigrationValidationError.DeleteAll(); + + if not ValidationSuite.IsEmpty() then + ValidationSuite.DeleteAll(); + + if not ValidationSuite.Get(ValidatorCode) then begin + ValidationSuite.Validate(Id, ValidatorCode); + ValidationSuite.Validate("Migration Type", MigrationType); + ValidationSuite.Validate("Codeunit Id", ValidatorCodeunitId); + ValidationSuite.Insert(); + end; + + if not HybridCompany.Get(CompanyName()) then begin + HybridCompany.Name := CopyStr(CompanyName(), 1, MaxStrLen(HybridCompany.Name)); + HybridCompany.Insert(); + end; + + if not HybridCompanyStatus.Get(CompanyName()) then begin + HybridCompanyStatus.Name := CopyStr(CompanyName(), 1, MaxStrLen(HybridCompanyStatus.Name)); + HybridCompanyStatus.Insert(); + end; + + HybridCompanyStatus.Validated := false; + HybridCompany.Modify(); + + Clear(DataMigrationStatus); + DataMigrationStatus."Migration Type" := IntelligentCloudSetup."Product ID"; + DataMigrationStatus.Status := DataMigrationStatus.Status::"In Progress"; + DataMigrationStatus.Insert(true); + + MockMigrationValidator.OnPrepareMigrationValidation(MigrationType); + end; + + local procedure InitMigrationValidationTest_CustomerTest1() + var + Customer: Record Customer; + begin + if not Customer.Get(CustomerId1Tok) then begin + Customer."No." := CustomerId1Tok; + Customer.Name := 'Test 1'; + Customer."Name 2" := 'Test name 2'; + Customer.Insert(); + end; + end; + + local procedure InitMigrationValidationTest_CustomerTest2() + var + Customer: Record Customer; + begin + if not Customer.Get(CustomerId2Tok) then begin + Customer."No." := CustomerId2Tok; + Customer.Name := 'Test 2'; + Customer."Name 2" := 'Test name 2'; + Customer.Insert(); + end; + end; + + local procedure GetDefaultTestMigrationType(): Code[20] + begin + exit('TEST'); + end; + local procedure OpenCloudMigSelectTablesPage(var CloudMigSelectTables: TestPage "Cloud Mig - Select Tables") var IntelligentCloudStatus: Record "Intelligent Cloud Status"; diff --git a/Apps/W1/HybridBaseDeployment/test/src/MockMigrationValidator.Codeunit.al b/Apps/W1/HybridBaseDeployment/test/src/MockMigrationValidator.Codeunit.al new file mode 100644 index 0000000000..32cce441ce --- /dev/null +++ b/Apps/W1/HybridBaseDeployment/test/src/MockMigrationValidator.Codeunit.al @@ -0,0 +1,101 @@ +codeunit 148499 "Mock Migration Validator" +{ + trigger OnRun() + begin + RunCustomerMigrationValidation(); + end; + + local procedure RunCustomerMigrationValidation() + var + Customer: Record Customer; + CustomerId1Tok: Label 'TEST-1', MaxLength = 20, Locked = true; + CustomerId2Tok: Label 'TEST-2', MaxLength = 20, Locked = true; + begin + // [Customer: Test 1] + + // Set the context of this set of tests + MigrationValidationAssert.SetContext(GetValidationSuiteId(), 'Customer', CustomerId1Tok); + + // Check for the entity record by the key + if not MigrationValidationAssert.ValidateRecordExists(Test_CUSTOMEREXISTS_Tok, Customer.Get(CustomerId1Tok), 'Missing TEST-1') then + exit; + + // This is a test that is not a warning, and would fail the migration + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERNAME_Tok, 'Test 1', Customer.Name, 'Name'); + + // This is a test that would be just a warning + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERNAME2_Tok, 'Test name 2', Customer."Name 2", 'Name 2', true); + + // The source table will normally be the staging table, but for testing the Customer table is sufficient + MigrationValidationAssert.SetSourceRowValidated(GetValidationSuiteId(), Customer); + + // [Customer: Test 2] + + // Set the context of this set of tests + MigrationValidationAssert.SetContext(GetValidationSuiteId(), 'Customer', CustomerId2Tok); + + // Check for the entity record by the key + if not MigrationValidationAssert.ValidateRecordExists(Test_CUSTOMEREXISTS_Tok, Customer.Get(CustomerId2Tok), 'Missing TEST-2') then + exit; + + // This is a test that is not a warning, and would fail the migration + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERNAME_Tok, 'Test 2', Customer.Name, 'Name'); + + // This is a test that would be just a warning + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERNAME2_Tok, 'Test name 2', Customer."Name 2", 'Name 2', true); + + // The source table will normally be the staging table, but for testing the Customer table is sufficient + MigrationValidationAssert.SetSourceRowValidated(GetValidationSuiteId(), Customer); + end; + + internal procedure GetValidationSuiteId(): Code[20] + begin + exit('TEST'); + end; + + internal procedure OnPrepareMigrationValidation(ProductID: Text[250]) + begin + RegisterValidator(ProductID); + + AddTest(Test_CUSTOMEREXISTS_Tok, 'Customer', 'Missing Customer'); + AddTest(Test_CUSTOMERNAME_Tok, 'Customer', 'Name'); + AddTest(Test_CUSTOMERNAME2_Tok, 'Customer', 'Name 2'); + end; + + local procedure RegisterValidator(ProductID: Text[250]) + var + ValidationSuite: Record "Validation Suite"; + ValidatorCodeunitId: Integer; + begin + ValidatorCodeunitId := Codeunit::"Mock Migration Validator"; + if not ValidationSuite.Get(GetValidationSuiteId()) then begin + ValidationSuite.Validate(Id, GetValidationSuiteId()); + ValidationSuite.Validate("Migration Type", ProductID); + ValidationSuite.Validate(Description, ValidatorDescriptionLbl); + ValidationSuite.Validate("Codeunit Id", ValidatorCodeunitId); + ValidationSuite.Validate(Automatic, true); + ValidationSuite.Validate("Errors should fail migration", true); + ValidationSuite.Insert(true); + end; + end; + + local procedure AddTest(Code: Code[30]; Entity: Text[50]; Description: Text) + var + ValidationSuiteLine: Record "Validation Suite Line"; + begin + if not ValidationSuiteLine.Get(Code, GetValidationSuiteId()) then begin + ValidationSuiteLine.Validate(Code, Code); + ValidationSuiteLine.Validate("Validation Suite Id", GetValidationSuiteId()); + ValidationSuiteLine.Validate(Entity, Entity); + ValidationSuiteLine.Validate("Test Description", Description); + ValidationSuiteLine.Insert(true); + end; + end; + + var + MigrationValidationAssert: Codeunit "Migration Validation Assert"; + ValidatorDescriptionLbl: Label 'Mock Migration Validator', MaxLength = 250; + Test_CUSTOMEREXISTS_Tok: Label 'CUSTOMEREXISTS', Locked = true; + Test_CUSTOMERNAME_Tok: Label 'CUSTOMERNAME', Locked = true; + Test_CUSTOMERNAME2_Tok: Label 'CUSTOMERNAME2', Locked = true; +} \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al b/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al index 2ced48af80..b7a8e12fca 100644 --- a/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al +++ b/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al @@ -49,11 +49,6 @@ permissionset 4031 "HybridGP - Edit" tabledata "GPSOPTrxHist" = IMD, tabledata "GPSOPUserDefinedWorkHist" = IMD, tabledata "GPSOPWorkflowWorkHist" = IMD, -#if not CLEAN26 -#pragma warning disable AL0432 - tabledata "GPForecastTemp" = IMD, -#pragma warning restore AL0432 -#endif tabledata "GP Item" = IMD, tabledata "GP Item Location" = IMD, tabledata "GP Item Transactions" = IMD, @@ -120,5 +115,6 @@ permissionset 4031 "HybridGP - Edit" tabledata "GP Migration Warnings" = IMD, tabledata "GP IV00104" = IMD, tabledata "GP PM00101" = IMD, - tabledata "GP PM00203" = IMD; + tabledata "GP PM00203" = IMD, + tabledata "GP PO Validation Buffer" = IMD; } diff --git a/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al b/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al index af444572db..aafd7326df 100644 --- a/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al +++ b/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al @@ -129,22 +129,6 @@ permissionset 4029 "HybridGP - Objects" query "GP Item Aggregate" = X, codeunit "GP Migration Error Handler" = X, page "GP Migration Error Overview" = X, - -#if not CLEAN26 -#pragma warning disable AL0432 - page "GP Account" = X, - page "GP Fiscal Periods" = X, - page "GP GLTransactions" = X, - page "GP Customer" = X, - page "GP Customer Transactions" = X, - codeunit "GPForecastHandler" = X, - table "GPForecastTemp" = X, - page "GP Item" = X, - page "GP Posting Accounts" = X, - page "GP Vendor" = X, - page "GP Vendor Transactions" = X, -#pragma warning restore AL0432 -#endif table "GP Migration Error Overview" = X, table "GP Upgrade Settings" = X, codeunit "Start Data Upgrade" = X, @@ -157,5 +141,7 @@ permissionset 4029 "HybridGP - Objects" page "GP Payment Terms" = X, table "GP IV00104" = X, table "GP PM00101" = X, - table "GP PM00203" = X; + table "GP PM00203" = X, + table "GP PO Validation Buffer" = X, + codeunit "GP Migration Validator" = X; } \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al b/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al index 385421e36d..71d31d5842 100644 --- a/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al +++ b/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al @@ -49,11 +49,6 @@ permissionset 4032 "HybridGP - Read" tabledata "GPSOPTrxHist" = R, tabledata "GPSOPUserDefinedWorkHist" = R, tabledata "GPSOPWorkflowWorkHist" = R, -#if not CLEAN26 -#pragma warning disable AL0432 - tabledata "GPForecastTemp" = R, -#pragma warning restore AL0432 -#endif tabledata "GP Item" = R, tabledata "GP Item Location" = R, tabledata "GP Item Transactions" = R, @@ -120,5 +115,6 @@ permissionset 4032 "HybridGP - Read" tabledata "GP Migration Warnings" = R, tabledata "GP IV00104" = R, tabledata "GP PM00101" = R, - tabledata "GP PM00203" = R; + tabledata "GP PM00203" = R, + tabledata "GP PO Validation Buffer" = R; } diff --git a/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al b/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al index 08f5cf29fa..edc239401b 100644 --- a/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al +++ b/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al @@ -8,11 +8,6 @@ permissionsetextension 4028 "INTELLIGENT CLOUD - HGP" extends "INTELLIGENT CLOUD tabledata GPPOPTaxHist = RIMD, tabledata GPSOPTrxHist = RIMD, tabledata GPSOPProcessHoldWorkHist = RIMD, -#if not CLEAN26 -#pragma warning disable AL0432 - tabledata GPForecastTemp = RIMD, -#pragma warning restore AL0432 -#endif tabledata GPIVTrxAmountsHist = RIMD, tabledata GPSOPWorkflowWorkHist = RIMD, tabledata "GP GLTransactions" = RIMD, @@ -118,5 +113,6 @@ permissionsetextension 4028 "INTELLIGENT CLOUD - HGP" extends "INTELLIGENT CLOUD tabledata "GP Migration Warnings" = RIMD, tabledata "GP IV00104" = RIMD, tabledata "GP PM00101" = RIMD, - tabledata "GP PM00203" = RIMD; + tabledata "GP PM00203" = RIMD, + tabledata "GP PO Validation Buffer" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al b/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al index 2c04711c84..a886068122 100644 --- a/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al +++ b/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al @@ -8,11 +8,6 @@ permissionsetextension 4025 "D365 BASIC - HGP" extends "D365 BASIC" tabledata GPPOPTaxHist = RIMD, tabledata GPSOPTrxHist = RIMD, tabledata GPSOPProcessHoldWorkHist = RIMD, -#if not CLEAN26 -#pragma warning disable AL0432 - tabledata GPForecastTemp = RIMD, -#pragma warning restore AL0432 -#endif tabledata GPIVTrxAmountsHist = RIMD, tabledata GPSOPWorkflowWorkHist = RIMD, tabledata "GP GLTransactions" = RIMD, @@ -117,5 +112,6 @@ permissionsetextension 4025 "D365 BASIC - HGP" extends "D365 BASIC" tabledata "GP Migration Warnings" = RIMD, tabledata "GP IV00104" = RIMD, tabledata "GP PM00101" = RIMD, - tabledata "GP PM00203" = RIMD; + tabledata "GP PM00203" = RIMD, + tabledata "GP PO Validation Buffer" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/Permissions/d365basicisvHGP.permissionsetext.al b/Apps/W1/HybridGP/app/Permissions/d365basicisvHGP.permissionsetext.al index c1410a00b9..297d2cfefb 100644 --- a/Apps/W1/HybridGP/app/Permissions/d365basicisvHGP.permissionsetext.al +++ b/Apps/W1/HybridGP/app/Permissions/d365basicisvHGP.permissionsetext.al @@ -112,5 +112,6 @@ permissionsetextension 4026 "D365 BASIC ISV - HGP" extends "D365 BASIC ISV" tabledata "GP Migration Warnings" = RIMD, tabledata "GP IV00104" = RIMD, tabledata "GP PM00101" = RIMD, - tabledata "GP PM00203" = RIMD; + tabledata "GP PM00203" = RIMD, + tabledata "GP PO Validation Buffer" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al b/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al index 57c32e970a..ae278a96b3 100644 --- a/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al +++ b/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al @@ -8,11 +8,6 @@ permissionsetextension 4027 "D365 TEAM MEMBER - HGP" extends "D365 TEAM MEMBER" tabledata GPPOPTaxHist = RIMD, tabledata GPSOPTrxHist = RIMD, tabledata GPSOPProcessHoldWorkHist = RIMD, -#if not CLEAN26 -#pragma warning disable AL0432 - tabledata GPForecastTemp = RIMD, -#pragma warning restore AL0432 -#endif tabledata GPIVTrxAmountsHist = RIMD, tabledata GPSOPWorkflowWorkHist = RIMD, tabledata "GP GLTransactions" = RIMD, @@ -117,5 +112,6 @@ permissionsetextension 4027 "D365 TEAM MEMBER - HGP" extends "D365 TEAM MEMBER" tabledata "GP Migration Warnings" = RIMD, tabledata "GP IV00104" = RIMD, tabledata "GP PM00101" = RIMD, - tabledata "GP PM00203" = RIMD; + tabledata "GP PM00203" = RIMD, + tabledata "GP PO Validation Buffer" = RIMD; } \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al b/Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al deleted file mode 100644 index b4c00d38c3..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al +++ /dev/null @@ -1,83 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4090 "GP Account" -{ - PageType = Card; - SourceTable = "GP Account"; - DeleteAllowed = false; - InsertAllowed = false; - Caption = 'Account Table'; - PromotedActionCategories = 'Related Entities'; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; -#pragma warning disable AA0219 - layout - { - area(content) - { - group(General) - { - field(AcctNum; Rec.AcctNum) - { - ApplicationArea = All; - ToolTip = 'Account Number'; - } - field(AcctIndex; Rec.AcctIndex) - { - ApplicationArea = All; - ToolTip = 'Account Index'; - } - field(Name; Rec.Name) - { - ApplicationArea = All; - ToolTip = 'Account Name'; - } - field(SearchName; Rec.SearchName) - { - ApplicationArea = All; - ToolTip = 'Search Name'; - } - field(AccountCategory; Rec.AccountCategory) - { - ApplicationArea = All; - ToolTip = 'Account Category'; - } - field(IncomeBalance; Rec.IncomeBalance) - { - ApplicationArea = All; - ToolTip = 'Income Balance'; - } - field(DebitCredit; Rec.DebitCredit) - { - ApplicationArea = All; - ToolTip = 'Debit or Credit'; - } - field(Active; Rec.Active) - { - ApplicationArea = All; - ToolTip = 'Active'; - } - field(DirectPosting; Rec.DirectPosting) - { - ApplicationArea = All; - ToolTip = 'Direct Posting'; - } - field(AccountSubcategoryEntryNo; Rec.AccountSubcategoryEntryNo) - { - ApplicationArea = All; - ToolTip = 'Account Subcategory Entry Number'; - } - field(AccountType; Rec.AccountType) - { - ApplicationArea = All; - ToolTip = 'Account Type'; - } - } - } - } -} -#pragma warning restore AA0219 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPFiscalPeriods.page.al b/Apps/W1/HybridGP/app/src/Migration/Accounts/GPFiscalPeriods.page.al deleted file mode 100644 index 71606ba874..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPFiscalPeriods.page.al +++ /dev/null @@ -1,48 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4092 "GP Fiscal Periods" -{ - PageType = Card; - SourceTable = "GP Fiscal Periods"; - DeleteAllowed = false; - InsertAllowed = false; - Caption = 'Fiscal Periods Table'; - PromotedActionCategories = 'Related Entities'; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; -#pragma warning disable AA0219 - layout - { - area(content) - { - group(General) - { - field(PERIODID; Rec.PERIODID) - { - ApplicationArea = All; - ToolTip = 'Period Id'; - } - field(YEAR1; Rec.YEAR1) - { - ApplicationArea = All; - ToolTip = 'Year 1'; - } - field(PERIODDT; Rec.PERIODDT) - { - ApplicationArea = All; - ToolTip = 'PERIODDT'; - } - field(PERDENDT; Rec.PERDENDT) - { - ApplicationArea = All; - ToolTip = 'PERDENDT'; - } - } - } - } -} -#pragma warning restore AA0219 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPGLTransactions.page.al b/Apps/W1/HybridGP/app/src/Migration/Accounts/GPGLTransactions.page.al deleted file mode 100644 index fc789931dd..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPGLTransactions.page.al +++ /dev/null @@ -1,124 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4091 "GP GLTransactions" -{ - PageType = List; - SourceTable = "GP GLTransactions"; - Caption = 'General Ledger Transactions'; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; -#pragma warning disable AA0219 - layout - { - area(content) - { - repeater(General) - { - field(ACTINDX; Rec.ACTINDX) - { - ApplicationArea = All; - ToolTip = 'Account Index'; - } - field(YEAR1; Rec.YEAR1) - { - ApplicationArea = All; - ToolTip = 'Year'; - } - field(PERIODID; Rec.PERIODID) - { - ApplicationArea = All; - ToolTip = 'Period ID'; - } - field(DEBITAMT; Rec.DEBITAMT) - { - ApplicationArea = All; - ToolTip = 'Debit Amount'; - } - field(CRDTAMNT; Rec.CRDTAMNT) - { - ApplicationArea = All; - ToolTip = 'Credit Amount'; - } - field(PERDBLNC; Rec.PERDBLNC) - { - ApplicationArea = All; - ToolTip = 'PERDBLNC'; - } - field(MNACSGMT; Rec.MNACSGMT) - { - ApplicationArea = All; - ToolTip = 'Main account segment'; - } - field(ACTNUMBR_1; Rec.ACTNUMBR_1) - { - ApplicationArea = All; - ToolTip = 'Account Segment 1'; - } - field(ACTNUMBR_2; Rec.ACTNUMBR_2) - { - ApplicationArea = All; - ToolTip = 'Account Segment 2'; - } - field(ACTNUMBR_3; Rec.ACTNUMBR_3) - { - ApplicationArea = All; - ToolTip = 'Account Segment 3'; - } - field(ACTNUMBR_4; Rec.ACTNUMBR_4) - { - ApplicationArea = All; - ToolTip = 'Account Segment 4'; - } - field(ACTNUMBR_5; Rec.ACTNUMBR_5) - { - ApplicationArea = All; - ToolTip = 'Account Segment 5'; - } - field(ACTNUMBR_6; Rec.ACTNUMBR_6) - { - ApplicationArea = All; - ToolTip = 'Account Segment 6'; - } - field(ACTNUMBR_7; Rec.ACTNUMBR_7) - { - ApplicationArea = All; - ToolTip = 'Account Segment 7'; - } - field(ACTNUMBR_8; Rec.ACTNUMBR_8) - { - ApplicationArea = All; - ToolTip = 'Account Segment 8'; - } - } - } - } - - actions - { - area(Navigation) - { - group(SupportingPages) - { - Caption = 'Supporting Pages'; - - action(AccountSetup) - { - ApplicationArea = All; - Caption = 'Posting Accounts'; - Promoted = true; - PromotedIsBig = true; - PromotedOnly = true; - Image = EntriesList; - RunObject = Page "GP Posting Accounts"; - RunPageMode = Edit; - ToolTip = 'Posting Account Setup'; - } - } - } - } -} -#pragma warning restore AA0219 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomer.page.al b/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomer.page.al deleted file mode 100644 index 6806aab94a..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomer.page.al +++ /dev/null @@ -1,139 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4093 "GP Customer" -{ - PageType = Card; - SourceTable = "GP Customer"; - DeleteAllowed = false; - InsertAllowed = false; - Caption = 'Customer Table'; - PromotedActionCategories = 'Related Entities'; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; -#pragma warning disable AA0219 - layout - { - area(content) - { - group(General) - { - field(CUSTNMBR; 'Customer Id') - { - ApplicationArea = All; - Caption = 'Customer Number'; - ToolTip = 'Customer Number'; - } - field(CUSTNAME; Rec.CUSTNAME) - { - ApplicationArea = All; - ToolTip = 'Customer Name'; - } - field(STMTNAME; Rec.STMTNAME) - { - ApplicationArea = All; - ToolTip = 'Statement Name'; - } - field(ADDRESS1; Rec.ADDRESS1) - { - ApplicationArea = All; - ToolTip = 'Address 1'; - } - field(ADDRESS2; Rec.ADDRESS2) - { - ApplicationArea = All; - ToolTip = 'Address 2'; - } - field(CITY; Rec.CITY) - { - ApplicationArea = All; - ToolTip = 'City'; - } - field(CNTCPRSN; Rec.CNTCPRSN) - { - ApplicationArea = All; - ToolTip = 'CNTCPRSN'; - } - field(PHONE1; Rec.PHONE1) - { - ApplicationArea = All; - ToolTip = 'Phone 1'; - } - field(SALSTERR; Rec.SALSTERR) - { - ApplicationArea = All; - ToolTip = 'Sales Territory'; - } - field(CRLMTAMT; Rec.CRLMTAMT) - { - ApplicationArea = All; - ToolTip = 'CRLMTAMT'; - } - field(PYMTRMID; Rec.PYMTRMID) - { - ApplicationArea = All; - ToolTip = 'PYMTRMID'; - } - field(SLPRSNID; Rec.SLPRSNID) - { - ApplicationArea = All; - ToolTip = 'Sales Person Id'; - } - field(SHIPMTHD; Rec.SHIPMTHD) - { - ApplicationArea = All; - ToolTip = 'Shipment Method'; - } - field(COUNTRY; Rec.COUNTRY) - { - ApplicationArea = All; - ToolTip = 'Country'; - } - field(AMOUNT; Rec.AMOUNT) - { - ApplicationArea = All; - ToolTip = 'Amount'; - } - field(STMTCYCL; Rec.STMTCYCL) - { - ApplicationArea = All; - ToolTip = 'Statement Cycle'; - } - field(ZIPCODE; Rec.ZIPCODE) - { - ApplicationArea = All; - ToolTip = 'Zip Code'; - } - field(STATE; Rec.STATE) - { - ApplicationArea = All; - ToolTip = 'State'; - } - field(INET1; Rec.INET1) - { - ApplicationArea = All; - ToolTip = 'Internet Address 1'; - } - field(INET2; Rec.INET2) - { - ApplicationArea = All; - ToolTip = 'Internet Address 2'; - } - field(UPSZONE; Rec.UPSZONE) - { - ApplicationArea = All; - ToolTip = 'UPS Zone'; - } - field(TAXEXMT1; Rec.TAXEXMT1) - { - ApplicationArea = All; - ToolTip = 'Tax Excempt 1'; - } - } - } - } -} -#pragma warning restore AA0219 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerTransactions.page.al b/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerTransactions.page.al deleted file mode 100644 index f70d64db38..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerTransactions.page.al +++ /dev/null @@ -1,106 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4094 "GP Customer Transactions" -{ - Caption = 'GP Customer Transactions'; - PageType = List; - SourceTable = "GP Customer Transactions"; - ApplicationArea = All; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; - -#pragma warning disable AA0219 - layout - { - area(content) - { - repeater(General) - { - field(Id; Rec.Id) - { - ApplicationArea = All; - ToolTip = 'Id'; - } - field(CUSTNMBR; Rec.CUSTNMBR) - { - ApplicationArea = All; - ToolTip = 'Customer Number'; - } - field(DOCNUMBR; Rec.DOCNUMBR) - { - ApplicationArea = All; - ToolTip = 'Document Number'; - } - field(DOCDATE; Rec.DOCDATE) - { - ApplicationArea = All; - ToolTip = 'Document Date'; - } - field(DUEDATE; Rec.DUEDATE) - { - ApplicationArea = All; - ToolTip = 'Due Date'; - } - field(CURTRXAM; Rec.CURTRXAM) - { - ApplicationArea = All; - ToolTip = 'Customer Transaction Amount'; - } - field(RMDTYPAL; Rec.RMDTYPAL) - { - ApplicationArea = All; - ToolTip = 'RMDTYPAL'; - } - field(GLDocNo; Rec.GLDocNo) - { - ApplicationArea = All; - ToolTip = 'GL Document Number'; - } - field(TransType; Rec.TransType) - { - ApplicationArea = All; - ToolTip = 'Transaction Type'; - } - field(SLPRSNID; Rec.SLPRSNID) - { - ApplicationArea = All; - ToolTip = 'Salesperson Id'; - } - field(PYMTRMID; Rec.PYMTRMID) - { - ApplicationArea = All; - ToolTip = 'PYMTRMID'; - } - } - } - } - - actions - { - area(Navigation) - { - group(SupportingPages) - { - Caption = 'Supporting Pages'; - - action(AccountSetup) - { - ApplicationArea = All; - Caption = 'Posting Accounts'; - Promoted = true; - PromotedIsBig = true; - PromotedOnly = true; - Image = EntriesList; - RunObject = Page "GP Posting Accounts"; - RunPageMode = Edit; - ToolTip = 'Posting Account Setup'; - } - } - } - } -} -#pragma warning restore AA0219 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al b/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al index 2371873a61..46cb398ad2 100644 --- a/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al +++ b/Apps/W1/HybridGP/app/src/Migration/GPTables/GPPopulateCombinedTables.Codeunit.al @@ -329,8 +329,6 @@ codeunit 40125 "GP Populate Combined Tables" var GPCustomer: Record "GP Customer"; GPRM00101: Record "GP RM00101"; - GPRM00103: Record "GP RM00103"; - GPSY01200: Record "GP SY01200"; GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; begin GPRM00101.SetRange(INACTIVE, false); @@ -342,53 +340,58 @@ codeunit 40125 "GP Populate Combined Tables" repeat Clear(GPCustomer); + SetGPCustomerFields(GPCustomer, GPRM00101); + GPCustomer.Insert(); + until GPRM00101.Next() = 0; + end; + + internal procedure SetGPCustomerFields(var GPCustomer: Record "GP Customer"; var GPRM00101: Record "GP RM00101") + var + GPRM00103: Record "GP RM00103"; + GPSY01200: Record "GP SY01200"; + begin #pragma warning disable AA0139 - GPCustomer.CUSTNMBR := GPRM00101.CUSTNMBR.Trim(); - GPCustomer.CUSTNAME := GPRM00101.CUSTNAME.Trim(); - GPCustomer.STMTNAME := GPRM00101.STMTNAME.Trim(); - GPCustomer.ADDRESS1 := GPRM00101.ADDRESS1.Trim(); - GPCustomer.ADDRESS2 := GPRM00101.ADDRESS2.Trim(); - GPCustomer.CITY := GPRM00101.CITY.Trim(); - GPCustomer.CNTCPRSN := GPRM00101.CNTCPRSN.Trim(); - GPCustomer.SALSTERR := GPRM00101.SALSTERR.Trim(); - GPCustomer.CRLMTAMT := GPRM00101.CRLMTAMT; - GPCustomer.PYMTRMID := GPRM00101.PYMTRMID.Trim(); - GPCustomer.SLPRSNID := GPRM00101.SLPRSNID.Trim(); - GPCustomer.SHIPMTHD := GPRM00101.SHIPMTHD.Trim(); - GPCustomer.COUNTRY := GPRM00101.COUNTRY.Trim(); - GPCustomer.STMTCYCL := GPRM00101.STMTCYCL <> 0; - GPCustomer.ZIPCODE := GPRM00101.ZIP.Trim(); - GPCustomer.STATE := GPRM00101.STATE.Trim(); - GPCustomer.TAXSCHID := GPRM00101.TAXSCHID.Trim(); - GPCustomer.UPSZONE := GPRM00101.UPSZONE.Trim(); - GPCustomer.TAXEXMT1 := GPRM00101.TAXEXMT1.Trim(); - GPCustomer.CUSTCLAS := GPRM00101.CUSTCLAS.Trim(); - GPCustomer.RMSLSACC := GPRM00101.RMSLSACC; + GPCustomer.CUSTNMBR := GPRM00101.CUSTNMBR.Trim(); + GPCustomer.CUSTNAME := GPRM00101.CUSTNAME.Trim(); + GPCustomer.STMTNAME := GPRM00101.STMTNAME.Trim(); + GPCustomer.ADDRESS1 := GPRM00101.ADDRESS1.Trim(); + GPCustomer.ADDRESS2 := GPRM00101.ADDRESS2.Trim(); + GPCustomer.CITY := GPRM00101.CITY.Trim(); + GPCustomer.CNTCPRSN := GPRM00101.CNTCPRSN.Trim(); + GPCustomer.SALSTERR := GPRM00101.SALSTERR.Trim(); + GPCustomer.CRLMTAMT := GPRM00101.CRLMTAMT; + GPCustomer.PYMTRMID := GPRM00101.PYMTRMID.Trim(); + GPCustomer.SLPRSNID := GPRM00101.SLPRSNID.Trim(); + GPCustomer.SHIPMTHD := GPRM00101.SHIPMTHD.Trim(); + GPCustomer.COUNTRY := GPRM00101.COUNTRY.Trim(); + GPCustomer.STMTCYCL := GPRM00101.STMTCYCL <> 0; + GPCustomer.ZIPCODE := GPRM00101.ZIP.Trim(); + GPCustomer.STATE := GPRM00101.STATE.Trim(); + GPCustomer.TAXSCHID := GPRM00101.TAXSCHID.Trim(); + GPCustomer.UPSZONE := GPRM00101.UPSZONE.Trim(); + GPCustomer.TAXEXMT1 := GPRM00101.TAXEXMT1.Trim(); #pragma warning restore AA0139 - if GPRM00101.PHONE1.Contains('E+') then - GPCustomer.PHONE1 := '00000000000000' - else - GPCustomer.PHONE1 := CopyStr(GPRM00101.PHONE1.Trim(), 1, MaxStrLen(GPCustomer.PHONE1)); + if GPRM00101.PHONE1.Contains('E+') then + GPCustomer.PHONE1 := '00000000000000' + else + GPCustomer.PHONE1 := CopyStr(GPRM00101.PHONE1.Trim(), 1, MaxStrLen(GPCustomer.PHONE1)); - if GPRM00101.FAX.Contains('E+') then - GPCustomer.FAX := '00000000000000' - else - GPCustomer.FAX := CopyStr(GPRM00101.FAX.Trim(), 1, MaxStrLen(GPCustomer.FAX)); + if GPRM00101.FAX.Contains('E+') then + GPCustomer.FAX := '00000000000000' + else + GPCustomer.FAX := CopyStr(GPRM00101.FAX.Trim(), 1, MaxStrLen(GPCustomer.FAX)); - if GPRM00103.Get(GPRM00101.CUSTNMBR) then - GPCustomer.AMOUNT := GPRM00103.CUSTBLNC; + if GPRM00103.Get(GPRM00101.CUSTNMBR) then + GPCustomer.AMOUNT := GPRM00103.CUSTBLNC; - if GPSY01200.Get('CUS', GPRM00101.CUSTNMBR, GPRM00101.ADRSCODE) then begin - if ((GPSY01200.INET1 <> '') and (GPSY01200.INET1.Contains('@'))) then - GPCustomer.INET1 := CopyStr(GPSY01200.INET1.Trim(), 1, MaxStrLen(GPCustomer.INET1)); + if GPSY01200.Get('CUS', GPRM00101.CUSTNMBR, GPRM00101.ADRSCODE) then begin + if ((GPSY01200.INET1 <> '') and (GPSY01200.INET1.Contains('@'))) then + GPCustomer.INET1 := CopyStr(GPSY01200.INET1.Trim(), 1, MaxStrLen(GPCustomer.INET1)); - if ((GPSY01200.INET2 <> '') and (GPSY01200.INET2.Contains('@'))) then - GPCustomer.INET2 := CopyStr(GPSY01200.INET2.Trim(), 1, MaxStrLen(GPCustomer.INET2)); - end; - - GPCustomer.Insert(); - until GPRM00101.Next() = 0; + if ((GPSY01200.INET2 <> '') and (GPSY01200.INET2.Contains('@'))) then + GPCustomer.INET2 := CopyStr(GPSY01200.INET2.Trim(), 1, MaxStrLen(GPCustomer.INET2)); + end; end; internal procedure PopulateGPCustomerTransactions() @@ -527,66 +530,69 @@ codeunit 40125 "GP Populate Combined Tables" internal procedure PopulateGPVendors() var GPPM00200Vendor: Record "GP PM00200"; - GPPM00201VendorSum: Record "GP PM00201"; - GPSY01200NetAddresses: Record "GP SY01200"; GPVendor: Record "GP Vendor"; - GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; + GPCompanyMigrationSettings: Record "GP Company Migration Settings"; begin GPPM00200Vendor.SetFilter(VENDSTTS, '1|3'); - if GPCompanyAdditionalSettings.GetMigrateInactiveVendors() then - GPPM00200Vendor.SetRange(VENDSTTS); + if GPCompanyMigrationSettings.Get(CompanyName()) then + if GPCompanyMigrationSettings."Migrate Inactive Vendors" then + GPPM00200Vendor.SetRange(VENDSTTS); if not GPPM00200Vendor.FindSet() then exit; repeat Clear(GPVendor); + SetGPVendorFields(GPVendor, GPPM00200Vendor); + GPVendor.Insert(); + until GPPM00200Vendor.Next() = 0; + end; + + internal procedure SetGPVendorFields(var GPVendor: Record "GP Vendor"; GPPM00200Vendor: Record "GP PM00200") + var + GPPM00201VendorSum: Record "GP PM00201"; + GPSY01200NetAddresses: Record "GP SY01200"; + begin #pragma warning disable AA0139 - GPVendor.VENDORID := GPPM00200Vendor.VENDORID.TrimEnd(); - GPVendor.VENDNAME := GPPM00200Vendor.VENDNAME.TrimEnd(); - GPVendor.SEARCHNAME := GPPM00200Vendor.VENDNAME.TrimEnd(); - GPVendor.VNDCHKNM := GPPM00200Vendor.VNDCHKNM.TrimEnd(); - GPVendor.ADDRESS1 := GPPM00200Vendor.ADDRESS1.TrimEnd(); - GPVendor.ADDRESS2 := GPPM00200Vendor.ADDRESS2.TrimEnd(); - GPVendor.CITY := GPPM00200Vendor.CITY.TrimEnd(); - GPVendor.VNDCNTCT := GPPM00200Vendor.VNDCNTCT.TrimEnd(); - GPVendor.PYMTRMID := GPPM00200Vendor.PYMTRMID.TrimEnd(); - GPVendor.SHIPMTHD := GPPM00200Vendor.SHIPMTHD.TrimEnd(); - GPVendor.COUNTRY := GPPM00200Vendor.COUNTRY.TrimEnd(); - GPVendor.PYMNTPRI := GPPM00200Vendor.PYMNTPRI.TrimEnd(); - GPVendor.ZIPCODE := GPPM00200Vendor.ZIPCODE.TrimEnd(); - GPVendor.STATE := GPPM00200Vendor.STATE.TrimEnd(); - GPVendor.TAXSCHID := GPPM00200Vendor.TAXSCHID.TrimEnd(); - GPVendor.UPSZONE := GPPM00200Vendor.UPSZONE.TrimEnd(); - GPVendor.TXIDNMBR := GPPM00200Vendor.TXIDNMBR.TrimEnd(); - GPVendor.VNDCLSID := GPPM00200Vendor.VNDCLSID.TrimEnd(); + GPVendor.VENDORID := GPPM00200Vendor.VENDORID.TrimEnd(); + GPVendor.VENDNAME := GPPM00200Vendor.VENDNAME.TrimEnd(); + GPVendor.SEARCHNAME := GPPM00200Vendor.VENDNAME.TrimEnd(); + GPVendor.VNDCHKNM := GPPM00200Vendor.VNDCHKNM.TrimEnd(); + GPVendor.ADDRESS1 := GPPM00200Vendor.ADDRESS1.TrimEnd(); + GPVendor.ADDRESS2 := GPPM00200Vendor.ADDRESS2.TrimEnd(); + GPVendor.CITY := GPPM00200Vendor.CITY.TrimEnd(); + GPVendor.VNDCNTCT := GPPM00200Vendor.VNDCNTCT.TrimEnd(); + GPVendor.PYMTRMID := GPPM00200Vendor.PYMTRMID.TrimEnd(); + GPVendor.SHIPMTHD := GPPM00200Vendor.SHIPMTHD.TrimEnd(); + GPVendor.COUNTRY := GPPM00200Vendor.COUNTRY.TrimEnd(); + GPVendor.PYMNTPRI := GPPM00200Vendor.PYMNTPRI.TrimEnd(); + GPVendor.ZIPCODE := GPPM00200Vendor.ZIPCODE.TrimEnd(); + GPVendor.STATE := GPPM00200Vendor.STATE.TrimEnd(); + GPVendor.TAXSCHID := GPPM00200Vendor.TAXSCHID.TrimEnd(); + GPVendor.UPSZONE := GPPM00200Vendor.UPSZONE.TrimEnd(); + GPVendor.TXIDNMBR := GPPM00200Vendor.TXIDNMBR.TrimEnd(); #pragma warning restore AA0139 - GPVendor.PMPRCHIX := GPPM00200Vendor.PMPRCHIX; - - if GPPM00200Vendor.PHNUMBR1.Contains('E+') then - GPVendor.PHNUMBR1 := '00000000000000' - else - GPVendor.PHNUMBR1 := CopyStr(GPPM00200Vendor.PHNUMBR1.Trim(), 1, MaxStrLen(GPVendor.PHNUMBR1)); - - if GPPM00200Vendor.FAXNUMBR.Contains('E+') then - GPVendor.FAXNUMBR := '00000000000000' - else - GPVendor.FAXNUMBR := CopyStr(GPPM00200Vendor.FAXNUMBR.Trim(), 1, MaxStrLen(GPVendor.FAXNUMBR)); + if GPPM00200Vendor.PHNUMBR1.Contains('E+') then + GPVendor.PHNUMBR1 := '00000000000000' + else + GPVendor.PHNUMBR1 := CopyStr(GPPM00200Vendor.PHNUMBR1.Trim(), 1, MaxStrLen(GPVendor.PHNUMBR1)); - if GPPM00201VendorSum.Get(GPPM00200Vendor.VENDORID) then - GPVendor.AMOUNT := GPPM00201VendorSum.CURRBLNC; + if GPPM00200Vendor.FAXNUMBR.Contains('E+') then + GPVendor.FAXNUMBR := '00000000000000' + else + GPVendor.FAXNUMBR := CopyStr(GPPM00200Vendor.FAXNUMBR.Trim(), 1, MaxStrLen(GPVendor.FAXNUMBR)); - if GPSY01200NetAddresses.Get('VEN', GPPM00200Vendor.VENDORID, GPPM00200Vendor.VADDCDPR) then begin - if ((GPSY01200NetAddresses.INET1 <> '') and (GPSY01200NetAddresses.INET1.Contains('@'))) then - GPVendor.INET1 := CopyStr(GPSY01200NetAddresses.INET1.Trim(), 1, MaxStrLen(GPVendor.INET1)); + if GPPM00201VendorSum.Get(GPPM00200Vendor.VENDORID) then + GPVendor.AMOUNT := GPPM00201VendorSum.CURRBLNC; - if ((GPSY01200NetAddresses.INET2 <> '') and (GPSY01200NetAddresses.INET2.Contains('@'))) then - GPVendor.INET2 := CopyStr(GPSY01200NetAddresses.INET2.Trim(), 1, MaxStrLen(GPVendor.INET2)); - end; + if GPSY01200NetAddresses.Get('VEN', GPPM00200Vendor.VENDORID, GPPM00200Vendor.VADDCDPR) then begin + if ((GPSY01200NetAddresses.INET1 <> '') and (GPSY01200NetAddresses.INET1.Contains('@'))) then + GPVendor.INET1 := CopyStr(GPSY01200NetAddresses.INET1.Trim(), 1, MaxStrLen(GPVendor.INET1)); - GPVendor.Insert(); - until GPPM00200Vendor.Next() = 0; + if ((GPSY01200NetAddresses.INET2 <> '') and (GPSY01200NetAddresses.INET2.Contains('@'))) then + GPVendor.INET2 := CopyStr(GPSY01200NetAddresses.INET2.Trim(), 1, MaxStrLen(GPVendor.INET2)); + end; end; internal procedure PopulateGPVendorTransactions() @@ -667,12 +673,6 @@ codeunit 40125 "GP Populate Combined Tables" var GPItem: Record "GP Item"; GPIV00101Inventory: Record "GP IV00101"; - GPIV00102InventoryQty: Record "GP IV00102"; - GPIV00105inventoryCurr: Record "GP IV00105"; - GPIV40201InventoryUom: Record "GP IV40201"; - DummyItem: Record Item; - GPMC40000: Record "GP MC40000"; - FoundCurrency: Boolean; begin UpdateGLSetupUnitRoundingPrecisionIfNeeded(); @@ -682,79 +682,90 @@ codeunit 40125 "GP Populate Combined Tables" repeat Clear(GPItem); if ShouldAddItemToStagingTable(GPIV00101Inventory) then begin - GPItem.No := CopyStr(GPIV00101Inventory.ITEMNMBR.TrimEnd(), 1, MaxStrLen(DummyItem."No.")); - GPItem.Description := CopyStr(GPIV00101Inventory.ITEMDESC.TrimEnd(), 1, MaxStrLen(GPItem.Description)); - GPItem.SearchDescription := CopyStr(GPIV00101Inventory.ITEMDESC.TrimEnd(), 1, MaxStrLen(GPItem.SearchDescription)); + SetGPItemFields(GPItem, GPIV00101Inventory); + GPItem.Insert(); + end; + until GPIV00101Inventory.Next() = 0; + end; + + internal procedure SetGPItemFields(var GPItem: Record "GP Item"; var GPIV00101Inventory: Record "GP IV00101") + var + GPIV00102InventoryQty: Record "GP IV00102"; + GPIV00105inventoryCurr: Record "GP IV00105"; + GPIV40201InventoryUom: Record "GP IV40201"; + DummyItem: Record Item; + GPMC40000: Record "GP MC40000"; + FoundCurrency: Boolean; + begin + GPItem.No := CopyStr(GPIV00101Inventory.ITEMNMBR.TrimEnd(), 1, MaxStrLen(DummyItem."No.")); + GPItem.Description := CopyStr(GPIV00101Inventory.ITEMDESC.TrimEnd(), 1, MaxStrLen(GPItem.Description)); + GPItem.SearchDescription := CopyStr(GPIV00101Inventory.ITEMDESC.TrimEnd(), 1, MaxStrLen(GPItem.SearchDescription)); #pragma warning disable AA0139 - GPItem.ShortName := GPIV00101Inventory.ITEMNMBR.TrimEnd(); + GPItem.ShortName := GPIV00101Inventory.ITEMNMBR.TrimEnd(); #pragma warning restore AA0139 - case GPIV00101Inventory.ITEMTYPE of - 1, 2: - GPItem.ItemType := 0; - 4, 5, 6: - GPItem.ItemType := 1; - 3: - GPItem.ItemType := 2; - end; + case GPIV00101Inventory.ITEMTYPE of + 1, 2: + GPItem.ItemType := 0; + 4, 5, 6: + GPItem.ItemType := 1; + 3: + GPItem.ItemType := 2; + end; - case GPIV00101Inventory.VCTNMTHD of - 1: - GPItem.CostingMethod := Format(0); - 2: - GPItem.CostingMethod := Format(1); - 3: - GPItem.CostingMethod := Format(3); - 4, 5: - GPItem.CostingMethod := Format(4); - else - GPItem.CostingMethod := Format(0); - end; + case GPIV00101Inventory.VCTNMTHD of + 1: + GPItem.CostingMethod := Format(0); + 2: + GPItem.CostingMethod := Format(1); + 3: + GPItem.CostingMethod := Format(3); + 4, 5: + GPItem.CostingMethod := Format(4); + else + GPItem.CostingMethod := Format(0); + end; - GPItem.CurrentCost := GPIV00101Inventory.CURRCOST; - GPItem.StandardCost := GPIV00101Inventory.STNDCOST; + GPItem.CurrentCost := GPIV00101Inventory.CURRCOST; + GPItem.StandardCost := GPIV00101Inventory.STNDCOST; #pragma warning disable AA0139 - GPItem.SalesUnitOfMeasure := GPIV00101Inventory.SELNGUOM.Trim(); - GPItem.PurchUnitOfMeasure := GPIV00101Inventory.PRCHSUOM.Trim(); - GPItem.SalesUnitOfMeasure := GPIV00101Inventory.SELNGUOM.Trim(); - GPItem.SalesUnitOfMeasure := GPIV00101Inventory.SELNGUOM.Trim(); + GPItem.SalesUnitOfMeasure := GPIV00101Inventory.SELNGUOM.Trim(); + GPItem.PurchUnitOfMeasure := GPIV00101Inventory.PRCHSUOM.Trim(); + GPItem.SalesUnitOfMeasure := GPIV00101Inventory.SELNGUOM.Trim(); + GPItem.SalesUnitOfMeasure := GPIV00101Inventory.SELNGUOM.Trim(); #pragma warning restore AA0139 - case GPIV00101Inventory.ITMTRKOP of - 2: - GPItem.ItemTrackingCode := ItemTrackingCodeSERIALLbl; - 3: - GPItem.ItemTrackingCode := ItemTrackingCodeLOTLbl; - end; + case GPIV00101Inventory.ITMTRKOP of + 2: + GPItem.ItemTrackingCode := ItemTrackingCodeSERIALLbl; + 3: + GPItem.ItemTrackingCode := ItemTrackingCodeLOTLbl; + end; - GPItem.ShipWeight := GPIV00101Inventory.ITEMSHWT / 100; - if GPIV00101Inventory.ITEMTYPE = 2 then - GPItem.InActive := true - else - GPItem.InActive := GPIV00101Inventory.INACTIVE; + GPItem.ShipWeight := GPIV00101Inventory.ITEMSHWT / 100; + if GPIV00101Inventory.ITEMTYPE = 2 then + GPItem.InActive := true + else + GPItem.InActive := GPIV00101Inventory.INACTIVE; - GPIV40201InventoryUom.SetRange(UOMSCHDL, GPIV00101Inventory.UOMSCHDL); - if GPIV40201InventoryUom.FindFirst() then + GPIV40201InventoryUom.SetRange(UOMSCHDL, GPIV00101Inventory.UOMSCHDL); + if GPIV40201InventoryUom.FindFirst() then #pragma warning disable AA0139 - GPItem.BaseUnitOfMeasure := GPIV40201InventoryUom.BASEUOFM.Trim(); + GPItem.BaseUnitOfMeasure := GPIV40201InventoryUom.BASEUOFM.Trim(); #pragma warning restore AA0139 - GPIV00102InventoryQty.SetRange(ITEMNMBR, GPIV00101Inventory.ITEMNMBR); - GPIV00102InventoryQty.SetRange(LOCNCODE, ''); - GPIV00102InventoryQty.SetRange(RCRDTYPE, 1); - if GPIV00102InventoryQty.FindFirst() then - GPItem.QuantityOnHand := GPIV00102InventoryQty.QTYONHND; - - GPIV00105inventoryCurr.SetRange(ITEMNMBR, GPIV00101Inventory.ITEMNMBR); - if GPIV00105inventoryCurr.FindSet() then - repeat - FoundCurrency := GPMC40000.Get(GPIV00105inventoryCurr.CURNCYID); - until (GPIV00105inventoryCurr.Next() = 0) or FoundCurrency; + GPIV00102InventoryQty.SetRange(ITEMNMBR, GPIV00101Inventory.ITEMNMBR); + GPIV00102InventoryQty.SetRange(LOCNCODE, ''); + GPIV00102InventoryQty.SetRange(RCRDTYPE, 1); + if GPIV00102InventoryQty.FindFirst() then + GPItem.QuantityOnHand := GPIV00102InventoryQty.QTYONHND; - if FoundCurrency then - GPItem.UnitListPrice := GPIV00105inventoryCurr.LISTPRCE; + GPIV00105inventoryCurr.SetRange(ITEMNMBR, GPIV00101Inventory.ITEMNMBR); + if GPIV00105inventoryCurr.FindSet() then + repeat + FoundCurrency := GPMC40000.Get(GPIV00105inventoryCurr.CURNCYID); + until (GPIV00105inventoryCurr.Next() = 0) or FoundCurrency; - GPItem.Insert(); - end; - until GPIV00101Inventory.Next() = 0; + if FoundCurrency then + GPItem.UnitListPrice := GPIV00105inventoryCurr.LISTPRCE; end; local procedure UpdateGLSetupUnitRoundingPrecisionIfNeeded() diff --git a/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastHandler.codeunit.al b/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastHandler.codeunit.al deleted file mode 100644 index e7c9788aec..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastHandler.codeunit.al +++ /dev/null @@ -1,15 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -codeunit 4034 "GPForecastHandler" -{ - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Forecast functionality is not used in this migration app.'; - - [Obsolete('Forecast functionality is not used in this migration app.', '26.0')] - procedure SetGPIVTrxAmountsHistFilters(var GPIVTrxAmountsHist: Record GPIVTrxAmountsHist; ItemNo: Code[20]) - begin - end; -} -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastTemp.table.al b/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastTemp.table.al deleted file mode 100644 index 634b0421ff..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastTemp.table.al +++ /dev/null @@ -1,53 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -#pragma warning disable AS0109 -table 4031 "GPForecastTemp" -{ - TableType = Temporary; - ReplicateData = false; - Extensible = false; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - ObsoleteReason = 'Forecast functionality is not used in this migration app.'; - - fields - { - field(1; DocNumber; Text[22]) - { - DataClassification = CustomerContent; - Caption = 'Document Number'; - } - field(2; DocType; Option) - { - DataClassification = CustomerContent; - Caption = 'Document Type'; - OptionMembers = "Invoice","Sales/Invoices","Credit Memo","Credit Memos"; - } - field(3; DueDate; Date) - { - DataClassification = CustomerContent; - Caption = 'Due Date'; - } - field(4; Amount; Decimal) - { - AutoFormatType = 0; - DataClassification = CustomerContent; - Caption = 'Document Amount'; - } - } - - keys - { - key(PK; DocNumber) - { - Clustered = false; - } - key(DueDate; DUEDATE) - { - Clustered = false; - } - } -} -#pragma warning restore AS0109 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Items/GPItem.page.al b/Apps/W1/HybridGP/app/src/Migration/Items/GPItem.page.al deleted file mode 100644 index 920f4275f4..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Items/GPItem.page.al +++ /dev/null @@ -1,132 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4095 "GP Item" -{ - PageType = Card; - SourceTable = "GP Item"; - DeleteAllowed = false; - InsertAllowed = false; - Caption = 'Item Table'; - PromotedActionCategories = 'Related Entities'; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; -#pragma warning disable AA0219 - layout - { - area(content) - { - group(General) - { - field(No; Rec.No) - { - ApplicationArea = All; - ToolTip = 'Number'; - } - field(Description; Rec.Description) - { - ApplicationArea = All; - ToolTip = 'Description'; - } - field(SearchDescription; Rec.SearchDescription) - { - ApplicationArea = All; - ToolTip = 'Search Description'; - } - field(ShortName; Rec.ShortName) - { - ApplicationArea = All; - ToolTip = 'Short Name'; - } - field(BaseUnitOfMeasure; Rec.BaseUnitOfMeasure) - { - ApplicationArea = All; - ToolTip = 'Base Unit of Measure'; - } - field(ItemType; Rec.ItemType) - { - ApplicationArea = All; - ToolTip = 'ITem Type'; - } - field(CostingMethod; Rec.CostingMethod) - { - ApplicationArea = All; - ToolTip = 'Costing Method'; - } - field(CurrentCost; Rec.CurrentCost) - { - ApplicationArea = All; - ToolTip = 'Current Cost'; - } - field(StandardCost; Rec.StandardCost) - { - ApplicationArea = All; - ToolTip = 'Standard Cost'; - } - field(UnitListPrice; Rec.UnitListPrice) - { - ApplicationArea = All; - ToolTip = 'Unit List Price'; - } - field(ShipWeight; Rec.ShipWeight) - { - ApplicationArea = All; - ToolTip = 'Ship Weight'; - } - field(InActive; Rec.InActive) - { - ApplicationArea = All; - ToolTip = 'InActive'; - } - field(QuantityOnHand; Rec.QuantityOnHand) - { - ApplicationArea = All; - ToolTip = 'Quantity On Hand'; - } - field(SalesUnitOfMeasure; Rec.SalesUnitOfMeasure) - { - ApplicationArea = All; - ToolTip = 'Sales Unit of Measure'; - } - field(PurchUnitOfMeasure; Rec.PurchUnitOfMeasure) - { - ApplicationArea = All; - ToolTip = 'Purchase Unit of Measure'; - } - field(ItemTrackingCode; Rec.ItemTrackingCode) - { - ApplicationArea = All; - ToolTip = 'Item Tracking Code'; - } - } - } - } -#pragma warning restore AA0219 - - actions - { - area(Navigation) - { - group(SupportingPages) - { - Caption = 'Supporting Pages'; - - action(AccountSetup) - { - ApplicationArea = All; - Caption = 'Posting Accounts'; - Promoted = true; - PromotedIsBig = true; - PromotedOnly = true; - Image = EntriesList; - RunObject = Page "GP Posting Accounts"; - RunPageMode = Edit; - ToolTip = 'Posting Account Setup'; - } - } - } - } -} -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Support/CheckBooks/GPCheckbookTransactions.table.al b/Apps/W1/HybridGP/app/src/Migration/Support/CheckBooks/GPCheckbookTransactions.table.al index ee37f8b96a..728548b5da 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Support/CheckBooks/GPCheckbookTransactions.table.al +++ b/Apps/W1/HybridGP/app/src/Migration/Support/CheckBooks/GPCheckbookTransactions.table.al @@ -230,4 +230,9 @@ table 40101 "GP Checkbook Transactions" Clustered = true; } } + + internal procedure ShouldFlipSign(): Boolean + begin + exit((Rec.CMTrxType = 3) or (Rec.CMTrxType = 4) or (Rec.CMTrxType = 6)); + end; } \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Support/GPPostingAccounts.page.al b/Apps/W1/HybridGP/app/src/Migration/Support/GPPostingAccounts.page.al deleted file mode 100644 index a946920a42..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Support/GPPostingAccounts.page.al +++ /dev/null @@ -1,148 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4026 "GP Posting Accounts" -{ - Caption = 'GP Posting Accounts'; - PageType = Card; - SourceTable = "GP Posting Accounts"; - DeleteAllowed = false; - InsertAllowed = false; - PromotedActionCategories = 'Posting Accounts'; - ApplicationArea = All; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; -#pragma warning disable AA0219 - - layout - { - area(content) - { - group(General) - { - field(SalesAccount; Rec.SalesAccount) - { - ApplicationArea = All; - Caption = 'Sales Account'; - ToolTip = 'Sales Account'; - } - field(SalesLineDiscAccount; Rec.SalesLineDiscAccount) - { - ApplicationArea = All; - Caption = 'Sales Line Disc. Account'; - ToolTip = 'Sales Line Disc. Account'; - } - field(SalesInvDiscAccount; Rec.SalesInvDiscAccount) - { - ApplicationArea = All; - Caption = 'Sales Inv. Disc. Account'; - ToolTip = 'Sales Inv. Disc. Account'; - } - - field(SalesPmtDiscDebitAccount; Rec.SalesPmtDiscDebitAccount) - { - ApplicationArea = All; - Caption = 'Purch. Account'; - ToolTip = 'Purch. Account'; - } - field(PurchAccount; Rec.PurchAccount) - { - ApplicationArea = All; - Caption = 'Purch. Account'; - ToolTip = 'Purch. Account'; - } - field(PurchInvDiscAccount; Rec.PurchInvDiscAccount) - { - ApplicationArea = All; - Caption = 'Purch. Inv. Disc. Account'; - ToolTip = 'Purch. Inv. Disc. Account'; - } - field(COGSAccount; Rec.COGSAccount) - { - ApplicationArea = All; - Caption = 'COGS Account'; - ToolTip = 'COGS Account'; - } - field(InventoryAdjmtAccount; Rec.InventoryAdjmtAccount) - { - ApplicationArea = All; - Caption = 'Inventory Adjmt. Account'; - ToolTip = 'Inventory Adjmt. Account'; - } - field(SalesCreditMemoAccount; Rec.SalesCreditMemoAccount) - { - ApplicationArea = All; - Caption = 'Sales Credit Memo Account'; - ToolTip = 'Sales Credit Memo Account'; - } - field(PurchPmtDiscDebitAcc; Rec.PurchPmtDiscDebitAcc) - { - ApplicationArea = All; - Caption = 'Purchase Payment Discount Debit Account'; - ToolTip = 'Purchase Payment Discount Debit Account'; - } - - field(PurchPrepaymentsAccount; Rec.PurchPrepaymentsAccount) - { - ApplicationArea = All; - Caption = 'Purchase Prepayments Account'; - ToolTip = 'Purchase Prepayments Account'; - } - - field(PurchaseVarianceAccount; Rec.PurchaseVarianceAccount) - { - ApplicationArea = All; - Caption = 'Purchase Variance Account'; - ToolTip = 'Purchase Variance Account'; - } - - field(InventoryAccount; Rec.InventoryAccount) - { - ApplicationArea = All; - Caption = 'Inventory Account'; - ToolTip = 'Inventory Account'; - } - field(ReceivablesAccount; Rec.ReceivablesAccount) - { - ApplicationArea = All; - Caption = 'Receivables Account'; - ToolTip = 'Receivables Account'; - } - field(ServiceChargeAccount; Rec.ServiceChargeAccount) - { - ApplicationArea = All; - Caption = 'Service Charge Acc.'; - ToolTip = 'Service Charge Acc.'; - } - field(PaymentDiscDebitAccount; Rec.PaymentDiscDebitAccount) - { - ApplicationArea = All; - Caption = 'Payment Disc. Debit Acc.'; - ToolTip = 'Payment Disc. Debit Acc.'; - } - field(PayablesAccount; Rec.PayablesAccount) - { - ApplicationArea = All; - Caption = 'Payables Account'; - ToolTip = 'Payables Account'; - } - field(PurchServiceChargeAccount; Rec.PurchServiceChargeAccount) - { - ApplicationArea = All; - Caption = 'Purch. Service Charge Acc.'; - ToolTip = 'Purch. Service Charge Acc.'; - } - field(PurchPmtDiscDebitAccount; Rec.PurchPmtDiscDebitAccount) - { - ApplicationArea = All; - Caption = 'Purch. Payment Disc. Debit Acc.'; - ToolTip = 'Purch. Payment Disc. Debit Acc.'; - } - } - } - } -} -#pragma warning restore AA0219 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Support/HelperFunctions.codeunit.al b/Apps/W1/HybridGP/app/src/Migration/Support/HelperFunctions.codeunit.al index dff1c582af..851bc1ec4a 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Support/HelperFunctions.codeunit.al +++ b/Apps/W1/HybridGP/app/src/Migration/Support/HelperFunctions.codeunit.al @@ -1065,7 +1065,7 @@ codeunit 4037 "Helper Functions" if GPVendor.FindSet() then repeat if GPVendorMigrator.ShouldMigrateVendor(GPVendor.VENDORID, IsTemporaryVendor, HasOpenPurchaseOrders, HasOpenTransactions) then - VendorCount := VendorCount + 1; + VendorCount += 1; until GPVendor.Next() = 0; @@ -1148,7 +1148,7 @@ codeunit 4037 "Helper Functions" GenJournalLine.SetRange("Journal Template Name", GenJournalBatch."Journal Template Name"); GenJournalLine.SetRange("Journal Batch Name", GenJournalBatch.Name); if not GenJournalLine.IsEmpty() then - UnpostedBatchCount := UnpostedBatchCount + 1; + UnpostedBatchCount += 1; until GenJournalBatch.Next() = 0; exit(UnpostedBatchCount); @@ -1171,7 +1171,7 @@ codeunit 4037 "Helper Functions" repeat ItemJournalLine.SetRange("Journal Batch Name", ItemJournalBatch.Name); if not ItemJournalLine.IsEmpty() then - UnpostedBatchCount += UnpostedBatchCount + 1; + UnpostedBatchCount += 1; until ItemJournalBatch.Next() = 0; exit(UnpostedBatchCount); @@ -1194,20 +1194,23 @@ codeunit 4037 "Helper Functions" repeat StatisticalAccJournalLine.SetRange("Journal Batch Name", StatisticalAccJournalBatch.Name); if not StatisticalAccJournalLine.IsEmpty() then - UnpostedBatchCount += UnpostedBatchCount + 1; + UnpostedBatchCount += 1; until StatisticalAccJournalBatch.Next() = 0; exit(UnpostedBatchCount); end; - internal procedure GetUnpostedBatchCountForCompany(CompanyNameTxt: Text; var TotalGLBatchCount: Integer; var TotalStatisticalBatchCount: Integer; var TotalItemBatchCount: Integer) + internal procedure GetUnpostedBatchCountForCompany(CompanyNameTxt: Text; var TotalGLBatchCount: Integer; var TotalStatisticalBatchCount: Integer; var TotalBankBatchCount: Integer; var TotalCustomerBatchCount: Integer; var TotalItemBatchCount: Integer; var TotalVendorBatchCount: Integer) var HybridCompanyStatus: Record "Hybrid Company Status"; GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; begin TotalGLBatchCount := 0; TotalStatisticalBatchCount := 0; + TotalBankBatchCount := 0; + TotalCustomerBatchCount := 0; TotalItemBatchCount := 0; + TotalVendorBatchCount := 0; if not HybridCompanyStatus.Get(CompanyNameTxt) then exit; @@ -1225,16 +1228,18 @@ codeunit 4037 "Helper Functions" end; if not GPCompanyAdditionalSettings."Skip Posting Customer Batches" then - TotalGLBatchCount += GetGLBatchCountWithUnpostedLinesForCompany(CompanyNameTxt, GeneralTemplateNameTxt, CustomerBatchNameTxt); + TotalCustomerBatchCount += GetGLBatchCountWithUnpostedLinesForCompany(CompanyNameTxt, GeneralTemplateNameTxt, CustomerBatchNameTxt); if not GPCompanyAdditionalSettings."Skip Posting Vendor Batches" then - TotalGLBatchCount += GetGLBatchCountWithUnpostedLinesForCompany(CompanyNameTxt, GeneralTemplateNameTxt, VendorBatchNameTxt); + TotalVendorBatchCount += GetGLBatchCountWithUnpostedLinesForCompany(CompanyNameTxt, GeneralTemplateNameTxt, VendorBatchNameTxt); if not GPCompanyAdditionalSettings."Skip Posting Bank Batches" then - TotalGLBatchCount += GetGLBatchCountWithUnpostedLinesForCompany(CompanyNameTxt, GeneralTemplateNameTxt, BankBatchNameTxt); + TotalBankBatchCount += GetGLBatchCountWithUnpostedLinesForCompany(CompanyNameTxt, GeneralTemplateNameTxt, BankBatchNameTxt); if not GPCompanyAdditionalSettings."Skip Posting Item Batches" then TotalItemBatchCount := GetItemBatchCountWithUnpostedLinesForCompany(CompanyNameTxt); + + TotalGLBatchCount += TotalGLBatchCount + TotalBankBatchCount + TotalCustomerBatchCount + TotalVendorBatchCount; end; procedure PostGLTransactions() diff --git a/Apps/W1/HybridGP/app/src/Migration/Support/WizardIntegration.codeunit.al b/Apps/W1/HybridGP/app/src/Migration/Support/WizardIntegration.codeunit.al index 3ab57e6ac0..4dee94beda 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Support/WizardIntegration.codeunit.al +++ b/Apps/W1/HybridGP/app/src/Migration/Support/WizardIntegration.codeunit.al @@ -1,6 +1,7 @@ namespace Microsoft.DataMigration.GP; using Microsoft.DataMigration; +using Microsoft.Finance.FinancialReports; using Microsoft.Finance.GeneralLedger.Account; using Microsoft.Inventory.Item; using Microsoft.Purchases.Vendor; @@ -55,8 +56,7 @@ codeunit 4035 "Wizard Integration" Handled := true; end; - // This is after OnMigrationCompleted. OnMigrationCompleted fires when opening the Data Migration Overview page so removed that subscriber - [EventSubscriber(ObjectType::Codeunit, 1798, 'OnCreatePostMigrationData', '', true, true)] + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Data Migration Mgt.", OnCreatePostMigrationData, '', true, true)] local procedure OnCreatePostMigrationDataSubscriber(var DataMigrationStatus: Record "Data Migration Status"; var DataCreationFailed: Boolean) var GPConfiguration: Record "GP Configuration"; @@ -80,16 +80,17 @@ codeunit 4035 "Wizard Integration" if DataMigrationStatus.Status = DataMigrationStatus.Status::Completed then UnRegisterGPDataMigrator(); - Codeunit.Run(571); + Codeunit.Run(Codeunit::"Categ. Generate Acc. Schedules"); if GPConfiguration.Get() then if GPConfiguration."Updated GL Setup" then begin Flag := true; HelperFunctions.ResetAdjustforPaymentInGLSetup(Flag); end; + + HelperFunctions.PostGLTransactions(); end; - // This is after OnMigrationCompleted. OnMigrationCompleted fires when opening the Data Migration Overview page so removed that subscriber - [EventSubscriber(ObjectType::Codeunit, 1798, 'OnAfterMigrationFinished', '', true, true)] + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Data Migration Mgt.", OnAfterMigrationFinished, '', true, true)] local procedure OnAfterMigrationFinishedSubscriber(var DataMigrationStatus: Record "Data Migration Status"; WasAborted: Boolean; StartTime: DateTime; Retry: Boolean) var GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; @@ -98,7 +99,6 @@ codeunit 4035 "Wizard Integration" if not HybridGPWizard.GetGPMigrationEnabled() then exit; - HelperFunctions.PostGLTransactions(); HelperFunctions.SetProcessesRunning(false); if GPCompanyAdditionalSettings.GetMigrateHistory() then diff --git a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al deleted file mode 100644 index a6feee0d97..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al +++ /dev/null @@ -1,134 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4096 "GP Vendor" -{ - PageType = Card; - SourceTable = "GP Vendor"; - DeleteAllowed = false; - InsertAllowed = false; - Caption = 'Vendor Table'; - PromotedActionCategories = 'Related Entities'; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; -#pragma warning disable AA0219 - layout - { - area(content) - { - group(General) - { - field(VENDORID; Rec.VENDORID) - { - ApplicationArea = All; - ToolTip = 'Vendor Id'; - } - field(VENDNAME; Rec.VENDNAME) - { - ApplicationArea = All; - ToolTip = 'Vendor Name'; - } - field(SEARCHNAME; Rec.SEARCHNAME) - { - ApplicationArea = All; - ToolTip = 'Search Name'; - } - field(VNDCHKNM; Rec.VNDCHKNM) - { - ApplicationArea = All; - ToolTip = 'Vendor Check Number'; - } - field(ADDRESS1; Rec.ADDRESS1) - { - ApplicationArea = All; - ToolTip = 'Address 1'; - } - field(ADDRESS2; Rec.ADDRESS2) - { - ApplicationArea = All; - ToolTip = 'Address 2'; - } - field(CITY; Rec.CITY) - { - ApplicationArea = All; - ToolTip = 'City'; - } - field(VNDCNTCT; Rec.VNDCNTCT) - { - ApplicationArea = All; - ToolTip = 'VNDCNTCT'; - } - field(PHNUMBR1; Rec.PHNUMBR1) - { - ApplicationArea = All; - ToolTip = 'Phone Number 1'; - } - field(PYMTRMID; Rec.PYMTRMID) - { - ApplicationArea = All; - ToolTip = 'PYMTRMID'; - } - field(SHIPMTHD; Rec.SHIPMTHD) - { - ApplicationArea = All; - ToolTip = 'Shipment Method'; - } - field(COUNTRY; Rec.COUNTRY) - { - ApplicationArea = All; - ToolTip = 'Country'; - } - field(PYMNTPRI; Rec.PYMNTPRI) - { - ApplicationArea = All; - ToolTip = 'PYMNTPRI'; - } - field(AMOUNT; Rec.AMOUNT) - { - ApplicationArea = All; - ToolTip = 'Amount'; - } - field(FAXNUMBR; Rec.FAXNUMBR) - { - ApplicationArea = All; - ToolTip = 'Fax Number'; - } - field(ZIPCODE; Rec.ZIPCODE) - { - ApplicationArea = All; - ToolTip = 'Zip Code'; - } - field(STATE; Rec.STATE) - { - ApplicationArea = All; - ToolTip = 'State'; - } - field(INET1; Rec.INET1) - { - ApplicationArea = All; - ToolTip = 'Internet Address 1'; - } - field(INET2; Rec.INET2) - { - ApplicationArea = All; - ToolTip = 'Internet Address 2'; - } - field(UPSZONE; Rec.UPSZONE) - { - ApplicationArea = All; - ToolTip = 'UPS Zone'; - } - field(TXIDNMBR; Rec.TXIDNMBR) - { - ApplicationArea = All; - ToolTip = 'Tax Id Number'; - } - - } - } - } -} -#pragma warning restore AA0219 -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al deleted file mode 100644 index 7a31e0f48a..0000000000 --- a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al +++ /dev/null @@ -1,101 +0,0 @@ -#if not CLEAN26 -namespace Microsoft.DataMigration.GP; - -page 4097 "GP Vendor Transactions" -{ - Caption = 'GP Vendor Transactions'; - PageType = List; - SourceTable = "GP Vendor Transactions"; - ApplicationArea = All; - UsageCategory = None; - ObsoleteState = Pending; - ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; - ObsoleteTag = '26.0'; - -#pragma warning disable AA0219 - layout - { - area(content) - { - repeater(General) - { - field(Id; Rec.Id) - { - ApplicationArea = All; - ToolTip = 'Id'; - } - field(VENDORID; Rec.VENDORID) - { - ApplicationArea = All; - ToolTip = 'Vendor Id'; - } - field(DOCNUMBR; Rec.DOCNUMBR) - { - ApplicationArea = All; - ToolTip = 'Document Number'; - } - field(DOCDATE; Rec.DOCDATE) - { - ApplicationArea = All; - ToolTip = 'Document Date'; - } - field(DUEDATE; Rec.DUEDATE) - { - ApplicationArea = All; - ToolTip = 'Due Date'; - } - field(CURTRXAM; Rec.CURTRXAM) - { - ApplicationArea = All; - ToolTip = 'Customer Transaction Amount'; - } - field(DOCTYPE; Rec.DOCTYPE) - { - ApplicationArea = All; - ToolTip = 'Document Type'; - } - field(GLDocNo; Rec.GLDocNo) - { - ApplicationArea = All; - ToolTip = 'GL Document Number'; - } - field(TransType; Rec.TransType) - { - ApplicationArea = All; - ToolTip = 'Transaction Type'; - } - field(PYMTRMID; Rec.PYMTRMID) - { - ApplicationArea = All; - ToolTip = 'PYMTRMID'; - } - } - } - } -#pragma warning restore AA0219 - - actions - { - area(Navigation) - { - group(SupportingPages) - { - Caption = 'Supporting Pages'; - - action(AccountSetup) - { - ApplicationArea = All; - Caption = 'Posting Accounts'; - Promoted = true; - PromotedIsBig = true; - PromotedOnly = true; - Image = EntriesList; - RunObject = Page "GP Posting Accounts"; - RunPageMode = Edit; - ToolTip = 'Posting Account Setup'; - } - } - } - } -} -#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/codeunits/GPMigrationValidator.Codeunit.al b/Apps/W1/HybridGP/app/src/codeunits/GPMigrationValidator.Codeunit.al new file mode 100644 index 0000000000..fddb2c0a35 --- /dev/null +++ b/Apps/W1/HybridGP/app/src/codeunits/GPMigrationValidator.Codeunit.al @@ -0,0 +1,1568 @@ +namespace Microsoft.DataMigration.GP; + +using Microsoft.Bank.BankAccount; +using Microsoft.DataMigration; +using Microsoft.Finance.Analysis.StatisticalAccount; +using Microsoft.Finance.Currency; +using Microsoft.Finance.GeneralLedger.Account; +using Microsoft.Finance.GeneralLedger.Setup; +using Microsoft.Inventory.Item; +using Microsoft.Purchases.Document; +using Microsoft.Purchases.Remittance; +using Microsoft.Purchases.Vendor; +using Microsoft.Sales.Customer; + +codeunit 40903 "GP Migration Validator" +{ + trigger OnRun() + var + GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; + begin + if not GPCompanyAdditionalSettings.Get(CompanyName()) then + exit; + + ValidationSuiteIdTok := GetValidationSuiteId(); + CompanyNameTxt := CompanyName(); + DefaultCurrency.InitRoundingPrecision(); + + GetUnpostedBatchCounts(); + + RunGLAccountValidation(GPCompanyAdditionalSettings); + RunStatisticalAccountValidation(GPCompanyAdditionalSettings); + RunBankAccountValidation(GPCompanyAdditionalSettings); + RunCustomerValidation(GPCompanyAdditionalSettings); + RunItemValidation(GPCompanyAdditionalSettings); + RunPurchaseOrderValidation(GPCompanyAdditionalSettings); + RunVendorValidation(GPCompanyAdditionalSettings); + end; + + local procedure GetUnpostedBatchCounts() + var + HelperFunctions: Codeunit "Helper Functions"; + begin + TotalUnpostedGLBatchCount := 0; + TotalUnpostedStatisticalBatchCount := 0; + TotalUnpostedBankBatchCount := 0; + TotalUnpostedCustomerBatchCount := 0; + TotalUnpostedItemBatchCount := 0; + TotalUnpostedVendorBatchCount := 0; + + HelperFunctions.GetUnpostedBatchCountForCompany(CompanyName(), TotalUnpostedGLBatchCount, TotalUnpostedStatisticalBatchCount, TotalUnpostedBankBatchCount, TotalUnpostedCustomerBatchCount, TotalUnpostedItemBatchCount, TotalUnpostedVendorBatchCount); + end; + + local procedure RunGLAccountValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + GLAccount: Record "G/L Account"; + GPAccount: Record "GP Account"; + FirstAccount: Record "GP GL00100"; + GPGL00100: Record "GP GL00100"; + GPGL10111: Record "GP GL10111"; + GPGL40200: Record "GP GL40200"; + GPSY00300: Record "GP SY00300"; + GPGLTransactions: Record "GP GLTransactions"; + GPFiscalPeriods: Record "GP Fiscal Periods"; + HelperFunctions: Codeunit "Helper Functions"; + BalanceFailureShouldBeWarning: Boolean; + GPAccountNo: Code[20]; + GPAccountBeginningBalance: Decimal; + AccountFilter: Text; + EntityType: Text[50]; + GPAccountDescription: Text[100]; + ValidatedAccountNos: List of [Text]; + begin + EntityType := GlAccountEntityCaptionLbl; + BalanceFailureShouldBeWarning := (TotalUnpostedGLBatchCount > 0); + + // GP + if GPCompanyAdditionalSettings.GetGLModuleEnabled() then begin + GPGL00100.SetRange(ACCTTYPE, 1); + GPGL00100.SetFilter(MNACSGMT, '<>%1', ''); + if GPGL00100.FindSet() then + repeat + GPAccountBeginningBalance := 0; + GPAccountNo := CopyStr(GPGL00100.MNACSGMT.TrimEnd(), 1, MaxStrLen(GPAccountNo)); + if ValidatedAccountNos.Contains(GPAccountNo) then + continue; + + ValidatedAccountNos.Add(GPAccountNo); + + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPGL00100) then + continue; + + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, GPAccountNo); + + GPSY00300.SetRange(MNSEGIND, true); + if GPSY00300.FindFirst() then begin + GPGL40200.SetRange(SGMNTID, GPGL00100.MNACSGMT); + GPGL40200.SetRange(SGMTNUMB, GPSY00300.SGMTNUMB); + if GPGL40200.FindFirst() then + GPAccountDescription := CopyStr(GPGL40200.DSCRIPTN.TrimEnd(), 1, MaxStrLen(GPAccountDescription)); + end; + + if GPAccountDescription = '' then begin + FirstAccount.SetCurrentKey(ACTINDX); + FirstAccount.SetRange(MNACSGMT, GPGL00100.MNACSGMT); + FirstAccount.SetRange(ACCTTYPE, 1); + if FirstAccount.FindFirst() then + GPAccountDescription := CopyStr(FirstAccount.ACTDESCR.TrimEnd(), 1, MaxStrLen(GPAccountDescription)); + end; + + Clear(GPAccount); + GPAccount.AcctNum := GPAccountNo; + GPAccount.AcctIndex := GPGL00100.ACTINDX; + GPAccount.Name := CopyStr(GPAccountDescription.Trim(), 1, MaxStrLen(GLAccount.Name)); + GPAccount.SearchName := GPAccount.Name; + GPAccount.AccountCategory := GPGL00100.ACCATNUM; + GPAccount.IncomeBalance := GPGL00100.PSTNGTYP = 1; + GPAccount.DebitCredit := GPGL00100.TPCLBLNC; + GPAccount.Active := GPGL00100.ACTIVE; + GPAccount.DirectPosting := GPGL00100.ACCTENTR; + GPAccount.AccountSubcategoryEntryNo := GPGL00100.ACCATNUM; + GPAccount.AccountType := GPGL00100.ACCTTYPE; + + if not GPCompanyAdditionalSettings.GetMigrateOnlyGLMaster() then + if not GPCompanyAdditionalSettings.GetSkipPostingAccountBatches() then + if GPGL00100.PSTNGTYP = 0 then begin + AccountFilter := GetAccountFilter(GPAccountNo, 1); + + if AccountFilter <> '' then begin + + // Beginning Balance + GPGL10111.SetFilter(ACTINDX, AccountFilter); + GPGL10111.SetRange(PERIODID, 0); + GPGL10111.SetRange(YEAR1, GPCompanyAdditionalSettings."Oldest GL Year to Migrate"); + if GPGL10111.FindSet() then + repeat + GPAccountBeginningBalance += RoundWithSpecPrecision(GPGL10111.PERDBLNC); + until GPGL10111.Next() = 0; + + // Trx summary + GPGLTransactions.SetCurrentKey(YEAR1, PERIODID, ACTINDX); + GPGLTransactions.SetFilter(ACTINDX, AccountFilter); + + if GPCompanyAdditionalSettings."Oldest GL Year to Migrate" > 0 then + GPGLTransactions.SetFilter(YEAR1, '>= %1', GPCompanyAdditionalSettings."Oldest GL Year to Migrate"); + + if GPGLTransactions.FindSet() then + repeat + if GPFiscalPeriods.Get(GPGLTransactions.PERIODID, GPGLTransactions.YEAR1) then + GPAccountBeginningBalance += RoundWithSpecPrecision(GPGLTransactions.PERDBLNC); + until GPGLTransactions.Next() = 0; + end; + end; + + Clear(GLAccount); + GLAccount.SetLoadFields("No.", Name, "Account Type", "Account Category", "Debit/Credit", "Account Subcategory Entry No.", "Income/Balance", Balance); + if not MigrationValidationAssert.ValidateRecordExists(Test_ACCOUNTEXISTS_Tok, GLAccount.Get(GPAccount.AcctNum), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + GLAccount.CalcFields(Balance); + + MigrationValidationAssert.ValidateAreEqual(Test_ACCOUNTNAME_Tok, GPAccount.Name, GLAccount.Name, AccountNameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ACCOUNTTYPE_Tok, Format(GLAccount."Account Type"::Posting), Format(GLAccount."Account Type"), AccountTypeLbl); + MigrationValidationAssert.ValidateAreEqual(Test_ACCOUNTCATEGORY_Tok, HelperFunctions.ConvertAccountCategory(GPAccount), GLAccount."Account Category".AsInteger(), AccountCategoryLbl); + MigrationValidationAssert.ValidateAreEqual(Test_ACCOUNTDEBCRED_Tok, HelperFunctions.ConvertDebitCreditType(GPAccount), GLAccount."Debit/Credit", AccountDebitCreditLbl); + MigrationValidationAssert.ValidateAreEqual(Test_ACCOUNTSUBCATEGORY_Tok, HelperFunctions.AssignSubAccountCategory(GPAccount), GLAccount."Account Subcategory Entry No.", AccountSubcategoryLbl); + MigrationValidationAssert.ValidateAreEqual(Test_ACCOUNTINCBAL_Tok, HelperFunctions.ConvertIncomeBalanceType(GPAccount), GLAccount."Income/Balance".AsInteger(), AccountIncomeBalanceLbl); + MigrationValidationAssert.ValidateAreEqual(Test_ACCOUNTBALANCE_Tok, GPAccountBeginningBalance, GLAccount.Balance, BeginningBalanceLbl, BalanceFailureShouldBeWarning); + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPGL00100); + until GPGL00100.Next() = 0; + end; + end; + + local procedure RunStatisticalAccountValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + GeneralLedgerSetup: Record "General Ledger Setup"; + FirstAccount: Record "GP GL00100"; + GPGL00100: Record "GP GL00100"; + GPGL10111: Record "GP GL10111"; + GPGL40200: Record "GP GL40200"; + GPSY00300: Record "GP SY00300"; + GPGLTransactions: Record "GP GLTransactions"; + GPFiscalPeriods: Record "GP Fiscal Periods"; + StatisticalAccount: Record "Statistical Account"; + BalanceFailureShouldBeWarning: Boolean; + DimensionCode1: Code[20]; + DimensionCode2: Code[20]; + GPAccountNo: Code[20]; + GPAccountBeginningBalance: Decimal; + AccountFilter: Text; + EntityType: Text[50]; + GPAccountDescription: Text[100]; + ValidatedAccountNos: List of [Text]; + begin + EntityType := StatisticalAccountEntityCaptionLbl; + BalanceFailureShouldBeWarning := (TotalUnpostedStatisticalBatchCount > 0); + + if GeneralLedgerSetup.Get() then begin + DimensionCode1 := GeneralLedgerSetup."Global Dimension 1 Code"; + DimensionCode2 := GeneralLedgerSetup."Global Dimension 2 Code"; + end; + + if GPCompanyAdditionalSettings.GetGLModuleEnabled() then begin + GPGL00100.SetRange(ACCTTYPE, 2); + GPGL00100.SetFilter(MNACSGMT, '<>%1', ''); + if GPGL00100.FindSet() then + repeat + GPAccountBeginningBalance := 0; + GPAccountNo := CopyStr(GPGL00100.MNACSGMT.TrimEnd(), 1, MaxStrLen(GPAccountNo)); + if ValidatedAccountNos.Contains(GPAccountNo) then + continue; + + ValidatedAccountNos.Add(GPAccountNo); + + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPGL00100) then + continue; + + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, GPAccountNo); + + GPSY00300.SetRange(MNSEGIND, true); + if GPSY00300.FindFirst() then begin + GPGL40200.SetRange(SGMNTID, GPGL00100.MNACSGMT); + GPGL40200.SetRange(SGMTNUMB, GPSY00300.SGMTNUMB); + if GPGL40200.FindFirst() then + GPAccountDescription := CopyStr(GPGL40200.DSCRIPTN.TrimEnd(), 1, MaxStrLen(GPAccountDescription)); + end; + + if GPAccountDescription = '' then begin + FirstAccount.SetCurrentKey(ACTINDX); + FirstAccount.SetRange(MNACSGMT, GPGL00100.MNACSGMT); + FirstAccount.SetRange(ACCTTYPE, 2); + if FirstAccount.FindFirst() then + GPAccountDescription := CopyStr(FirstAccount.ACTDESCR.TrimEnd(), 1, MaxStrLen(GPAccountDescription)); + end; + + if not GPCompanyAdditionalSettings.GetMigrateOnlyGLMaster() then + if not GPCompanyAdditionalSettings.GetSkipPostingAccountBatches() then begin + Clear(GPGL10111); + AccountFilter := GetAccountFilter(GPAccountNo, 2); + + if AccountFilter <> '' then begin + + // Beginning Balance + GPGL10111.SetFilter(ACTINDX, AccountFilter); + GPGL10111.SetRange(PERIODID, 0); + GPGL10111.SetRange(YEAR1, GPCompanyAdditionalSettings."Oldest GL Year to Migrate"); + if GPGL10111.FindSet() then + repeat + GPAccountBeginningBalance += RoundWithSpecPrecision(GPGL10111.PERDBLNC); + until GPGL10111.Next() = 0; + + // Trx summary + GPGLTransactions.SetCurrentKey(YEAR1, PERIODID, ACTINDX); + GPGLTransactions.SetFilter(ACTINDX, AccountFilter); + + if GPCompanyAdditionalSettings."Oldest GL Year to Migrate" > 0 then + GPGLTransactions.SetFilter(YEAR1, '>= %1', GPCompanyAdditionalSettings."Oldest GL Year to Migrate"); + + if GPGLTransactions.FindSet() then + repeat + if GPFiscalPeriods.Get(GPGLTransactions.PERIODID, GPGLTransactions.YEAR1) then + GPAccountBeginningBalance += RoundWithSpecPrecision(GPGLTransactions.PERDBLNC); + until GPGLTransactions.Next() = 0; + end; + end; + + Clear(StatisticalAccount); + StatisticalAccount.SetLoadFields("No.", Name, "Global Dimension 1 Code", "Global Dimension 2 Code", Balance); + if not MigrationValidationAssert.ValidateRecordExists(Test_STATACCOUNTEXISTS_Tok, StatisticalAccount.Get(GPAccountNo), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + StatisticalAccount.CalcFields(Balance); + + MigrationValidationAssert.ValidateAreEqual(Test_STATACCOUNTNAME_Tok, GPAccountDescription, StatisticalAccount.Name, AccountNameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_STATACCOUNTDIM1_Tok, DimensionCode1, StatisticalAccount."Global Dimension 1 Code", Dimension1Lbl); + MigrationValidationAssert.ValidateAreEqual(Test_STATACCOUNTDIM2_Tok, DimensionCode2, StatisticalAccount."Global Dimension 2 Code", Dimension2Lbl); + MigrationValidationAssert.ValidateAreEqual(Test_STATACCOUNTBALANCE_Tok, GPAccountBeginningBalance, StatisticalAccount.Balance, BeginningBalanceLbl, BalanceFailureShouldBeWarning); + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPGL00100); + until GPGL00100.Next() = 0; + end; + end; + + local procedure RunBankAccountValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + BankAccount: Record "Bank Account"; + GPBankMSTR: Record "GP Bank MSTR"; + GPCheckbookMSTR: Record "GP Checkbook MSTR"; + GPCheckbookTransactions: Record "GP Checkbook Transactions"; + GPCM20600: Record "GP CM20600"; + BalanceFailureShouldBeWarning: Boolean; + ShouldFlipSign: Boolean; + ShouldInclude: Boolean; + GPAccountNo: Code[20]; + GPAccountBalance: Decimal; + EntityType: Text[50]; + begin + EntityType := BankAccountEntityCaptionLbl; + BalanceFailureShouldBeWarning := (TotalUnpostedBankBatchCount > 0); + + if GPCompanyAdditionalSettings.GetBankModuleEnabled() then + if GPCheckbookMSTR.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPCheckbookMSTR) then + continue; + + GPAccountNo := CopyStr(GPCheckbookMSTR.CHEKBKID.TrimEnd(), 1, MaxStrLen(GPAccountNo)); + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, GPAccountNo); + ShouldInclude := true; + GPAccountBalance := 0; + + if not GPCompanyAdditionalSettings.GetMigrateInactiveCheckbooks() then + if GPCheckbookMSTR.INACTIVE then + ShouldInclude := false; + + if ShouldInclude then begin + + // Balance + if not GPCompanyAdditionalSettings.GetMigrateOnlyBankMaster() then + if not GPCompanyAdditionalSettings.GetSkipPostingBankBatches() then begin + GPAccountBalance := GPCheckbookMSTR.Last_Reconciled_Balance; + + GPCheckbookTransactions.SetRange(CHEKBKID, GPCheckbookMSTR.CHEKBKID); + GPCheckbookTransactions.SetRange(Recond, false); + GPCheckbookTransactions.SetFilter(TRXAMNT, '<>%1', 0); + if GPCheckbookTransactions.FindSet() then + repeat + ShouldFlipSign := false; + + if GPCheckbookTransactions.ShouldFlipSign() then + ShouldFlipSign := true; + + if GPCheckbookTransactions.CMTrxType = 7 then begin + GPCM20600.SetRange(CMXFRNUM, GPCheckbookTransactions.CMTrxNum); + GPCM20600.SetRange(CMFRMRECNUM, GPCheckbookTransactions.CMRECNUM); + if GPCM20600.FindFirst() then + if GPCM20600.Xfr_Record_Number > 0 then + ShouldFlipSign := true; + end; + + if ShouldFlipSign then + GPCheckbookTransactions.TRXAMNT := GPCheckbookTransactions.TRXAMNT * -1; + + GPAccountBalance := GPAccountBalance + RoundWithSpecPrecision(GPCheckbookTransactions.TRXAMNT); + until GPCheckbookTransactions.Next() = 0; + end; + + Clear(BankAccount); + BankAccount.SetLoadFields("No.", Name, "Bank Account No.", Balance, Address, "Address 2", City, "Phone No.", "Transit No.", "Fax No.", County, "Post Code", "Bank Branch No."); + if not MigrationValidationAssert.ValidateRecordExists(Test_BANKACCOUNTEXISTS_Tok, BankAccount.Get(GPAccountNo), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + BankAccount.CalcFields(Balance); + + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTNAME_Tok, CopyStr(GPCheckbookMSTR.DSCRIPTN.TrimEnd(), 1, MaxStrLen(BankAccount.Name)), BankAccount.Name, NameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTNO_Tok, CopyStr(GPCheckbookMSTR.BNKACTNM.TrimEnd(), 1, MaxStrLen(BankAccount."Bank Account No.")), BankAccount."Bank Account No.", BankAccountNumberLbl, false, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTADDR_Tok, CopyStr(GPBankMSTR.ADDRESS1.TrimEnd(), 1, MaxStrLen(BankAccount.Address)), BankAccount.Address, AddressLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTADDR2_Tok, CopyStr(GPBankMSTR.ADDRESS2.TrimEnd(), 1, MaxStrLen(BankAccount."Address 2")), BankAccount."Address 2", Address2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTCITY_Tok, CopyStr(GPBankMSTR.CITY.TrimEnd(), 1, MaxStrLen(BankAccount.City)), BankAccount.City, CityLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTCOUNTY_Tok, CopyStr(GPBankMSTR.STATE.TrimEnd(), 1, MaxStrLen(BankAccount.County)), BankAccount.County, CountyLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTPOSTCODE_Tok, CopyStr(GPBankMSTR.ZIPCODE.TrimEnd(), 1, MaxStrLen(BankAccount."Post Code")), BankAccount."Post Code", PostCodeLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTPHN_Tok, CopyStr(GPBankMSTR.PHNUMBR1.TrimEnd(), 1, MaxStrLen(BankAccount."Phone No.")), BankAccount."Phone No.", PhoneLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTFAX_Tok, CopyStr(GPBankMSTR.FAXNUMBR.TrimEnd(), 1, MaxStrLen(BankAccount."Fax No.")), BankAccount."Fax No.", FaxLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTTRANSITNO_Tok, CopyStr(GPBankMSTR.TRNSTNBR.TrimEnd(), 1, MaxStrLen(BankAccount."Transit No.")), BankAccount."Transit No.", TransitNoLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTBRANCHNO_Tok, CopyStr(GPBankMSTR.BNKBRNCH.TrimEnd(), 1, MaxStrLen(BankAccount."Bank Branch No.")), BankAccount."Bank Branch No.", BankBranchNoLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_BANKACCOUNTBALANCE_Tok, GPAccountBalance, BankAccount.Balance, BalanceLbl, BalanceFailureShouldBeWarning); + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPCheckbookMSTR); + end; + until GPCheckbookMSTR.Next() = 0; + end; + + local procedure RunCustomerValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + Customer: Record Customer; + GPCustomer: Record "GP Customer"; + GPRM00101: Record "GP RM00101"; + GPRM20101: record "GP RM20101"; + GPPaymentTerms: Record "GP Payment Terms"; + GPPopulateCombinedTables: Codeunit "GP Populate Combined Tables"; + HelperFunctions: Codeunit "Helper Functions"; + BalanceFailureShouldBeWarning: Boolean; + ShouldInclude: Boolean; + ClassName: Code[20]; + CustomerNo: Code[20]; + TaxLiable: Boolean; + PhoneNo: Text[30]; + FaxNo: Text[30]; + PaymentTerms: Code[10]; + GPCustomerBalance: Decimal; + EntityType: Text[50]; + begin + EntityType := CustomerEntityCaptionLbl; + BalanceFailureShouldBeWarning := (TotalUnpostedCustomerBatchCount > 0); + + if GPCompanyAdditionalSettings.GetReceivablesModuleEnabled() then begin + GPRM00101.SetFilter(CUSTNMBR, '<>%1', ''); + if GPRM00101.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPRM00101) then + continue; + + CustomerNo := CopyStr(GPRM00101.CUSTNMBR.TrimEnd(), 1, MaxStrLen(CustomerNo)); + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, CustomerNo); + GPCustomerBalance := 0; + ShouldInclude := true; + + if not GPCompanyAdditionalSettings.GetMigrateInactiveCustomers() then + if GPRM00101.INACTIVE then + ShouldInclude := false; + + if ShouldInclude then begin + if GPCompanyAdditionalSettings.GetMigrateCustomerClasses() then + ClassName := CopyStr(GPRM00101.CUSTCLAS.TrimEnd(), 1, MaxStrLen(ClassName)); + + if ClassName = '' then + ClassName := DefaultClassNameTok; + + Clear(GPCustomer); + GPPopulateCombinedTables.SetGPCustomerFields(GPCustomer, GPRM00101); + + GPCustomer.PHONE1 := HelperFunctions.CleanGPPhoneOrFaxNumber(GPCustomer.PHONE1); + GPCustomer.FAX := HelperFunctions.CleanGPPhoneOrFaxNumber(GPCustomer.FAX); + + if not GPCompanyAdditionalSettings.GetMigrateOnlyReceivablesMaster() then + if not GPCompanyAdditionalSettings.GetSkipPostingCustomerBatches() then begin + GPRM20101.SetRange(CUSTNMBR, GPRM00101.CUSTNMBR); + GPRM20101.SetRange(RMDTYPAL, 1, 9); + GPRM20101.SetRange(VOIDSTTS, 0); + GPRM20101.SetFilter(CURTRXAM, '>=0.01'); + if GPRM20101.FindSet() then + repeat + if GPRM20101.RMDTYPAL < 7 then + GPCustomerBalance := RoundWithSpecPrecision(GPCustomerBalance + GPRM20101.CURTRXAM) + else + GPCustomerBalance := GPCustomerBalance + RoundWithSpecPrecision(GPRM20101.CURTRXAM * -1); + until GPRM20101.Next() = 0; + end; + + if not MigrationValidationAssert.ValidateRecordExists(Test_CUSTOMEREXISTS_Tok, Customer.Get(CustomerNo), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + Customer.CalcFields(Balance); + + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERNAME_Tok, CopyStr(GPRM00101.CUSTNAME.TrimEnd(), 1, MaxStrLen(Customer.Name)), Customer.Name, NameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERPOSTINGGROUP_Tok, ClassName, Customer."Customer Posting Group", CustomerPostingGroupLbl); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERADDR_Tok, CopyStr(GPCustomer.ADDRESS1, 1, MaxStrLen(Customer.Address)), Customer.Address, AddressLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERADDR2_Tok, CopyStr(GPCustomer.ADDRESS2, 1, MaxStrLen(Customer."Address 2")), Customer."Address 2", Address2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERCITY_Tok, CopyStr(GPCustomer.CITY, 1, MaxStrLen(Customer.City)), Customer.City, CityLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERNAME2_Tok, CopyStr(GPCustomer.STMTNAME, 1, MaxStrLen(Customer."Name 2")), Customer."Name 2", Name2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERCREDITLMT_Tok, GPCustomer.CRLMTAMT, Customer."Credit Limit (LCY)", CreditLimitLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERCONTACT_Tok, CopyStr(GPCustomer.CNTCPRSN, 1, MaxStrLen(Customer.Contact)), Customer.Contact, ContactLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERSALESPERSON_Tok, UpperCase(GPCustomer.SLPRSNID.TrimEnd()), Customer."Salesperson Code", SalesPersonLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERSHIPMETHOD_Tok, UpperCase(CopyStr(GPCustomer.SHIPMTHD, 1, MaxStrLen(Customer."Shipment Method Code")).TrimEnd()), Customer."Shipment Method Code", ShipmentMethodLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERTERRITORY_Tok, UpperCase(CopyStr(GPCustomer.SALSTERR, 1, MaxStrLen(Customer."Territory Code")).TrimEnd()), Customer."Territory Code", TerritoryLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERTAXAREA_Tok, UpperCase(GPCustomer.TAXSCHID.TrimEnd()), Customer."Tax Area Code", TaxAreaLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERBALANCE_Tok, GPCustomerBalance, Customer.Balance, BalanceLbl, BalanceFailureShouldBeWarning); + + TaxLiable := (GPCustomer.TAXSCHID <> ''); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERTAXLIABLE_Tok, TaxLiable, Customer."Tax Liable", TaxLiableLbl, true); + + PhoneNo := ''; + if GPCustomer.PHONE1 <> '' then + if not HelperFunctions.ContainsAlphaChars(GPCustomer.PHONE1) then + PhoneNo := GPCustomer.PHONE1; + + FaxNo := ''; + if GPCustomer.FAX <> '' then + if not HelperFunctions.ContainsAlphaChars(GPCustomer.FAX) then + FaxNo := GPCustomer.FAX; + + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERPHN_Tok, PhoneNo, Customer."Phone No.", PhoneLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERFAX_Tok, FaxNo, Customer."Fax No.", FaxLbl, true); + + PaymentTerms := ''; + if GPCustomer.PYMTRMID <> '' then + if GPPaymentTerms.Get(GPCustomer.PYMTRMID) then begin + PaymentTerms := CopyStr(GPCustomer.PYMTRMID, 1, MaxStrLen(Customer."Payment Terms Code")); + if GPPaymentTerms.PYMTRMID_New <> '' then + PaymentTerms := GPPaymentTerms.PYMTRMID_New; + end; + + MigrationValidationAssert.ValidateAreEqual(Test_CUSTOMERPMTTERMS_Tok, PaymentTerms, Customer."Payment Terms Code", PaymentTermsLbl, true); + + ValidateCustomerShipToAddresses(Customer); + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPRM00101); + end; + until GPRM00101.Next() = 0; + end; + end; + + local procedure ValidateCustomerShipToAddresses(var Customer: Record Customer) + var + GPCustomerAddress: Record "GP Customer Address"; + ShipToAddress: Record "Ship-to Address"; + AddressCode: Code[10]; + EntityType: Text[50]; + ContextCode: Text[250]; + begin + EntityType := CustomerAddressEntityCaptionLbl; + + GPCustomerAddress.SetRange(CUSTNMBR, Customer."No."); + if GPCustomerAddress.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPCustomerAddress) then + continue; + + AddressCode := CopyStr(GPCustomerAddress.ADRSCODE, 1, MaxStrLen(AddressCode)); + ContextCode := Customer."No." + '-' + AddressCode; + + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, ContextCode); + + if not MigrationValidationAssert.ValidateRecordExists(Test_SHIPADDREXISTS_Tok, ShipToAddress.Get(Customer."No.", AddressCode), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + if (CopyStr(GPCustomerAddress.PHONE1, 1, 14) = '00000000000000') then + GPCustomerAddress.PHONE1 := ''; + + if (CopyStr(GPCustomerAddress.FAX, 1, 14) = '00000000000000') then + GPCustomerAddress.FAX := ''; + + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRNAME_Tok, Customer.Name, ShipToAddress.Name, NameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRADDR_Tok, GPCustomerAddress.ADDRESS1.TrimEnd(), ShipToAddress.Address, AddressLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRADDR2_Tok, CopyStr(GPCustomerAddress.ADDRESS2.TrimEnd(), 1, MaxStrLen(ShipToAddress."Address 2")), ShipToAddress."Address 2", Address2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRCITY_Tok, CopyStr(GPCustomerAddress.CITY.TrimEnd(), 1, MaxStrLen(ShipToAddress.City)), ShipToAddress.City, CityLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRPOSTCODE_Tok, UpperCase(GPCustomerAddress.ZIP.TrimEnd()), ShipToAddress."Post Code", PostCodeLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRPHN_Tok, GPCustomerAddress.PHONE1.TrimEnd(), ShipToAddress."Phone No.", PhoneLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRFAX_Tok, GPCustomerAddress.FAX.TrimEnd(), ShipToAddress."Fax No.", FaxLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRCONTACT_Tok, GPCustomerAddress.CNTCPRSN.TrimEnd(), ShipToAddress.Contact, ContactLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRSHIPMETHOD_Tok, CopyStr(GPCustomerAddress.SHIPMTHD.TrimEnd(), 1, MaxStrLen(ShipToAddress."Shipment Method Code")), ShipToAddress."Shipment Method Code", ShipmentMethodLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRCOUNTY_Tok, GPCustomerAddress.STATE.TrimEnd(), ShipToAddress.County, CountyLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_SHIPADDRTAXAREA_Tok, GPCustomerAddress.TAXSCHID.TrimEnd(), ShipToAddress."Tax Area Code", TaxAreaLbl, true); + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPCustomerAddress); + until GPCustomerAddress.Next() = 0; + end; + + local procedure RunItemValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + GPItem: Record "GP Item"; + GPIV00101: Record "GP IV00101"; + GPIV00200: Record "GP IV00200"; + GPIV00300: Record "GP IV00300"; + GPIV10200: Record "GP IV10200"; + GPIV00104: Record "GP IV00104"; + Item: Record Item; + GPPopulateCombinedTables: Codeunit "GP Populate Combined Tables"; + IsDiscontinued: Boolean; + IsInactive: Boolean; + IsInventoryOrDiscontinued: Boolean; + QuantityFailureShouldBeWarning: Boolean; + ShouldInclude: Boolean; + ClassName: Code[20]; + ItemType: Enum "Item Type"; + CostingMethod: Enum "Costing Method"; + ItemNo: Code[20]; + Quantity: Decimal; + KitItemNo: Code[20]; + Kits: List of [Code[20]]; + EntityType: Text[50]; + begin + EntityType := ItemEntityCaptionLbl; + QuantityFailureShouldBeWarning := (TotalUnpostedItemBatchCount > 0); + + if GPCompanyAdditionalSettings.GetInventoryModuleEnabled() then begin + if GPCompanyAdditionalSettings.GetMigrateKitItems() then + if GPIV00104.FindSet() then + repeat + KitItemNo := CopyStr(GPIV00104.CMPTITNM.TrimEnd(), 1, MaxStrLen(KitItemNo)); + if not Kits.Contains(KitItemNo) then + Kits.Add(KitItemNo); + until GPIV00104.Next() = 0; + + GPIV00101.SetFilter(ITEMNMBR, '<>%1', ''); + if not GPCompanyAdditionalSettings.GetMigrateKitItems() then + GPIV00101.SetFilter(ITEMTYPE, '<>%1', 3); + + if GPIV00101.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPIV00101) then + continue; + + ItemNo := CopyStr(GPIV00101.ITEMNMBR.TrimEnd(), 1, MaxStrLen(ItemNo)); + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, ItemNo); + + Quantity := 0; + ClassName := ''; + ShouldInclude := true; + IsInventoryOrDiscontinued := (GPIV00101.ITEMTYPE < 4); + IsInactive := (GPIV00101.ITEMTYPE = 2) or (GPIV00101.INACTIVE); + IsDiscontinued := GPIV00101.ITEMTYPE = 2; + + if not GPCompanyAdditionalSettings.GetMigrateInactiveItems() then + if IsInactive then + ShouldInclude := false; + + if ShouldInclude then + if not GPCompanyAdditionalSettings.GetMigrateDiscontinuedItems() then + if IsDiscontinued then + ShouldInclude := false; + + if ShouldInclude then begin + if IsInventoryOrDiscontinued then + if GPCompanyAdditionalSettings.GetMigrateItemClasses() then begin + ClassName := CopyStr(GPIV00101.ITMCLSCD.TrimEnd(), 1, MaxStrLen(ClassName)); + + if ClassName = '' then + ClassName := DefaultClassNameTok; + end else + ClassName := DefaultClassNameTok; + + if not GPCompanyAdditionalSettings.GetSkipPostingItemBatches() then + if not GPCompanyAdditionalSettings.GetMigrateOnlyInventoryMaster() then begin + GPIV10200.SetRange(ITEMNMBR, GPIV00101.ITEMNMBR); + GPIV10200.SetRange(RCPTSOLD, false); + GPIV10200.SetRange(QTYTYPE, 1); + if GPIV10200.FindSet() then + repeat + // Serial + if GPIV00101.ITMTRKOP = 2 then begin + GPIV00200.SetRange(ITEMNMBR, GPIV10200.ITEMNMBR); + GPIV00200.SetRange(LOCNCODE, GPIV10200.TRXLOCTN); + GPIV00200.SetRange(DATERECD, GPIV10200.DATERECD); + GPIV00200.SetRange(RCTSEQNM, GPIV10200.RCTSEQNM); + GPIV00200.SetRange(QTYTYPE, 1); + Quantity := Quantity + GPIV00200.Count(); + end; + + // Lot + if GPIV00101.ITMTRKOP = 3 then begin + GPIV00300.SetRange(ITEMNMBR, GPIV00101.ITEMNMBR); + GPIV00300.SetRange(LOCNCODE, GPIV10200.TRXLOCTN); + GPIV00300.SetRange(DATERECD, GPIV10200.DATERECD); + GPIV00300.SetRange(RCTSEQNM, GPIV10200.RCTSEQNM); + GPIV00300.SetRange(QTYTYPE, 1); + if GPIV00300.FindSet() then + repeat + Quantity := Quantity + (GPIV00300.QTYRECVD - GPIV00300.QTYSOLD); + until GPIV00300.Next() = 0; + end; + + if (GPIV00101.ITMTRKOP <> 2) and (GPIV00101.ITMTRKOP <> 3) then + Quantity := Quantity + (GPIV10200.QTYRECVD - GPIV10200.QTYSOLD); + until GPIV10200.Next() = 0; + end; + + Clear(GPItem); + GPPopulateCombinedTables.SetGPItemFields(GPItem, GPIV00101); + + if not MigrationValidationAssert.ValidateRecordExists(Test_ITEMEXISTS_Tok, Item.Get(ItemNo), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + Item.CalcFields(Inventory); + + MigrationValidationAssert.ValidateAreEqual(Test_ITEMDESC_Tok, GPItem.Description, Item.Description, DescriptionLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMDESC2_Tok, GPItem.ShortName, Item."Description 2", Description2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMSEARCHDESC_Tok, GPItem.SearchDescription, Item."Search Description", SearchDescription2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMPOSTINGGROUP_Tok, ClassName, Item."Inventory Posting Group", ItemPostingGroupLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMUNITLISTPRICE_Tok, GPItem.UnitListPrice, Item."Unit List Price", UnitListPriceLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMBASEUOFM_Tok, GPItem.BaseUnitOfMeasure, Item."Base Unit of Measure", BaseUofMLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMPURCHUOFM_Tok, GPItem.PurchUnitOfMeasure, Item."Purch. Unit of Measure", PurchUofMLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMTRACKINGCODE_Tok, GPItem.ItemTrackingCode, Item."Item Tracking Code", ItemTrackingCodeLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMINVENTORY_Tok, Quantity, Item.Inventory, QuantityLbl, QuantityFailureShouldBeWarning); + + if (GPItem.ItemType in [0, 2]) then + ItemType := ItemType::Inventory + else + if not Kits.Contains(ItemNo) then + ItemType := ItemType::Service + else + ItemType := ItemType::"Non-Inventory"; + + if ItemType = ItemType::Service then + CostingMethod := CostingMethod::FIFO + else + case GPItem.CostingMethod of + '0': + CostingMethod := CostingMethod::FIFO; + '1': + CostingMethod := CostingMethod::LIFO; + '2': + CostingMethod := CostingMethod::Specific; + '3': + CostingMethod := CostingMethod::Average; + '4': + CostingMethod := CostingMethod::Standard; + end; + + MigrationValidationAssert.ValidateAreEqual(Test_ITEMTYPE_Tok, ItemType, Item.Type, TypeLbl); + MigrationValidationAssert.ValidateAreEqual(Test_ITEMCOSTMETHOD_Tok, CostingMethod, Item."Costing Method", CostingMethodLbl, true); + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPIV00101); + end; + until GPIV00101.Next() = 0; + end; + end; + + local procedure RunPurchaseOrderValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + GPPOP10100: Record "GP POP10100"; + PurchaseHeader: Record "Purchase Header"; + PurchaseLine: Record "Purchase Line"; + Vendor: Record Vendor; + GPPOHeaderValidationBuffer: Record "GP PO Validation Buffer"; + GPPOLineValidationBuffer: Record "GP PO Validation Buffer"; + PONumber: Code[20]; + EntityType: Text[50]; + LineEntityType: Text[50]; + begin + EntityType := 'Purchase Order'; + LineEntityType := 'Purchase Line'; + + // GP + if GPCompanyAdditionalSettings.GetMigrateOpenPOs() then begin + GPPOP10100.SetRange(POTYPE, GPPOP10100.POTYPE::Standard); + GPPOP10100.SetRange(POSTATUS, 1, 4); + GPPOP10100.SetFilter(VENDORID, '<>%1', ''); + if GPPOP10100.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPPOP10100) then + continue; + + PONumber := CopyStr(GPPOP10100.PONUMBER.TrimEnd(), 1, MaxStrLen(PurchaseHeader."No.")); + if Vendor.Get(GPPOP10100.VENDORID) then + if not GPPOHeaderValidationBuffer.Get(PONumber) then begin + GPPOHeaderValidationBuffer."No." := PONumber; + GPPOHeaderValidationBuffer."Text 1" := CopyStr(GPPOP10100.VENDORID.TrimEnd(), 1, MaxStrLen(Vendor."No.")); + GPPOHeaderValidationBuffer."Date 1" := GPPOP10100.DOCDATE; + GPPOHeaderValidationBuffer.Insert(); + + if not PopulatePOLineBuffer(PONumber, GPPOLineValidationBuffer) then + GPPOHeaderValidationBuffer.Delete(); + end; + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPPOP10100); + until GPPOP10100.Next() = 0; + end; + + // Validate - Purchase Orders + if GPPOHeaderValidationBuffer.FindSet() then + repeat + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, GPPOHeaderValidationBuffer."No."); + + if not MigrationValidationAssert.ValidateRecordExists(Test_POEXISTS_Tok, PurchaseHeader.Get("Purchase Document Type"::Order, GPPOHeaderValidationBuffer."No."), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + MigrationValidationAssert.ValidateAreEqual(Test_POBUYFROMVEND_Tok, GPPOHeaderValidationBuffer."Text 1", PurchaseHeader."Buy-from Vendor No.", PurchaseOrderBuyFromVendorNoLbl); + MigrationValidationAssert.ValidateAreEqual(Test_POPAYTOVEND_Tok, GPPOHeaderValidationBuffer."Text 1", PurchaseHeader."Pay-to Vendor No.", PurchaseOrderPayToVendorNoLbl); + MigrationValidationAssert.ValidateAreEqual(Test_PODOCDATE_Tok, GPPOHeaderValidationBuffer."Date 1", PurchaseHeader."Document Date", DocumentDateLbl); + + // Lines + GPPOLineValidationBuffer.Reset(); + GPPOLineValidationBuffer.SetRange("Parent No.", GPPOHeaderValidationBuffer."No."); + if GPPOLineValidationBuffer.FindSet() then + repeat + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, LineEntityType, GPPOLineValidationBuffer."No."); + + PurchaseLine.SetRange("Document Type", "Purchase Document Type"::Order); + PurchaseLine.SetRange("Document No.", GPPOHeaderValidationBuffer."No."); + PurchaseLine.SetRange("No.", GPPOLineValidationBuffer."Text 1"); + if not MigrationValidationAssert.ValidateRecordExists(Test_POLINEEXISTS_Tok, PurchaseLine.FindFirst(), StrSubstNo(MissingEntityTok, LineEntityType)) then + continue; + + MigrationValidationAssert.ValidateAreEqual(Test_POLINEQTY_Tok, GPPOLineValidationBuffer."Decimal 1", PurchaseLine.Quantity, QuantityLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_POLINEQTYRECV_Tok, GPPOLineValidationBuffer."Decimal 2", PurchaseLine."Quantity Received", QuantityRecLbl, true); + until GPPOLineValidationBuffer.Next() = 0; + until GPPOHeaderValidationBuffer.Next() = 0; + end; + + local procedure PopulatePOLineBuffer(PONumber: Code[20]; var LineBuffer: Record "GP PO Validation Buffer"): Boolean + var + GPPOP10110: Record "GP POP10110"; + GPPOPReceiptApply: Record GPPOPReceiptApply; + GPPOPReceiptApplyLineUnitCost: Record GPPOPReceiptApply; + Item: Record Item; + HasLines: Boolean; + ShouldCreateLine: Boolean; + LocationCode: Code[10]; + LastLineUnitCost: Decimal; + LineQtyInvoicedByUnitCost: Decimal; + LineQtyReceivedByUnitCost: Decimal; + LineQuantityRemaining: Decimal; + ItemNo: Text; + LastLocation: Text[12]; + begin + GPPOP10110.SetRange(PONUMBER, PONumber); + if not GPPOP10110.FindSet() then + exit; + + repeat + LastLocation := ''; + LastLineUnitCost := 0; + ShouldCreateLine := true; + + ItemNo := CopyStr(GPPOP10110.ITEMNMBR.Trim(), 1, MaxStrLen(Item."No.")); + Item.SetLoadFields(Blocked); + if Item.Get(ItemNo) then begin + if Item.Blocked then + ShouldCreateLine := false + end else + if GPPOP10110.NONINVEN = 0 then + ShouldCreateLine := false; + + if ShouldCreateLine then begin + LineQuantityRemaining := GPPOP10110.QTYORDER - GPPOP10110.QTYCANCE; + if LineQuantityRemaining > 0 then begin + GPPOPReceiptApplyLineUnitCost.SetLoadFields(TRXLOCTN, PCHRPTCT, UOFM); + GPPOPReceiptApplyLineUnitCost.SetCurrentKey(TRXLOCTN, PCHRPTCT); + GPPOPReceiptApplyLineUnitCost.SetRange(PONUMBER, GPPOP10110.PONUMBER); + GPPOPReceiptApplyLineUnitCost.SetRange(POLNENUM, GPPOP10110.ORD); + GPPOPReceiptApplyLineUnitCost.SetRange(Status, GPPOPReceiptApplyLineUnitCost.Status::Posted); + GPPOPReceiptApplyLineUnitCost.SetFilter(POPTYPE, '1|3'); + GPPOPReceiptApplyLineUnitCost.SetFilter(QTYSHPPD, '>%1', 0); + GPPOPReceiptApplyLineUnitCost.SetFilter(PCHRPTCT, '>%1', 0); + + if GPPOPReceiptApplyLineUnitCost.FindSet() then + repeat + if ((LastLocation <> GPPOPReceiptApplyLineUnitCost.TRXLOCTN) or (LastLineUnitCost <> GPPOPReceiptApplyLineUnitCost.PCHRPTCT)) then begin + LocationCode := CopyStr(GPPOPReceiptApplyLineUnitCost.TRXLOCTN, 1, MaxStrLen(LocationCode)); + LineQtyReceivedByUnitCost := GPPOPReceiptApply.GetSumQtyShippedByUnitCost(GPPOP10110.PONUMBER, GPPOP10110.ORD, LocationCode, GPPOPReceiptApplyLineUnitCost.PCHRPTCT); + LineQtyInvoicedByUnitCost := GPPOPReceiptApply.GetSumQtyInvoicedByUnitCost(GPPOP10110.PONUMBER, GPPOP10110.ORD, LocationCode, GPPOPReceiptApplyLineUnitCost.PCHRPTCT); + + if (LineQtyReceivedByUnitCost > LineQtyInvoicedByUnitCost) then + InsertPOLine(PONumber, GPPOP10110, LineQuantityRemaining, LineQtyReceivedByUnitCost, LineQtyInvoicedByUnitCost, HasLines, LineBuffer) + else + LineQuantityRemaining := LineQuantityRemaining - LineQtyReceivedByUnitCost; + + LastLocation := GPPOPReceiptApplyLineUnitCost.TRXLOCTN; + LastLineUnitCost := GPPOPReceiptApplyLineUnitCost.PCHRPTCT; + end; + until GPPOPReceiptApplyLineUnitCost.Next() = 0; + + if LineQuantityRemaining > 0 then + InsertPOLine(PONumber, GPPOP10110, LineQuantityRemaining, 0, 0, HasLines, LineBuffer); + end; + end; + until GPPOP10110.Next() = 0; + + exit(HasLines); + end; + + local procedure InsertPOLine(PONumber: Code[20]; var GPPOP10110: Record "GP POP10110"; var LineQuantityRemaining: Decimal; QuantityReceived: Decimal; QuantityInvoiced: Decimal; var HasLines: Boolean; var LineBuffer: Record "GP PO Validation Buffer") + var + ItemNo: Code[20]; + AdjustedQuantity: Decimal; + AdjustedQuantityReceived: Decimal; + QuantityOverReceipt: Decimal; + POLineIdTxt: Text[50]; + begin + AdjustedQuantityReceived := SubtractAndZeroIfNegative(QuantityReceived, QuantityInvoiced); + if AdjustedQuantityReceived > 0 then + AdjustedQuantity := SubtractAndZeroIfNegative(QuantityReceived, QuantityInvoiced) + else + AdjustedQuantity := SubtractAndZeroIfNegative(LineQuantityRemaining, QuantityInvoiced); + + QuantityOverReceipt := SubtractAndZeroIfNegative(AdjustedQuantityReceived, AdjustedQuantity); + + if QuantityOverReceipt > 0 then + AdjustedQuantity := AdjustedQuantityReceived; + + if AdjustedQuantity > 0 then begin + POLineIdTxt := CopyStr(PONumber + '_' + CopyStr(GPPOP10110.ITEMNMBR.TrimEnd(), 1, MaxStrLen(ItemNo)), 1, MaxStrLen(POLineIdTxt)); + LineBuffer.SetRange("No.", POLineIdTxt); + if LineBuffer.FindFirst() then begin + LineBuffer."Decimal 1" := LineBuffer."Decimal 1" + AdjustedQuantity; + LineBuffer."Decimal 2" := LineBuffer."Decimal 2" + AdjustedQuantityReceived; + LineBuffer.Modify(); + end else begin + LineBuffer."No." := POLineIdTxt; + LineBuffer."Parent No." := PONumber; + LineBuffer."Text 1" := CopyStr(CopyStr(GPPOP10110.ITEMNMBR.TrimEnd(), 1, MaxStrLen(ItemNo)), 1, MaxStrLen(LineBuffer."Text 1")); + LineBuffer."Decimal 1" := AdjustedQuantity; + LineBuffer."Decimal 2" := AdjustedQuantityReceived; + LineBuffer.Insert(); + end; + + HasLines := true; + end; + LineQuantityRemaining := LineQuantityRemaining - QuantityReceived; + end; + + local procedure SubtractAndZeroIfNegative(Minuend: Decimal; Subtrahend: Decimal): Decimal + var + Difference: Decimal; + begin + Difference := Minuend - Subtrahend; + + if Difference < 0 then + Difference := 0; + + exit(Difference); + end; + + local procedure RunVendorValidation(var GPCompanyAdditionalSettings: Record "GP Company Additional Settings") + var + GPPM00200: Record "GP PM00200"; + GPPM20000: Record "GP PM20000"; + GPVendor: Record "GP Vendor"; + GPPaymentTerms: Record "GP Payment Terms"; + Vendor: Record Vendor; + GPPopulateCombinedTables: Codeunit "GP Populate Combined Tables"; + HelperFunctions: Codeunit "Helper Functions"; + BalanceFailureShouldBeWarning: Boolean; + IsActive: Boolean; + ShouldInclude: Boolean; + ClassName: Code[20]; + VendorNo: Code[20]; + Balance: Decimal; + EntityType: Text[50]; + VendorName2: Text[50]; + PaymentTerms: Code[10]; + TaxLiable: Boolean; + PhoneNo: Text[30]; + FaxNo: Text[30]; + begin + EntityType := VendorEntityCaptionLbl; + BalanceFailureShouldBeWarning := (TotalUnpostedVendorBatchCount > 0); + + if GPCompanyAdditionalSettings.GetPayablesModuleEnabled() then begin + GPPM00200.SetFilter(VENDORID, '<>%1', ''); + if GPPM00200.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPPM00200) then + continue; + + VendorNo := CopyStr(GPPM00200.VENDORID.TrimEnd(), 1, MaxStrLen(VendorNo)); + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, VendorNo); + + Balance := 0; + ShouldInclude := true; + IsActive := (GPPM00200.VENDSTTS = 1) or (GPPM00200.VENDSTTS = 3); + + if not GPCompanyAdditionalSettings.GetMigrateInactiveVendors() then + if not IsActive then + ShouldInclude := false; + + if ShouldInclude then + ShouldInclude := ShouldMigrateTemporaryVendor(GPPM00200.VENDORID); + + if ShouldInclude then begin + if GPCompanyAdditionalSettings.GetMigrateVendorClasses() then + ClassName := CopyStr(GPPM00200.VNDCLSID.TrimEnd(), 1, MaxStrLen(ClassName)); + + if ClassName = '' then + ClassName := DefaultClassNameTok; + + Clear(GPVendor); + GPPopulateCombinedTables.SetGPVendorFields(GPVendor, GPPM00200); + + GPVendor.PHNUMBR1 := HelperFunctions.CleanGPPhoneOrFaxNumber(GPVendor.PHNUMBR1); + GPVendor.FAXNUMBR := HelperFunctions.CleanGPPhoneOrFaxNumber(GPVendor.FAXNUMBR); + + if not GPCompanyAdditionalSettings.GetMigrateOnlyPayablesMaster() then + if not GPCompanyAdditionalSettings.GetSkipPostingVendorBatches() then begin + GPPM20000.SetRange(VENDORID, GPPM00200.VENDORID); + GPPM20000.SetFilter(DOCTYPE, '<=7'); + GPPM20000.SetFilter(CURTRXAM, '>=0.01'); + GPPM20000.SetRange(VOIDED, false); + if GPPM20000.FindSet() then + repeat + if GPPM20000.DOCTYPE < 4 then + Balance := Balance + RoundWithSpecPrecision(GPPM20000.CURTRXAM) + else + Balance := Balance + RoundWithSpecPrecision(GPPM20000.CURTRXAM * -1); + until GPPM20000.Next() = 0; + end; + + if not MigrationValidationAssert.ValidateRecordExists(Test_VENDOREXISTS_Tok, Vendor.Get(VendorNo), StrSubstNo(MissingEntityTok, EntityType)) then + continue; + + Vendor.CalcFields(Balance); + + MigrationValidationAssert.ValidateAreEqual(Test_VENDORNAME_Tok, CopyStr(GPVendor.VENDNAME.TrimEnd(), 1, MaxStrLen(Vendor.Name)), Vendor.Name, NameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORPOSTINGGROUP_Tok, ClassName, Vendor."Vendor Posting Group", VendorPostingGroupLbl); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORPREFBANKACCT_Tok, GetPreferredGPVendorBankCode(VendorNo), Vendor."Preferred Bank Account Code", PreferredBankAccountLbl); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORADDR_Tok, CopyStr(GPVendor.ADDRESS1, 1, MaxStrLen(Vendor.Address)), Vendor.Address, AddressLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORADDR2_Tok, CopyStr(GPVendor.ADDRESS2, 1, MaxStrLen(Vendor."Address 2")), Vendor."Address 2", Address2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORCITY_Tok, CopyStr(GPVendor.CITY, 1, MaxStrLen(Vendor.City)), Vendor.City, CityLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORCONTACT_Tok, CopyStr(GPVendor.VNDCNTCT, 1, MaxStrLen(Vendor.Contact)), Vendor.Contact, ContactLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORSHIPMETHOD_Tok, UpperCase(CopyStr(GPVendor.SHIPMTHD, 1, MaxStrLen(Vendor."Shipment Method Code")).TrimEnd()), Vendor."Shipment Method Code", ShipmentMethodLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORTAXAREA_Tok, UpperCase(GPVendor.TAXSCHID.TrimEnd()), Vendor."Tax Area Code", TaxAreaLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORBALANCE_Tok, Balance, Vendor.Balance, BalanceLbl, BalanceFailureShouldBeWarning); + + TaxLiable := (GPVendor.TAXSCHID <> ''); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORTAXLIABLE_Tok, TaxLiable, Vendor."Tax Liable", TaxLiableLbl, true); + + VendorName2 := CopyStr(GPVendor.VNDCHKNM.TrimEnd(), 1, MaxStrLen(Vendor."Name 2")); + if HelperFunctions.StringEqualsCaseInsensitive(VendorName2, Vendor.Name) then + VendorName2 := ''; + + MigrationValidationAssert.ValidateAreEqual(Test_VENDORNAME2_Tok, VendorName2, Vendor."Name 2", Name2Lbl, true); + + PhoneNo := ''; + if GPVendor.PHNUMBR1 <> '' then + if not HelperFunctions.ContainsAlphaChars(GPVendor.PHNUMBR1) then + PhoneNo := GPVendor.PHNUMBR1; + + FaxNo := ''; + if GPVendor.FAXNUMBR <> '' then + if not HelperFunctions.ContainsAlphaChars(GPVendor.FAXNUMBR) then + FaxNo := GPVendor.FAXNUMBR; + + MigrationValidationAssert.ValidateAreEqual(Test_VENDORPHN_Tok, PhoneNo, Vendor."Phone No.", PhoneLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_VENDORFAX_Tok, FaxNo, Vendor."Fax No.", FaxLbl, true); + + PaymentTerms := ''; + if GPVendor.PYMTRMID <> '' then + if GPPaymentTerms.Get(GPVendor.PYMTRMID) then begin + PaymentTerms := CopyStr(GPVendor.PYMTRMID, 1, MaxStrLen(Vendor."Payment Terms Code")); + if GPPaymentTerms.PYMTRMID_New <> '' then + PaymentTerms := GPPaymentTerms.PYMTRMID_New; + end; + + MigrationValidationAssert.ValidateAreEqual(Test_VENDORPMTTERMS_Tok, PaymentTerms, Vendor."Payment Terms Code", PaymentTermsLbl, true); + + ValidateVendorAddresses(GPVendor); + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPPM00200); + end; + until GPPM00200.Next() = 0; + end; + end; + + local procedure ValidateVendorAddresses(var GPVendor: Record "GP Vendor") + var + GPPM00200: Record "GP PM00200"; + GPVendorAddress: Record "GP Vendor Address"; + Vendor: Record Vendor; + RemitAddress: Record "Remit Address"; + OrderAddress: Record "Order Address"; + HelperFunctions: Codeunit "Helper Functions"; + AddressCode: Code[10]; + AssignedPrimaryAddressCode: Code[10]; + AssignedRemitToAddressCode: Code[10]; + EntityType: Text[50]; + ContextCode: Text[250]; + begin + if not Vendor.Get(GPVendor.VENDORID) then + exit; + + if GPPM00200.Get(GPVendor.VENDORID) then begin + AssignedPrimaryAddressCode := CopyStr(GPPM00200.VADDCDPR.Trim(), 1, MaxStrLen(AssignedPrimaryAddressCode)); + AssignedRemitToAddressCode := CopyStr(GPPM00200.VADCDTRO.Trim(), 1, MaxStrLen(AssignedRemitToAddressCode)); + end; + + GPVendorAddress.SetRange(VENDORID, Vendor."No."); + if GPVendorAddress.FindSet() then + repeat + if MigrationValidationAssert.IsSourceRowValidated(ValidationSuiteIdTok, GPVendorAddress) then + continue; + + AddressCode := CopyStr(GPVendorAddress.ADRSCODE.Trim(), 1, MaxStrLen(AddressCode)); + ContextCode := Vendor."No." + '-' + AddressCode; + + if AddressCode = AssignedRemitToAddressCode then begin + EntityType := VendorRemitAddressEntityCaptionLbl; + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, ContextCode); + + if MigrationValidationAssert.ValidateRecordExists(Test_REMITADDREXISTS_Tok, RemitAddress.Get(AddressCode, Vendor."No."), StrSubstNo(MissingEntityTok, EntityType)) then begin + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRNAME_Tok, Vendor.Name, RemitAddress.Name, NameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRADDR_Tok, GPVendorAddress.ADDRESS1.TrimEnd(), RemitAddress.Address, AddressLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRADDR2_Tok, CopyStr(GPVendorAddress.ADDRESS2.TrimEnd(), 1, MaxStrLen(RemitAddress."Address 2")), RemitAddress."Address 2", Address2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRCITY_Tok, CopyStr(GPVendorAddress.CITY.TrimEnd(), 1, MaxStrLen(RemitAddress.City)), RemitAddress.City, CityLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRPOSTCODE_Tok, UpperCase(GPVendorAddress.ZIPCODE.TrimEnd()), RemitAddress."Post Code", PostCodeLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRPHN_Tok, HelperFunctions.CleanGPPhoneOrFaxNumber(GPVendorAddress.PHNUMBR1), RemitAddress."Phone No.", PhoneLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRFAX_Tok, HelperFunctions.CleanGPPhoneOrFaxNumber(GPVendorAddress.FAXNUMBR), RemitAddress."Fax No.", FaxLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRCOUNTY_Tok, GPVendorAddress.STATE.TrimEnd(), RemitAddress.County, CountyLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_REMITADDRCONTACT_Tok, GPVendorAddress.VNDCNTCT.TrimEnd(), RemitAddress.Contact, ContactLbl, true); + end; + end; + + if (AddressCode = AssignedPrimaryAddressCode) or (AddressCode <> AssignedRemitToAddressCode) then begin + EntityType := VendorOrderAddressEntityCaptionLbl; + MigrationValidationAssert.SetContext(ValidationSuiteIdTok, EntityType, ContextCode); + + if MigrationValidationAssert.ValidateRecordExists(Test_ORDERADDREXISTS_Tok, OrderAddress.Get(Vendor."No.", AddressCode), StrSubstNo(MissingEntityTok, EntityType)) then begin + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRNAME_Tok, Vendor.Name, OrderAddress.Name, NameLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRADDR_Tok, GPVendorAddress.ADDRESS1.TrimEnd(), OrderAddress.Address, AddressLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRADDR2_Tok, CopyStr(GPVendorAddress.ADDRESS2.TrimEnd(), 1, MaxStrLen(OrderAddress."Address 2")), OrderAddress."Address 2", Address2Lbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRCITY_Tok, CopyStr(GPVendorAddress.CITY.TrimEnd(), 1, MaxStrLen(OrderAddress.City)), OrderAddress.City, CityLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRPOSTCODE_Tok, UpperCase(GPVendorAddress.ZIPCODE.TrimEnd()), OrderAddress."Post Code", PostCodeLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRPHN_Tok, HelperFunctions.CleanGPPhoneOrFaxNumber(GPVendorAddress.PHNUMBR1), OrderAddress."Phone No.", PhoneLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRFAX_Tok, HelperFunctions.CleanGPPhoneOrFaxNumber(GPVendorAddress.FAXNUMBR), OrderAddress."Fax No.", FaxLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRCOUNTY_Tok, GPVendorAddress.STATE.TrimEnd(), OrderAddress.County, CountyLbl, true); + MigrationValidationAssert.ValidateAreEqual(Test_ORDERADDRCONTACT_Tok, GPVendorAddress.VNDCNTCT.TrimEnd(), OrderAddress.Contact, ContactLbl, true); + end; + end; + + MigrationValidationAssert.SetSourceRowValidated(ValidationSuiteIdTok, GPVendorAddress); + until GPVendorAddress.Next() = 0; + end; + + local procedure ShouldMigrateTemporaryVendor(VendorNo: Text[75]): Boolean + var + GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; + GPPM00200: Record "GP PM00200"; + GPPOP10100: Record "GP POP10100"; + GPVendorTransactions: Record "GP Vendor Transactions"; + HasOpenPurchaseOrders: Boolean; + HasOpenTransactions: Boolean; + IsTemporaryVendor: Boolean; + begin + if GPCompanyAdditionalSettings.GetMigrateTemporaryVendors() then + exit(true); + + GPPM00200.SetLoadFields(VENDSTTS); + if GPPM00200.Get(VendorNo) then + IsTemporaryVendor := GPPM00200.VENDSTTS = 3; + + if not IsTemporaryVendor then + exit(true); + + // Check for open POs + GPPOP10100.SetRange(POTYPE, GPPOP10100.POTYPE::Standard); + GPPOP10100.SetRange(POSTATUS, 1, 4); + GPPOP10100.SetRange(VENDORID, VendorNo); + HasOpenPurchaseOrders := GPPOP10100.Count() > 0; + + // Check for open AP transactions + GPVendorTransactions.SetRange(VENDORID, VendorNo); + HasOpenTransactions := GPVendorTransactions.Count() > 0; + + if not HasOpenPurchaseOrders then + if not HasOpenTransactions then + exit(false); + + exit(true); + end; + + local procedure GetPreferredGPVendorBankCode(VendorNo: Code[20]): Code[20] + var + GPPM00200: Record "GP PM00200"; + GPSY06000: Record "GP SY06000"; + SearchGPSY06000: Record "GP SY06000"; + AddressCode: Code[10]; + PrimaryAddressCode: Code[10]; + RemitToAddressCode: Code[10]; + GeneratedBankCode: Code[20]; + PreferredBankCode: Code[20]; + BankAccountCounter: Integer; + MaxSupportedVendorNoLength: Integer; + NumberOfAccounts: Integer; + begin + PreferredBankCode := ''; + BankAccountCounter := 0; + + GPPM00200.SetLoadFields(VADDCDPR, VADCDTRO); + if not GPPM00200.Get(VendorNo) then + exit; + + GPSY06000.SetLoadFields(CustomerVendor_ID); + GPSY06000.SetRange(CustomerVendor_ID, VendorNo); + GPSY06000.SetRange(INACTIVE, false); + NumberOfAccounts := GPSY06000.Count(); + + if NumberOfAccounts = 0 then + exit; + + // Single bank account, then return the VendorNo as the bank code + if NumberOfAccounts = 1 then + exit(VendorNo); + + // Multiple bank accounts, duplicate migration logic for multiple account handling + PrimaryAddressCode := CopyStr(GPPM00200.VADDCDPR.Trim(), 1, MaxStrLen(PrimaryAddressCode)); + RemitToAddressCode := CopyStr(GPPM00200.VADCDTRO.Trim(), 1, MaxStrLen(RemitToAddressCode)); + MaxSupportedVendorNoLength := MaxStrLen(GeneratedBankCode) - StrLen(Format(NumberOfAccounts)) - 1; + + if StrLen(VendorNo) > MaxSupportedVendorNoLength then +#pragma warning disable AA0139 + VendorNo := CopyStr(VendorNo, 1, MaxSupportedVendorNoLength); +#pragma warning restore AA0139 + + GPSY06000.SetLoadFields(ADRSCODE); + if GPSY06000.FindSet() then + repeat + BankAccountCounter := BankAccountCounter + 1; + GeneratedBankCode := CopyStr(VendorNo + '-' + Format(BankAccountCounter), 1, MaxStrLen(GeneratedBankCode)); + AddressCode := CopyStr(GPSY06000.ADRSCODE.TrimEnd(), 1, MaxStrLen(AddressCode)); + + if AddressCode = RemitToAddressCode then + PreferredBankCode := GeneratedBankCode + else + if AddressCode = PrimaryAddressCode then begin + SearchGPSY06000.SetRange("CustomerVendor_ID", VendorNo); + SearchGPSY06000.SetRange("ADRSCODE", RemitToAddressCode); + SearchGPSY06000.SetRange("INACTIVE", false); + if SearchGPSY06000.IsEmpty() then + PreferredBankCode := GeneratedBankCode; + end; + until GPSY06000.Next() = 0; + + exit(PreferredBankCode); + end; + + local procedure GetAccountFilter(AccountNo: Text[50]; ACCTYPE: Integer): Text + var + GPGL00100: Record "GP GL00100"; + FilterText: Text; + begin + GPGL00100.SetLoadFields(ACTINDX); + GPGL00100.SetRange(ACCTTYPE, ACCTYPE); + GPGL00100.SetRange(MNACSGMT, AccountNo); + GPGL00100.SetRange(PSTNGTYP, 0); + GPGL00100.SetRange(Clear_Balance, false); + if GPGL00100.FindSet() then + repeat + if FilterText <> '' then + FilterText += '|' + Format(GPGL00100.ACTINDX) + else + FilterText := Format(GPGL00100.ACTINDX); + until GPGL00100.Next() = 0; + + exit(FilterText); + end; + + internal procedure RoundWithSpecPrecision(Amount: Decimal): Decimal + begin + exit(Round(Amount, DefaultCurrency."Amount Rounding Precision")); + end; + + internal procedure GetValidationSuiteId(): Code[20]; + begin + exit('GP'); + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Migration Validation", OnPrepareValidation, '', false, false)] + local procedure OnPrepareValidation(ProductID: Text[250]) + var + HybridGPWizard: Codeunit "Hybrid GP Wizard"; + begin + if ProductID <> HybridGPWizard.ProductId() then + exit; + + RegisterValidationSuite(); + + AddTest(Test_ACCOUNTEXISTS_Tok, 'G/L Account', 'Missing Account'); + AddTest(Test_ACCOUNTNAME_Tok, 'G/L Account', 'Name'); + AddTest(Test_ACCOUNTTYPE_Tok, 'G/L Account', 'Account Type'); + AddTest(Test_ACCOUNTCATEGORY_Tok, 'G/L Account', 'Account Category'); + AddTest(Test_ACCOUNTDEBCRED_Tok, 'G/L Account', 'Debit/Credit'); + AddTest(Test_ACCOUNTSUBCATEGORY_Tok, 'G/L Account', 'Account Subcategory'); + AddTest(Test_ACCOUNTINCBAL_Tok, 'G/L Account', 'Income/Balance'); + AddTest(Test_ACCOUNTBALANCE_Tok, 'G/L Account', 'Balance'); + AddTest(Test_STATACCOUNTEXISTS_Tok, 'Statistical Account', 'Missing Account'); + AddTest(Test_STATACCOUNTNAME_Tok, 'Statistical Account', 'Name'); + AddTest(Test_STATACCOUNTDIM1_Tok, 'Statistical Account', 'Dimension 1'); + AddTest(Test_STATACCOUNTDIM2_Tok, 'Statistical Account', 'Dimension 2'); + AddTest(Test_STATACCOUNTBALANCE_Tok, 'Statistical Account', 'Balance'); + AddTest(Test_BANKACCOUNTEXISTS_Tok, 'Bank Account', 'Missing Bank Account'); + AddTest(Test_BANKACCOUNTNAME_Tok, 'Bank Account', 'Name'); + AddTest(Test_BANKACCOUNTNO_Tok, 'Bank Account', 'Bank Account No.'); + AddTest(Test_BANKACCOUNTADDR_Tok, 'Bank Account', 'Address'); + AddTest(Test_BANKACCOUNTADDR2_Tok, 'Bank Account', 'Address 2'); + AddTest(Test_BANKACCOUNTCITY_Tok, 'Bank Account', 'City'); + AddTest(Test_BANKACCOUNTCOUNTY_Tok, 'Bank Account', 'County (State)'); + AddTest(Test_BANKACCOUNTPOSTCODE_Tok, 'Bank Account', 'Post Code'); + AddTest(Test_BANKACCOUNTPHN_Tok, 'Bank Account', 'Phone'); + AddTest(Test_BANKACCOUNTFAX_Tok, 'Bank Account', 'Fax'); + AddTest(Test_BANKACCOUNTTRANSITNO_Tok, 'Bank Account', 'Transit No.'); + AddTest(Test_BANKACCOUNTBRANCHNO_Tok, 'Bank Account', 'Bank Branch No.'); + AddTest(Test_BANKACCOUNTBALANCE_Tok, 'Bank Account', 'Balance'); + AddTest(Test_CUSTOMEREXISTS_Tok, 'Customer', 'Missing Customer'); + AddTest(Test_CUSTOMERNAME_Tok, 'Customer', 'Name'); + AddTest(Test_CUSTOMERPOSTINGGROUP_Tok, 'Customer', 'Customer Posting Group'); + AddTest(Test_CUSTOMERADDR_Tok, 'Customer', 'Address'); + AddTest(Test_CUSTOMERADDR2_Tok, 'Customer', 'Address 2'); + AddTest(Test_CUSTOMERCITY_Tok, 'Customer', 'City'); + AddTest(Test_CUSTOMERPHN_Tok, 'Customer', 'Phone'); + AddTest(Test_CUSTOMERFAX_Tok, 'Customer', 'Fax'); + AddTest(Test_CUSTOMERNAME2_Tok, 'Customer', 'Name 2'); + AddTest(Test_CUSTOMERCREDITLMT_Tok, 'Customer', 'Credit Limit'); + AddTest(Test_CUSTOMERCONTACT_Tok, 'Customer', 'Contact'); + AddTest(Test_CUSTOMERSALESPERSON_Tok, 'Customer', 'Sales Person'); + AddTest(Test_CUSTOMERSHIPMETHOD_Tok, 'Customer', 'Shipment Method'); + AddTest(Test_CUSTOMERPMTTERMS_Tok, 'Customer', 'Payment Terms'); + AddTest(Test_CUSTOMERTERRITORY_Tok, 'Customer', 'Territory'); + AddTest(Test_CUSTOMERTAXAREA_Tok, 'Customer', 'Tax Area'); + AddTest(Test_CUSTOMERTAXLIABLE_Tok, 'Customer', 'Tax Liable'); + AddTest(Test_CUSTOMERBALANCE_Tok, 'Customer', 'Balance'); + AddTest(Test_SHIPADDREXISTS_Tok, 'Customer - Ship-to Address', 'Missing address'); + AddTest(Test_SHIPADDRNAME_Tok, 'Customer - Ship-to Address', 'Name'); + AddTest(Test_SHIPADDRADDR_Tok, 'Customer - Ship-to Address', 'Address'); + AddTest(Test_SHIPADDRADDR2_Tok, 'Customer - Ship-to Address', 'Address 2'); + AddTest(Test_SHIPADDRCITY_Tok, 'Customer - Ship-to Address', 'City'); + AddTest(Test_SHIPADDRPOSTCODE_Tok, 'Customer - Ship-to Address', 'Post Code'); + AddTest(Test_SHIPADDRPHN_Tok, 'Customer - Ship-to Address', 'Phone'); + AddTest(Test_SHIPADDRFAX_Tok, 'Customer - Ship-to Address', 'Fax'); + AddTest(Test_SHIPADDRCONTACT_Tok, 'Customer - Ship-to Address', 'Contact'); + AddTest(Test_SHIPADDRSHIPMETHOD_Tok, 'Customer - Ship-to Address', 'Shipment Method'); + AddTest(Test_SHIPADDRCOUNTY_Tok, 'Customer - Ship-to Address', 'County (State)'); + AddTest(Test_SHIPADDRTAXAREA_Tok, 'Customer - Ship-to Address', 'Tax Area'); + AddTest(Test_ITEMEXISTS_Tok, 'Item', 'Missing Item'); + AddTest(Test_ITEMTYPE_Tok, 'Item', 'Type'); + AddTest(Test_ITEMDESC_Tok, 'Item', 'Description'); + AddTest(Test_ITEMDESC2_Tok, 'Item', 'Description 2'); + AddTest(Test_ITEMSEARCHDESC_Tok, 'Item', 'Search Description'); + AddTest(Test_ITEMPOSTINGGROUP_Tok, 'Item', 'Inventory Posting Group'); + AddTest(Test_ITEMUNITLISTPRICE_Tok, 'Item', 'Unit List Price'); + AddTest(Test_ITEMCOSTMETHOD_Tok, 'Item', 'Costing Method'); + AddTest(Test_ITEMBASEUOFM_Tok, 'Item', 'Base Unit of Measure'); + AddTest(Test_ITEMPURCHUOFM_Tok, 'Item', 'Purch. Unit of Measure'); + AddTest(Test_ITEMTRACKINGCODE_Tok, 'Item', 'Item Tracking Code'); + AddTest(Test_ITEMINVENTORY_Tok, 'Item', 'Inventory'); + AddTest(Test_POEXISTS_Tok, 'Purchase Order', 'Missing Purchase Order'); + AddTest(Test_POBUYFROMVEND_Tok, 'Purchase Order', 'Buy-from Vendor No.'); + AddTest(Test_POPAYTOVEND_Tok, 'Purchase Order', 'Pay-to Vendor No.'); + AddTest(Test_PODOCDATE_Tok, 'Purchase Order', 'Document Date'); + AddTest(Test_POLINEEXISTS_Tok, 'Purchase Order - Line', 'Missing PO Line'); + AddTest(Test_POLINEQTY_Tok, 'Purchase Order - Line', 'Quantity'); + AddTest(Test_POLINEQTYRECV_Tok, 'Purchase Order - Line', 'Quantity Received'); + AddTest(Test_VENDOREXISTS_Tok, 'Vendor', 'Missing Vendor'); + AddTest(Test_VENDORNAME_Tok, 'Vendor', 'Name'); + AddTest(Test_VENDORNAME2_Tok, 'Vendor', 'Name 2'); + AddTest(Test_VENDORPOSTINGGROUP_Tok, 'Vendor', 'Vendor Posting Group'); + AddTest(Test_VENDORPREFBANKACCT_Tok, 'Vendor', 'Preferred Bank Account'); + AddTest(Test_VENDORADDR_Tok, 'Vendor', 'Address'); + AddTest(Test_VENDORADDR2_Tok, 'Vendor', 'Address 2'); + AddTest(Test_VENDORCITY_Tok, 'Vendor', 'City'); + AddTest(Test_VENDORPHN_Tok, 'Vendor', 'Phone'); + AddTest(Test_VENDORFAX_Tok, 'Vendor', 'Fax'); + AddTest(Test_VENDORCONTACT_Tok, 'Vendor', 'Contact'); + AddTest(Test_VENDORSHIPMETHOD_Tok, 'Vendor', 'Shipment Method'); + AddTest(Test_VENDORPMTTERMS_Tok, 'Vendor', 'Payment Terms'); + AddTest(Test_VENDORTAXAREA_Tok, 'Vendor', 'Tax Area'); + AddTest(Test_VENDORTAXLIABLE_Tok, 'Vendor', 'Tax Liable'); + AddTest(Test_VENDORBALANCE_Tok, 'Vendor', 'Balance'); + AddTest(Test_ORDERADDREXISTS_Tok, 'Vendor - Order Address', 'Missing address'); + AddTest(Test_ORDERADDRNAME_Tok, 'Vendor - Order Address', 'Name'); + AddTest(Test_ORDERADDRADDR_Tok, 'Vendor - Order Address', 'Address'); + AddTest(Test_ORDERADDRADDR2_Tok, 'Vendor - Order Address', 'Address 2'); + AddTest(Test_ORDERADDRCITY_Tok, 'Vendor - Order Address', 'City'); + AddTest(Test_ORDERADDRPOSTCODE_Tok, 'Vendor - Order Address', 'Post Code'); + AddTest(Test_ORDERADDRPHN_Tok, 'Vendor - Order Address', 'Phone'); + AddTest(Test_ORDERADDRFAX_Tok, 'Vendor - Order Address', 'Fax'); + AddTest(Test_ORDERADDRCOUNTY_Tok, 'Vendor - Order Address', 'County (State)'); + AddTest(Test_ORDERADDRCONTACT_Tok, 'Vendor - Order Address', 'Contact'); + AddTest(Test_REMITADDREXISTS_Tok, 'Vendor - Remit Address', 'Missing address'); + AddTest(Test_REMITADDRNAME_Tok, 'Vendor - Remit Address', 'Name'); + AddTest(Test_REMITADDRADDR_Tok, 'Vendor - Remit Address', 'Address'); + AddTest(Test_REMITADDRADDR2_Tok, 'Vendor - Remit Address', 'Address 2'); + AddTest(Test_REMITADDRCITY_Tok, 'Vendor - Remit Address', 'City'); + AddTest(Test_REMITADDRPOSTCODE_Tok, 'Vendor - Remit Address', 'Post Code'); + AddTest(Test_REMITADDRPHN_Tok, 'Vendor - Remit Address', 'Phone'); + AddTest(Test_REMITADDRFAX_Tok, 'Vendor - Remit Address', 'Fax'); + AddTest(Test_REMITADDRCOUNTY_Tok, 'Vendor - Remit Address', 'County (State)'); + AddTest(Test_REMITADDRCONTACT_Tok, 'Vendor - Remit Address', 'Contact'); + end; + + local procedure RegisterValidationSuite() + var + ValidationSuite: Record "Validation Suite"; + GPMigrationValidator: Codeunit "GP Migration Validator"; + HybridGPWizard: Codeunit "Hybrid GP Wizard"; + MigrationType: Text[250]; + ValidatorCodeunitId: Integer; + begin + ValidationSuiteIdTok := GPMigrationValidator.GetValidationSuiteId(); + MigrationType := HybridGPWizard.ProductId(); + ValidatorCodeunitId := Codeunit::"GP Migration Validator"; + if not ValidationSuite.Get(ValidationSuiteIdTok) then begin + ValidationSuite.Validate(Id, ValidationSuiteIdTok); + ValidationSuite.Validate("Migration Type", MigrationType); + ValidationSuite.Validate(Description, ValidatorDescriptionLbl); + ValidationSuite.Validate("Codeunit Id", ValidatorCodeunitId); + ValidationSuite.Validate(Automatic, true); + ValidationSuite.Validate("Errors should fail migration", false); + ValidationSuite.Insert(true); + end; + end; + + local procedure AddTest(Code: Code[30]; Entity: Text[50]; Description: Text) + var + ValidationSuiteLine: Record "Validation Suite Line"; + GPMigrationValidator: Codeunit "GP Migration Validator"; + begin + if not ValidationSuiteLine.Get(Code, GPMigrationValidator.GetValidationSuiteId()) then begin + ValidationSuiteLine.Validate(Code, Code); + ValidationSuiteLine.Validate("Validation Suite Id", GPMigrationValidator.GetValidationSuiteId()); + ValidationSuiteLine.Validate(Entity, Entity); + ValidationSuiteLine.Validate("Test Description", Description); + ValidationSuiteLine.Insert(true); + end; + end; + + var + DefaultCurrency: Record Currency; + MigrationValidationAssert: Codeunit "Migration Validation Assert"; + ValidationSuiteIdTok: Code[20]; + CompanyNameTxt: Text; + TotalUnpostedBankBatchCount: Integer; + TotalUnpostedCustomerBatchCount: Integer; + TotalUnpostedGLBatchCount: Integer; + TotalUnpostedItemBatchCount: Integer; + TotalUnpostedStatisticalBatchCount: Integer; + TotalUnpostedVendorBatchCount: Integer; + AccountCategoryLbl: Label 'Account Category'; + AccountDebitCreditLbl: Label 'Debit/Credit'; + AccountIncomeBalanceLbl: Label 'Income/Balance'; + AccountNameLbl: Label 'Name'; + AccountSubcategoryLbl: Label 'Account Subcategory'; + AccountTypeLbl: Label 'Account Type'; + Address2Lbl: Label 'Address 2'; + AddressLbl: Label 'Address'; + BalanceLbl: Label 'Balance'; + BankAccountEntityCaptionLbl: Label 'Bank Account', MaxLength = 50; + BankAccountNumberLbl: Label 'Account Number'; + BankBranchNoLbl: Label 'Bank Branch No.'; + BaseUofMLbl: Label 'Base UofM'; + BeginningBalanceLbl: Label 'Beginning Balance'; + CityLbl: Label 'City'; + ContactLbl: Label 'Contact'; + CostingMethodLbl: Label 'Costing Method'; + CountyLbl: Label 'County'; + CreditLimitLbl: Label 'Credit Limit'; + CustomerAddressEntityCaptionLbl: Label 'Customer Ship-to Address', MaxLength = 50; + CustomerEntityCaptionLbl: Label 'Customer', MaxLength = 50; + CustomerPostingGroupLbl: Label 'Customer Posting Group'; + DefaultClassNameTok: Label 'GP', MaxLength = 20, Locked = true; + Description2Lbl: Label 'Description 2'; + DescriptionLbl: Label 'Description'; + Dimension1Lbl: Label 'Dimension 1'; + Dimension2Lbl: Label 'Dimension 2'; + DocumentDateLbl: Label 'Document Date'; + FaxLbl: Label 'Fax'; + GlAccountEntityCaptionLbl: Label 'G/L Account', MaxLength = 50; + ItemEntityCaptionLbl: Label 'Item', MaxLength = 50; + ItemPostingGroupLbl: Label 'Item Posting Group'; + ItemTrackingCodeLbl: Label 'Item Tracking Code'; + MissingEntityTok: Label 'Missing %1', Comment = '%1 = the entity being validated'; + Name2Lbl: Label 'Name 2'; + NameLbl: Label 'Name'; + PaymentTermsLbl: Label 'Payment Terms'; + PhoneLbl: Label 'Phone'; + PostCodeLbl: Label 'Post Code'; + PreferredBankAccountLbl: Label 'Preferred Bank Account'; + PurchaseOrderBuyFromVendorNoLbl: Label 'Buy-from Vendor No.'; + PurchaseOrderPayToVendorNoLbl: Label 'Pay-to Vendor No.'; + PurchUofMLbl: Label 'Purch. UofM'; + QuantityLbl: Label 'Quantity'; + QuantityRecLbl: Label 'Quantity Received'; + SalesPersonLbl: Label 'Sales Person'; + SearchDescription2Lbl: Label 'Search Description'; + ShipmentMethodLbl: Label 'Shipment Method'; + StatisticalAccountEntityCaptionLbl: Label 'Statistical Account', MaxLength = 50; + TaxAreaLbl: Label 'Tax Area'; + TaxLiableLbl: Label 'Tax Liable'; + TerritoryLbl: Label 'Territory'; + TransitNoLbl: Label 'Transit No.'; + TypeLbl: Label 'Type'; + UnitListPriceLbl: Label 'Unit List Price'; + VendorEntityCaptionLbl: Label 'Vendor', MaxLength = 50; + VendorOrderAddressEntityCaptionLbl: Label 'Vendor Order Address', MaxLength = 50; + VendorPostingGroupLbl: Label 'Vendor Posting Group'; + VendorRemitAddressEntityCaptionLbl: Label 'Vendor Remit Address', MaxLength = 50; + ValidatorDescriptionLbl: Label 'GP migration validator', MaxLength = 250; + Test_ACCOUNTEXISTS_Tok: Label 'ACCOUNTEXISTS', Locked = true; + Test_ACCOUNTNAME_Tok: Label 'ACCOUNTNAME', Locked = true; + Test_ACCOUNTTYPE_Tok: Label 'ACCOUNTTYPE', Locked = true; + Test_ACCOUNTCATEGORY_Tok: Label 'ACCOUNTCATEGORY', Locked = true; + Test_ACCOUNTDEBCRED_Tok: Label 'ACCOUNTDEBCRED', Locked = true; + Test_ACCOUNTSUBCATEGORY_Tok: Label 'ACCOUNTSUBCATEGORY', Locked = true; + Test_ACCOUNTINCBAL_Tok: Label 'ACCOUNTINCBAL', Locked = true; + Test_ACCOUNTBALANCE_Tok: Label 'ACCOUNTBALANCE', Locked = true; + Test_STATACCOUNTEXISTS_Tok: Label 'STATACCOUNTEXISTS', Locked = true; + Test_STATACCOUNTNAME_Tok: Label 'STATACCOUNTNAME', Locked = true; + Test_STATACCOUNTDIM1_Tok: Label 'STATACCOUNTDIM1', Locked = true; + Test_STATACCOUNTDIM2_Tok: Label 'STATACCOUNTDIM2', Locked = true; + Test_STATACCOUNTBALANCE_Tok: Label 'STATACCOUNTBALANCE', Locked = true; + Test_BANKACCOUNTEXISTS_Tok: Label 'BANKACCOUNTEXISTS', Locked = true; + Test_BANKACCOUNTNAME_Tok: Label 'BANKACCOUNTNAME', Locked = true; + Test_BANKACCOUNTNO_Tok: Label 'BANKACCOUNTNO', Locked = true; + Test_BANKACCOUNTADDR_Tok: Label 'BANKACCOUNTADDR', Locked = true; + Test_BANKACCOUNTADDR2_Tok: Label 'BANKACCOUNTADDR2', Locked = true; + Test_BANKACCOUNTCITY_Tok: Label 'BANKACCOUNTCITY', Locked = true; + Test_BANKACCOUNTCOUNTY_Tok: Label 'BANKACCOUNTCOUNTY', Locked = true; + Test_BANKACCOUNTPOSTCODE_Tok: Label 'BANKACCOUNTPOSTCODE', Locked = true; + Test_BANKACCOUNTPHN_Tok: Label 'BANKACCOUNTPHN', Locked = true; + Test_BANKACCOUNTFAX_Tok: Label 'BANKACCOUNTFAX', Locked = true; + Test_BANKACCOUNTTRANSITNO_Tok: Label 'BANKACCOUNTTRANSITNO', Locked = true; + Test_BANKACCOUNTBRANCHNO_Tok: Label 'BANKACCOUNTBRANCHNO', Locked = true; + Test_BANKACCOUNTBALANCE_Tok: Label 'BANKACCOUNTBALANCE', Locked = true; + Test_CUSTOMEREXISTS_Tok: Label 'CUSTOMEREXISTS', Locked = true; + Test_CUSTOMERNAME_Tok: Label 'CUSTOMERNAME', Locked = true; + Test_CUSTOMERPOSTINGGROUP_Tok: Label 'CUSTOMERPOSTINGGROUP', Locked = true; + Test_CUSTOMERADDR_Tok: Label 'CUSTOMERADDR', Locked = true; + Test_CUSTOMERADDR2_Tok: Label 'CUSTOMERADDR2', Locked = true; + Test_CUSTOMERCITY_Tok: Label 'CUSTOMERCITY', Locked = true; + Test_CUSTOMERPHN_Tok: Label 'CUSTOMERPHN', Locked = true; + Test_CUSTOMERFAX_Tok: Label 'CUSTOMERFAX', Locked = true; + Test_CUSTOMERNAME2_Tok: Label 'CUSTOMERNAME2', Locked = true; + Test_CUSTOMERCREDITLMT_Tok: Label 'CUSTOMERCREDITLMT', Locked = true; + Test_CUSTOMERCONTACT_Tok: Label 'CUSTOMERCONTACT', Locked = true; + Test_CUSTOMERSALESPERSON_Tok: Label 'CUSTOMERSALESPERSON', Locked = true; + Test_CUSTOMERSHIPMETHOD_Tok: Label 'CUSTOMERSHIPMETHOD', Locked = true; + Test_CUSTOMERPMTTERMS_Tok: Label 'CUSTOMERPMTTERMS', Locked = true; + Test_CUSTOMERTERRITORY_Tok: Label 'CUSTOMERTERRITORY', Locked = true; + Test_CUSTOMERTAXAREA_Tok: Label 'CUSTOMERTAXAREA', Locked = true; + Test_CUSTOMERTAXLIABLE_Tok: Label 'CUSTOMERTAXLIABLE', Locked = true; + Test_CUSTOMERBALANCE_Tok: Label 'CUSTOMERBALANCE', Locked = true; + Test_SHIPADDREXISTS_Tok: Label 'SHIPADDREXISTS', Locked = true; + Test_SHIPADDRNAME_Tok: Label 'SHIPADDRNAME', Locked = true; + Test_SHIPADDRADDR_Tok: Label 'SHIPADDRADDR', Locked = true; + Test_SHIPADDRADDR2_Tok: Label 'SHIPADDRADDR2', Locked = true; + Test_SHIPADDRCITY_Tok: Label 'SHIPADDRCITY', Locked = true; + Test_SHIPADDRPOSTCODE_Tok: Label 'SHIPADDRPOSTCODE', Locked = true; + Test_SHIPADDRPHN_Tok: Label 'SHIPADDRPHN', Locked = true; + Test_SHIPADDRFAX_Tok: Label 'SHIPADDRFAX', Locked = true; + Test_SHIPADDRCONTACT_Tok: Label 'SHIPADDRCONTACT', Locked = true; + Test_SHIPADDRSHIPMETHOD_Tok: Label 'SHIPADDRSHIPMETHOD', Locked = true; + Test_SHIPADDRCOUNTY_Tok: Label 'SHIPADDRCOUNTY', Locked = true; + Test_SHIPADDRTAXAREA_Tok: Label 'SHIPADDRTAXAREA', Locked = true; + Test_ITEMEXISTS_Tok: Label 'ITEMEXISTS', Locked = true; + Test_ITEMTYPE_Tok: Label 'ITEMTYPE', Locked = true; + Test_ITEMDESC_Tok: Label 'ITEMDESC', Locked = true; + Test_ITEMDESC2_Tok: Label 'ITEMDESC2', Locked = true; + Test_ITEMSEARCHDESC_Tok: Label 'ITEMSEARCHDESC', Locked = true; + Test_ITEMPOSTINGGROUP_Tok: Label 'ITEMPOSTINGGROUP', Locked = true; + Test_ITEMUNITLISTPRICE_Tok: Label 'ITEMUNITLISTPRICE', Locked = true; + Test_ITEMCOSTMETHOD_Tok: Label 'ITEMCOSTMETHOD', Locked = true; + Test_ITEMBASEUOFM_Tok: Label 'ITEMBASEUOFM', Locked = true; + Test_ITEMPURCHUOFM_Tok: Label 'ITEMPURCHUOFM', Locked = true; + Test_ITEMTRACKINGCODE_Tok: Label 'ITEMTRACKINGCODE', Locked = true; + Test_ITEMINVENTORY_Tok: Label 'ITEMINVENTORY', Locked = true; + Test_POEXISTS_Tok: Label 'POEXISTS', Locked = true; + Test_POBUYFROMVEND_Tok: Label 'POBUYFROMVEND', Locked = true; + Test_POPAYTOVEND_Tok: Label 'POPAYTOVEND', Locked = true; + Test_PODOCDATE_Tok: Label 'PODOCDATE', Locked = true; + Test_POLINEEXISTS_Tok: Label 'POLINEEXISTS', Locked = true; + Test_POLINEQTY_Tok: Label 'POLINEQTY', Locked = true; + Test_POLINEQTYRECV_Tok: Label 'POLINEQTYRECV', Locked = true; + Test_VENDOREXISTS_Tok: Label 'VENDOREXISTS', Locked = true; + Test_VENDORNAME_Tok: Label 'VENDORNAME', Locked = true; + Test_VENDORNAME2_Tok: Label 'VENDORNAME2', Locked = true; + Test_VENDORPOSTINGGROUP_Tok: Label 'VENDORPOSTINGGROUP', Locked = true; + Test_VENDORPREFBANKACCT_Tok: Label 'VENDORPREFBANKACCT', Locked = true; + Test_VENDORADDR_Tok: Label 'VENDORADDR', Locked = true; + Test_VENDORADDR2_Tok: Label 'VENDORADDR2', Locked = true; + Test_VENDORCITY_Tok: Label 'VENDORCITY', Locked = true; + Test_VENDORPHN_Tok: Label 'VENDORPHN', Locked = true; + Test_VENDORFAX_Tok: Label 'VENDORFAX', Locked = true; + Test_VENDORCONTACT_Tok: Label 'VENDORCONTACT', Locked = true; + Test_VENDORSHIPMETHOD_Tok: Label 'VENDORSHIPMETHOD', Locked = true; + Test_VENDORPMTTERMS_Tok: Label 'VENDORPMTTERMS', Locked = true; + Test_VENDORTAXAREA_Tok: Label 'VENDORTAXAREA', Locked = true; + Test_VENDORTAXLIABLE_Tok: Label 'VENDORTAXLIABLE', Locked = true; + Test_VENDORBALANCE_Tok: Label 'VENDORBALANCE', Locked = true; + Test_ORDERADDREXISTS_Tok: Label 'ORDERADDREXISTS', Locked = true; + Test_ORDERADDRNAME_Tok: Label 'ORDERADDRNAME', Locked = true; + Test_ORDERADDRADDR_Tok: Label 'ORDERADDRADDR', Locked = true; + Test_ORDERADDRADDR2_Tok: Label 'ORDERADDRADDR2', Locked = true; + Test_ORDERADDRCITY_Tok: Label 'ORDERADDRCITY', Locked = true; + Test_ORDERADDRPOSTCODE_Tok: Label 'ORDERADDRPOSTCODE', Locked = true; + Test_ORDERADDRPHN_Tok: Label 'ORDERADDRPHN', Locked = true; + Test_ORDERADDRFAX_Tok: Label 'ORDERADDRFAX', Locked = true; + Test_ORDERADDRCOUNTY_Tok: Label 'ORDERADDRCOUNTY', Locked = true; + Test_ORDERADDRCONTACT_Tok: Label 'ORDERADDRCONTACT', Locked = true; + Test_REMITADDREXISTS_Tok: Label 'REMITADDREXISTS', Locked = true; + Test_REMITADDRNAME_Tok: Label 'REMITADDRNAME', Locked = true; + Test_REMITADDRADDR_Tok: Label 'REMITADDRADDR', Locked = true; + Test_REMITADDRADDR2_Tok: Label 'REMITADDRADDR2', Locked = true; + Test_REMITADDRCITY_Tok: Label 'REMITADDRCITY', Locked = true; + Test_REMITADDRPOSTCODE_Tok: Label 'REMITADDRPOSTCODE', Locked = true; + Test_REMITADDRPHN_Tok: Label 'REMITADDRPHN', Locked = true; + Test_REMITADDRFAX_Tok: Label 'REMITADDRFAX', Locked = true; + Test_REMITADDRCOUNTY_Tok: Label 'REMITADDRCOUNTY', Locked = true; + Test_REMITADDRCONTACT_Tok: Label 'REMITADDRCONTACT', Locked = true; +} \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al b/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al index d786e9a9cb..ef22fceb96 100644 --- a/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al +++ b/Apps/W1/HybridGP/app/src/codeunits/HybridGPManagement.codeunit.al @@ -329,6 +329,31 @@ codeunit 4016 "Hybrid GP Management" Message(GPCloudMigrationDoesNotSupportNewUIMsg); end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Data Migration Mgt.", OnValidateMigration, '', false, false)] + local procedure StartMigrationValidation(var DataCreationFailed: Boolean) + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + MigrationValidationError: Record "Migration Validation Error"; + HybridGPWizard: Codeunit "Hybrid GP Wizard"; + MigrationValidation: Codeunit "Migration Validation"; + begin + if DataCreationFailed then + exit; + + IntelligentCloudSetup.Get(); + if IntelligentCloudSetup."Product ID" <> HybridGPWizard.ProductId() then + exit; + + MigrationValidation.RunTests(true); + + MigrationValidationError.SetRange("Migration Type", IntelligentCloudSetup."Product ID"); + MigrationValidationError.SetRange("Company Name", CompanyName()); + MigrationValidationError.SetRange("Is Warning", false); + MigrationValidationError.SetRange("Errors should fail migration", true); + if not MigrationValidationError.IsEmpty() then + DataCreationFailed := true; + end; + procedure InvokeCompanyUpgrade(var HybridReplicationSummary: Record "Hybrid Replication Summary"; CompanyName: Text[50]) begin InvokeCompanyUpgrade(HybridReplicationSummary, CompanyName, GetMinimalDelayDuration()); diff --git a/Apps/W1/HybridGP/app/src/codeunits/HybridGPWizard.codeunit.al b/Apps/W1/HybridGP/app/src/codeunits/HybridGPWizard.codeunit.al index e958977747..3dc3c15408 100644 --- a/Apps/W1/HybridGP/app/src/codeunits/HybridGPWizard.codeunit.al +++ b/Apps/W1/HybridGP/app/src/codeunits/HybridGPWizard.codeunit.al @@ -137,6 +137,7 @@ codeunit 4015 "Hybrid GP Wizard" HybridReplicationDetail: Record "Hybrid Replication Detail"; GPMigrationErrorOverview: Record "GP Migration Error Overview"; GPMigrationWarnings: Record "GP Migration Warnings"; + MigrationValidationError: Record "Migration Validation Error"; begin GPCompanyMigrationSettings.Reset(); if GPCompanyMigrationSettings.FindSet() then @@ -159,6 +160,9 @@ codeunit 4015 "Hybrid GP Wizard" if not GPMigrationWarnings.IsEmpty() then GPMigrationWarnings.DeleteAll(); + + if not MigrationValidationError.IsEmpty() then + MigrationValidationError.DeleteAll(); end; [EventSubscriber(ObjectType::Table, Database::"Company", 'OnAfterDeleteEvent', '', false, false)] @@ -171,6 +175,7 @@ codeunit 4015 "Hybrid GP Wizard" HybridReplicationDetail: Record "Hybrid Replication Detail"; GPMigrationErrorOverview: Record "GP Migration Error Overview"; GPMigrationWarnings: Record "GP Migration Warnings"; + MigrationValidationError: Record "Migration Validation Error"; begin if Rec.IsTemporary() then exit; @@ -198,6 +203,10 @@ codeunit 4015 "Hybrid GP Wizard" GPMigrationWarnings.SetRange("Company Name", Rec.Name); if not GPMigrationWarnings.IsEmpty() then GPMigrationWarnings.DeleteAll(); + + MigrationValidationError.SetRange("Company Name", Rec.Name); + if not MigrationValidationError.IsEmpty() then + MigrationValidationError.DeleteAll(); end; local procedure ProcessesAreRunning(): Boolean diff --git a/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al b/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al index 9367fffc4b..0e9824e113 100644 --- a/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al +++ b/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al @@ -747,6 +747,10 @@ page 4050 "GP Migration Configuration" end; trigger OnOpenPage() + var + IntelligentCloudSetup: Record "Intelligent Cloud Setup"; + HybridGPWizard: Codeunit "Hybrid GP Wizard"; + MigrationValidation: Codeunit "Migration Validation"; begin if not Rec.Get() then Rec.Insert(true); @@ -759,6 +763,10 @@ page 4050 "GP Migration Configuration" Rec."Migrate Hist. AP Trx." and Rec."Migrate Hist. Inv. Trx." and Rec."Migrate Hist. Purch. Trx."; + + if IntelligentCloudSetup.Get() then + if IntelligentCloudSetup."Product ID" = HybridGPWizard.ProductId() then + MigrationValidation.PrepareValidation(); end; local procedure EnsureSettingsForAllCompanies() diff --git a/Apps/W1/HybridGP/app/src/pages/GPUpgradeSettings.Page.al b/Apps/W1/HybridGP/app/src/pages/GPUpgradeSettings.Page.al index 499c2bbc52..685317049b 100644 --- a/Apps/W1/HybridGP/app/src/pages/GPUpgradeSettings.Page.al +++ b/Apps/W1/HybridGP/app/src/pages/GPUpgradeSettings.Page.al @@ -1,4 +1,5 @@ namespace Microsoft.DataMigration.GP; +using Microsoft.DataMigration; page 40043 "GP Upgrade Settings" { @@ -12,6 +13,43 @@ page 40043 "GP Upgrade Settings" { area(Content) { + group(AutomaticValidation) + { + Caption = 'Automatic Validation'; + + field(GPAutomaticValidation; GPAutoValidation) + { + ApplicationArea = All; + Caption = 'GP'; + ToolTip = 'Specifies whether automatic validation is enabled for the primary GP migration.'; + + trigger OnValidate() + begin + if not GPAutoValidation then + GPValidationErrorsShouldFailMigration := false; + + UpdateValidatorConfig(); + end; + } + } + group(ValidationErrorHandling) + { + Caption = 'Validation Errors Should Fail Migration'; + + field(GPValidationErrorHandling; GPValidationErrorsShouldFailMigration) + { + ApplicationArea = All; + Caption = 'GP'; + ToolTip = 'Specifies whether GP validation errors should fail the migration. Only applies when automatic validation is enabled.'; + + trigger OnValidate() + begin + GPAutoValidation := GPValidationErrorsShouldFailMigration; + UpdateValidatorConfig(); + end; + } + } + group(ErrorHandling) { Caption = 'Error Handling'; @@ -49,7 +87,31 @@ page 40043 "GP Upgrade Settings" } trigger OnOpenPage() + var + ValidationSuite: Record "Validation Suite"; + GPMigrtionValidator: Codeunit "GP Migration Validator"; begin + if ValidationSuite.Get(GPMigrtionValidator.GetValidationSuiteId()) then begin + GPAutoValidation := ValidationSuite.Automatic; + GPValidationErrorsShouldFailMigration := ValidationSuite."Errors should fail migration"; + end; + Rec.GetonInsertGPUpgradeSettings(Rec); end; + + local procedure UpdateValidatorConfig() + var + ValidationSuite: Record "Validation Suite"; + GPMigrtionValidator: Codeunit "GP Migration Validator"; + begin + if ValidationSuite.Get(GPMigrtionValidator.GetValidationSuiteId()) then begin + ValidationSuite.Validate(Automatic, GPAutoValidation); + ValidationSuite.Validate("Errors should fail migration", GPValidationErrorsShouldFailMigration); + ValidationSuite.Modify(true); + end; + end; + + var + GPAutoValidation: Boolean; + GPValidationErrorsShouldFailMigration: Boolean; } \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al b/Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al index df505e1037..e131808f24 100644 --- a/Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al +++ b/Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al @@ -94,7 +94,10 @@ page 40125 "Hybrid GP Overview Fb" HelperFunctions: Codeunit "Helper Functions"; TotalGLBatchCount: Integer; TotalStatisticalBatchCount: Integer; + TotalBankBatchCount: Integer; + TotalCustomerBatchCount: Integer; TotalItemBatchCount: Integer; + TotalVendorBatchCount: Integer; CompanyHasFailedBatches: Boolean; FailedBatchMsgBuilder: TextBuilder; AddComma: Boolean; @@ -113,9 +116,12 @@ page 40125 "Hybrid GP Overview Fb" repeat TotalGLBatchCount := 0; TotalStatisticalBatchCount := 0; + TotalBankBatchCount := 0; + TotalCustomerBatchCount := 0; TotalItemBatchCount := 0; + TotalVendorBatchCount := 0; - HelperFunctions.GetUnpostedBatchCountForCompany(HybridCompanyStatus.Name, TotalGLBatchCount, TotalStatisticalBatchCount, TotalItemBatchCount); + HelperFunctions.GetUnpostedBatchCountForCompany(HybridCompanyStatus.Name, TotalGLBatchCount, TotalStatisticalBatchCount, TotalBankBatchCount, TotalCustomerBatchCount, TotalItemBatchCount, TotalVendorBatchCount); FailedBatchCount := FailedBatchCount + TotalGLBatchCount + TotalStatisticalBatchCount + TotalItemBatchCount; CompanyHasFailedBatches := (TotalGLBatchCount > 0) or (TotalItemBatchCount > 0); if CompanyHasFailedBatches then begin diff --git a/Apps/W1/HybridGP/app/src/tables/GPPOValidationBuffer.Table.al b/Apps/W1/HybridGP/app/src/tables/GPPOValidationBuffer.Table.al new file mode 100644 index 0000000000..9723fc8815 --- /dev/null +++ b/Apps/W1/HybridGP/app/src/tables/GPPOValidationBuffer.Table.al @@ -0,0 +1,112 @@ +namespace Microsoft.DataMigration.GP; + +table 41010 "GP PO Validation Buffer" +{ + Caption = 'GP PO Validation Buffer'; + DataClassification = CustomerContent; + TableType = Temporary; + Access = Internal; + + fields + { + field(1; "No."; Text[100]) + { + Caption = 'No.'; + NotBlank = true; + } + field(2; "Parent No."; Text[100]) + { + Caption = 'Parent No.'; + } + field(3; "Text 1"; Text[2048]) + { + Caption = 'Text 1'; + } + field(4; "Text 2"; Text[2048]) + { + Caption = 'Text 2'; + } + field(5; "Text 3"; Text[2048]) + { + Caption = 'Text 3'; + } + field(6; "Text 4"; Text[2048]) + { + Caption = 'Text 4'; + } + field(7; "Integer 1"; Integer) + { + Caption = 'Integer 1'; + } + field(8; "Integer 2"; Integer) + { + Caption = 'Integer 2'; + } + field(9; "Integer 3"; Integer) + { + Caption = 'Integer 3'; + } + field(10; "Integer 4"; Integer) + { + Caption = 'Integer 4'; + } + field(11; "Boolean 1"; Boolean) + { + Caption = 'Boolean 1'; + } + field(12; "Boolean 2"; Boolean) + { + Caption = 'Boolean 2'; + } + field(13; "Boolean 3"; Boolean) + { + Caption = 'Boolean 3'; + } + field(14; "Boolean 4"; Boolean) + { + Caption = 'Boolean 4'; + } + field(15; "Decimal 1"; Decimal) + { + Caption = 'Decimal 1'; + } + field(16; "Decimal 2"; Decimal) + { + Caption = 'Decimal 2'; + } + field(17; "Decimal 3"; Decimal) + { + Caption = 'Decimal 3'; + } + field(18; "Decimal 4"; Decimal) + { + Caption = 'Decimal 4'; + } + field(19; "Date 1"; Date) + { + Caption = 'Date 1'; + } + field(20; "Date 2"; Date) + { + Caption = 'Date 2'; + } + field(21; "Date 3"; Date) + { + Caption = 'Date 3'; + } + field(22; "Date 4"; Date) + { + Caption = 'Date 4'; + } + } + keys + { + key(PK; "No.") + { + Clustered = true; + } + key(Key2; "Parent No.") + { + } + } +} \ No newline at end of file diff --git a/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Page.al b/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Page.al index d21265f705..a1dd66bf5d 100644 --- a/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Page.al +++ b/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Page.al @@ -24,15 +24,6 @@ page 4810 "Intrastat Report Setup" field("Report Shipments"; Rec."Report Shipments") { } field("Include Drop Shipment"; Rec."Include Drop Shipment") { } field("Shipments Based On"; Rec."Shipments Based On") { } -#if not CLEAN26 - field("VAT No. Based On"; Rec."VAT No. Based On") - { - Visible = false; - ObsoleteReason = 'Use "Sales VAT No. Based On" and "Purchase VAT No. Based On" fields instead.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - } -#endif field("Sales VAT No. Based On"; Rec."Sales VAT No. Based On") { } field("Purchase VAT No. Based On"; Rec."Purchase VAT No. Based On") { } field("Project VAT No. Based On"; Rec."Project VAT No. Based On") { } diff --git a/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Table.al b/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Table.al index 828148c2fe..72e8c2c4f8 100644 --- a/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Table.al +++ b/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetup.Table.al @@ -154,13 +154,8 @@ table 4810 "Intrastat Report Setup" Caption = 'VAT Reg. No. Based On'; ToolTip = 'Specifies based on which customer/vendor code VAT number is taken for the Intrastat report.'; ObsoleteReason = 'Use "Sales VAT No. Based On" and "Purchase VAT No. Based On" fields instead.'; -#if CLEAN26 ObsoleteState = Removed; ObsoleteTag = '29.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '26.0'; -#endif } #endif field(25; "Def. Private Person VAT No."; Text[50]) @@ -284,30 +279,6 @@ table 4810 "Intrastat Report Setup" end; end; -#if not CLEAN26 - [Obsolete('Pending removal.', '26.0')] - procedure GetPartnerNo(SellTo: Code[20]; BillTo: Code[20]; VATNoBasedToCheck: Enum "Intrastat Report VAT No. Base") PartnerNo: Code[20] - begin - GetSetup(); - if VATNoBasedToCheck <> "VAT No. Based On" then - exit(''); -#pragma warning disable AL0432 - exit(GetPartnerNo(SellTo, BillTo)); -#pragma warning restore AL0432 - end; - - [Obsolete('Pending removal.', '26.0')] - procedure GetPartnerNo(SellTo: Code[20]; BillTo: Code[20]) PartnerNo: Code[20] - begin - GetSetup(); - case "VAT No. Based On" of - "VAT No. Based On"::"Sell-to VAT": - PartnerNo := SellTo; - "VAT No. Based On"::"Bill-to VAT": - PartnerNo := BillTo; - end; - end; -#endif procedure GetSetup() begin if not SetupRead then begin diff --git a/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetupWizard.Page.al b/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetupWizard.Page.al index 28ebdc4ccb..179090c4f1 100644 --- a/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetupWizard.Page.al +++ b/Apps/W1/Intrastat/app/src/Setup/IntrastatReportSetupWizard.Page.al @@ -83,15 +83,6 @@ page 4815 "Intrastat Report Setup Wizard" Editable = true; } field("Shipments Based On"; Rec."Shipments Based On") { } -#if not CLEAN26 - field("VAT No. Based On"; Rec."VAT No. Based On") - { - Visible = false; - ObsoleteReason = 'Use "Sales VAT No. Based On" and "Purchase VAT No. Based On" fields instead.'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - } -#endif field("Sales VAT No. Based On"; Rec."Sales VAT No. Based On") { } field("Purchase VAT No. Based On"; Rec."Purchase VAT No. Based On") { } field("Project VAT No. Based On"; Rec."Project VAT No. Based On") { } diff --git a/Apps/W1/LatePaymentPredictor/app/src/LPMachineLearningSetup.Page.al b/Apps/W1/LatePaymentPredictor/app/src/LPMachineLearningSetup.Page.al index ef80e11b58..2b54488ec8 100644 --- a/Apps/W1/LatePaymentPredictor/app/src/LPMachineLearningSetup.Page.al +++ b/Apps/W1/LatePaymentPredictor/app/src/LPMachineLearningSetup.Page.al @@ -244,26 +244,6 @@ page 1950 "LP Machine Learning Setup" LPModelManagement.InvokeShowModelFromUi(); end; } -#if not CLEAN26 - action("Open Azure AI Gallery") - { - ApplicationArea = Basic, Suite; - Caption = 'Open Azure AI Gallery'; - Gesture = None; - Image = LinkWeb; - ObsoleteReason = 'Webpage does not exist'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - Promoted = true; - ToolTip = 'Explore models for Azure Machine Learning, and use Azure Machine Learning Studio to build, test, and deploy the Prediction Model for Microsoft Dynamics 365.'; - Visible = false; - - trigger OnAction() - begin - Hyperlink('https://go.microsoft.com/fwlink/?linkid=2034407'); - end; - } -#endif } } diff --git a/Apps/W1/SalesAndInventoryForecast/app/src/pages/SalesForecastSetupCard.Page.al b/Apps/W1/SalesAndInventoryForecast/app/src/pages/SalesForecastSetupCard.Page.al index 51e4588fc6..c4cd0a1131 100644 --- a/Apps/W1/SalesAndInventoryForecast/app/src/pages/SalesForecastSetupCard.Page.al +++ b/Apps/W1/SalesAndInventoryForecast/app/src/pages/SalesForecastSetupCard.Page.al @@ -185,28 +185,6 @@ page 1853 "Sales Forecast Setup Card" Message(UpdatingForecastsMsg); end; } -#if not CLEAN26 - action("Open Cortana Intelligence Gallery") - { - ApplicationArea = Basic, Suite; - Caption = 'Open Azure AI Gallery'; - Gesture = None; - Image = LinkWeb; - ObsoleteReason = 'Webpage does not exist'; - ObsoleteState = Pending; - ObsoleteTag = '26.0'; - Promoted = true; - PromotedOnly = true; - PromotedCategory = Process; - ToolTip = 'Explore models for Azure Machine Learning, and use Azure Machine Learning Studio to build, test, and deploy the Forecasting Model for Microsoft Dynamics 365.'; - Visible = false; - - trigger OnAction() - begin - Hyperlink('https://go.microsoft.com/fwlink/?linkid=828352'); - end; - } -#endif } } diff --git a/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al b/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al index 5c5a2e84c6..0899328a9e 100644 --- a/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al +++ b/Apps/W1/Sustainability/test/src/SustValueEntryTest.Codeunit.al @@ -639,127 +639,6 @@ codeunit 148190 "Sust. Value Entry Test" StrSubstNo(ValueMustBeEqualErr, PurchaseLine.FieldCaption("Posted Emission N2O"), EmissionN2O, PurchaseLine.TableCaption())); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('PurchaseOrderStatisticsPageHandler')] - procedure VerifySustainabilityFieldsInPurchaseOrderStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - EmissionCO2: Decimal; - EmissionCH4: Decimal; - EmissionN2O: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - begin - // [SCENARIO 541865] Verify Sustainability Fields in Purchase Order Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Update "Enable Value Chain Tracking" in Sustainability Setup. - LibrarySustainability.UpdateValueChainTrackingInSustainabilitySetup(true); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Generate Emission. - EmissionCO2 := LibraryRandom.RandIntInRange(100, 100); - EmissionCH4 := LibraryRandom.RandIntInRange(200, 200); - EmissionN2O := LibraryRandom.RandIntInRange(300, 300); - - // [GIVEN] Create a Purchase Header. - LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); - - // [GIVEN] Create a Purchase Line. - LibraryPurchase.CreatePurchaseLine( - PurchaseLine, - PurchaseHeader, - "Purchase Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update Sustainability Account No.,Emission CO2 ,Emission CH4 ,Emission N2O. - PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 100)); - PurchaseLine.Validate("Qty. to Receive", LibraryRandom.RandIntInRange(5, 5)); - PurchaseLine.Validate("Sust. Account No.", AccountCode); - PurchaseLine.Validate("Emission CO2", EmissionCO2); - PurchaseLine.Validate("Emission CH4", EmissionCH4); - PurchaseLine.Validate("Emission N2O", EmissionN2O); - PurchaseLine.Modify(); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Order Statistics" before posting of Purchase order. - OpenPurchaseOrderStatistics(PurchaseHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Post a Purchase Document with Receiving. - LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Order Statistics" after partially posting of Purchase order with only Receiving. - OpenPurchaseOrderStatistics(PurchaseHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Post a Purchase Document with Invoicing. - LibraryPurchase.PostPurchaseDocument(PurchaseHeader, false, true); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission CO2 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5)); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission CH4 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5)); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission N2O Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5)); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Order Statistics" after partially posting of Purchase order with only Invoicing. - OpenPurchaseOrderStatistics(PurchaseHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Update "Qty. to Receive" in Purchase line. - PurchaseHeader.Validate("Vendor Invoice No.", LibraryUtility.GenerateGUID()); - PurchaseHeader.Modify(); - - // [GIVEN] Update "Qty. to Receive" in Purchase line. - PurchaseLine.Get(PurchaseLine."Document Type", PurchaseLine."Document No.", PurchaseLine."Line No."); - PurchaseLine.Validate("Qty. to Receive", LibraryRandom.RandIntInRange(2, 2)); - PurchaseLine.Modify(); - - // [GIVEN] Post a Purchase Document with Receiving and Invoicing. - LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission CO2 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(7, 7)); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission CH4 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(7, 7)); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission N2O Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(7, 7)); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Order Statistics" after partially posting of Purchase order with Receiving and Invoicing. - OpenPurchaseOrderStatistics(PurchaseHeader."No."); - LibraryVariableStorage.Clear(); - end; -#pragma warning restore AL0432 -#endif - [Test] [HandlerFunctions('PurchOrderStatisticsPageHandler')] procedure VerifySustainabilityFieldsInPurchOrderStatistics() @@ -1642,104 +1521,6 @@ codeunit 148190 "Sust. Value Entry Test" StrSubstNo(ValueMustBeEqualErr, SalesLine.FieldCaption("Posted Total CO2e"), -TotalCO2e, SalesLine.TableCaption())); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [Test] - [HandlerFunctions('SalesOrderStatisticsPageHandler')] - procedure VerifySustainabilityFieldsInSalesOrderStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TotalCO2e: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - begin - // [SCENARIO 537481] Verify Sustainability Fields in Sales Order Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Update "Enable Value Chain Tracking" in Sustainability Setup. - LibrarySustainability.UpdateValueChainTrackingInSustainabilitySetup(true); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Generate "Total CO2e". - TotalCO2e := LibraryRandom.RandIntInRange(100, 100); - - // [GIVEN] Create a Sales Header. - LibrarySales.CreateSalesHeader(SalesHeader, "Sales Document Type"::Order, LibrarySales.CreateCustomerNo()); - - // [GIVEN] Create a Sales Line. - LibrarySales.CreateSalesLine( - SalesLine, - SalesHeader, - "Sales Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update "Unit Price", "Qty. to Ship", "Sustainability Account No.", "Total CO2e" in the Sales line. - SalesLine.Validate("Unit Price", LibraryRandom.RandIntInRange(10, 200)); - SalesLine.Validate("Qty. to Ship", LibraryRandom.RandIntInRange(5, 5)); - SalesLine.Validate("Sust. Account No.", AccountCode); - SalesLine.Validate("Total CO2e", TotalCO2e); - SalesLine.Modify(); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Sales Order Statistics" before posting of Sales order. - OpenSalesOrderStatistics(SalesHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Post a Sales Document with Shipping. - LibrarySales.PostSalesDocument(SalesHeader, true, false); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Sales Order Statistics" after partially posting of Sales order with only Shipping. - OpenSalesOrderStatistics(SalesHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Post a Sales Document with Invoicing. - LibrarySales.PostSalesDocument(SalesHeader, false, true); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(SalesLine."CO2e per Unit" * SalesLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5) * -1); - - // [VERIFY] Verify Sustainability fields in Page "Sales Order Statistics" after partially posting of Sales order with only Invoicing. - OpenSalesOrderStatistics(SalesHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Update "External Document No." in Sales line. - SalesHeader.Validate("External Document No.", LibraryUtility.GenerateGUID()); - SalesHeader.Modify(); - - // [GIVEN] Update "Qty. to Ship" in Sales line. - SalesLine.Get(SalesLine."Document Type", SalesLine."Document No.", SalesLine."Line No."); - SalesLine.Validate("Qty. to Ship", LibraryRandom.RandIntInRange(2, 2)); - SalesLine.Modify(); - - // [GIVEN] Post a Sales Document with Shipping and Invoicing. - LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(SalesLine."CO2e per Unit" * SalesLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(7, 7) * -1); - - // [VERIFY] Verify Sustainability fields in Page "Sales Order Statistics" after partially posting of Sales order with Shipping and Invoicing. - OpenSalesOrderStatistics(SalesHeader."No."); - LibraryVariableStorage.Clear(); - end; -#pragma warning restore AL0432 -#endif [Test] [HandlerFunctions('SalesOrderStatisticsPageHandlerNM')] procedure VerifySustainabilityFieldsInSalesOrderStatisticsNM() @@ -4442,18 +4223,6 @@ codeunit 148190 "Sust. Value Entry Test" CorrectPostedPurchInvoice.CancelPostedInvoice(PurchInvHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - local procedure OpenPurchaseOrderStatistics(No: Code[20]) - var - PurchaseOrder: TestPage "Purchase Order"; - begin - PurchaseOrder.OpenEdit(); - PurchaseOrder.FILTER.SetFilter("No.", No); - PurchaseOrder.Statistics.Invoke(); - end; -#endif - local procedure OpenPurchOrderStatistics(No: Code[20]) var PurchaseOrder: TestPage "Purchase Order"; @@ -4534,17 +4303,6 @@ codeunit 148190 "Sust. Value Entry Test" CorrectPostedSalesInvoice.CancelPostedInvoice(SalesInvoiceHeader); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - local procedure OpenSalesOrderStatistics(No: Code[20]) - var - SalesOrder: TestPage "Sales Order"; - begin - SalesOrder.OpenEdit(); - SalesOrder.FILTER.SetFilter("No.", No); - SalesOrder.Statistics.Invoke(); - end; -#endif local procedure OpenSalesOrderStatisticsNM(No: Code[20]) var SalesOrder: TestPage "Sales Order"; @@ -4948,35 +4706,6 @@ codeunit 148190 "Sust. Value Entry Test" PurchaseLine.Modify(); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [ModalPageHandler] - [Scope('OnPrem')] - procedure PurchaseOrderStatisticsPageHandler(var PurchaseOrderStatisticsPage: TestPage "Purchase Order Statistics") - var - EmissionCO2: Variant; - EmissionCH4: Variant; - EmissionN2O: Variant; - PostedEmissionCO2: Variant; - PostedEmissionCH4: Variant; - PostedEmissionN2O: Variant; - begin - LibraryVariableStorage.Dequeue(EmissionCO2); - LibraryVariableStorage.Dequeue(EmissionCH4); - LibraryVariableStorage.Dequeue(EmissionN2O); - LibraryVariableStorage.Dequeue(PostedEmissionCO2); - LibraryVariableStorage.Dequeue(PostedEmissionCH4); - LibraryVariableStorage.Dequeue(PostedEmissionN2O); - - PurchaseOrderStatisticsPage."Emission C02".AssertEquals(EmissionCO2); - PurchaseOrderStatisticsPage."Emission CH4".AssertEquals(EmissionCH4); - PurchaseOrderStatisticsPage."Emission N2O".AssertEquals(EmissionN2O); - PurchaseOrderStatisticsPage."Posted Emission C02".AssertEquals(PostedEmissionCO2); - PurchaseOrderStatisticsPage."Posted Emission CH4".AssertEquals(PostedEmissionCH4); - PurchaseOrderStatisticsPage."Posted Emission N2O".AssertEquals(PostedEmissionN2O); - end; -#endif - [PageHandler] [Scope('OnPrem')] procedure PurchOrderStatisticsPageHandler(var PurchaseOrderStatisticsPage: TestPage "Purchase Order Statistics") @@ -5075,22 +4804,6 @@ codeunit 148190 "Sust. Value Entry Test" Navigate."No. of Records".AssertEquals(''); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [ModalPageHandler] - [Scope('OnPrem')] - procedure SalesOrderStatisticsPageHandler(var SalesOrderStatisticsPage: TestPage "Sales Order Statistics") - var - TotalCO2e: Variant; - PostedTotalCO2e: Variant; - begin - LibraryVariableStorage.Dequeue(TotalCO2e); - LibraryVariableStorage.Dequeue(PostedTotalCO2e); - - SalesOrderStatisticsPage."Total CO2e".AssertEquals(TotalCO2e); - SalesOrderStatisticsPage."Posted Total CO2e".AssertEquals(PostedTotalCO2e); - end; -#endif [PageHandler] [Scope('OnPrem')] procedure SalesOrderStatisticsPageHandlerNM(var SalesOrderStatisticsPage: TestPage "Sales Order Statistics") diff --git a/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al b/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al index 0787693f40..22ab154241 100644 --- a/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al +++ b/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al @@ -809,85 +809,6 @@ codeunit 148184 "Sustainability Posting Test" StrSubstNo(ValueMustBeEqualErr, PurchaseLine.FieldCaption("Posted Emission N2O"), EmissionN2O, PurchaseLine.TableCaption())); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [Test] - [HandlerFunctions('PurchaseOrderStatisticsPageHandler')] - procedure VerifySustainabilityFieldsInPurchaseOrderStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - EmissionCO2: Decimal; - EmissionCH4: Decimal; - EmissionN2O: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - begin - // [SCENARIO 496561] Verify Sustainability Fields in Purchase Order Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Generate Emission. - EmissionCO2 := LibraryRandom.RandInt(20); - EmissionCH4 := LibraryRandom.RandInt(5); - EmissionN2O := LibraryRandom.RandInt(5); - - // [GIVEN] Create a Purchase Header. - LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); - - // [GIVEN] Create a Purchase Line. - LibraryPurchase.CreatePurchaseLine( - PurchaseLine, - PurchaseHeader, - "Purchase Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update Sustainability Account No.,Emission CO2 ,Emission CH4 ,Emission N2O. - PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); - PurchaseLine.Validate("Qty. to Receive", LibraryRandom.RandIntInRange(5, 5)); - PurchaseLine.Validate("Sust. Account No.", AccountCode); - PurchaseLine.Validate("Emission CO2", EmissionCO2); - PurchaseLine.Validate("Emission CH4", EmissionCH4); - PurchaseLine.Validate("Emission N2O", EmissionN2O); - PurchaseLine.Modify(); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Order Statistics" before posting of Purchase order. - OpenPurchaseOrderStatistics(PurchaseHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Post a Purchase Document. - LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission CO2 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5)); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission CH4 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5)); - LibraryVariableStorage.Enqueue(PurchaseLine."Emission N2O Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5)); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Order Statistics" after partially posting of Purchase order. - OpenPurchaseOrderStatistics(PurchaseHeader."No."); - LibraryVariableStorage.Clear(); - end; -#pragma warning restore AL0432 -#endif - [Test] [HandlerFunctions('PurchOrderStatisticsPageHandler')] procedure VerifySustainabilityFieldsInPurchOrderStatistics() @@ -962,69 +883,6 @@ codeunit 148184 "Sustainability Posting Test" LibraryVariableStorage.Clear(); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the PurchaseStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [Test] - [HandlerFunctions('PurchaseInvoiceStatisticsPageHandler')] - procedure VerifySustainabilityFieldsInPurchaseInvoiceStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - EmissionCO2: Decimal; - EmissionCH4: Decimal; - EmissionN2O: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - begin - // [SCENARIO 496561] Verify Sustainability Fields in Purchase Invoice Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Generate Emission. - EmissionCO2 := LibraryRandom.RandInt(20); - EmissionCH4 := LibraryRandom.RandInt(5); - EmissionN2O := LibraryRandom.RandInt(5); - - // [GIVEN] Create a Purchase Header. - LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Invoice, LibraryPurchase.CreateVendorNo()); - - // [GIVEN] Create a Purchase Line. - LibraryPurchase.CreatePurchaseLine( - PurchaseLine, - PurchaseHeader, - "Purchase Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update Sustainability Account No.,Emission CO2 ,Emission CH4 ,Emission N2O. - PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); - PurchaseLine.Validate("Sust. Account No.", AccountCode); - PurchaseLine.Validate("Emission CO2", EmissionCO2); - PurchaseLine.Validate("Emission CH4", EmissionCH4); - PurchaseLine.Validate("Emission N2O", EmissionN2O); - PurchaseLine.Modify(); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Invoice Statistics" before posting of Purchase Invoice. - OpenPurchaseInvoiceStatistics(PurchaseHeader."No."); - LibraryVariableStorage.Clear(); - end; -#pragma warning restore AL0432 -#endif - [Test] [HandlerFunctions('PurchInvoiceStatisticsPageHandler')] procedure VerifySustainabilityFieldsInPurchInvoiceStatistics() @@ -1141,90 +999,6 @@ codeunit 148184 "Sustainability Posting Test" LibraryVariableStorage.Clear(); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the PurchaseStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [Test] - [HandlerFunctions('PurchaseInvoiceStatisticsPageHandler,ConfirmHandler')] - procedure VerifySustainabilityFieldsInPurchaseCrMemoStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - EmissionCO2: Decimal; - EmissionCH4: Decimal; - EmissionN2O: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - CrMemoNo: Code[20]; - PostedCrMemoNo: Code[20]; - begin - // [SCENARIO 496561] Verify Sustainability fields in Posted Purchase Cr Memo Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Create a Purchase Header. - LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); - - // [GIVEN] Create a Purchase Line. - LibraryPurchase.CreatePurchaseLine( - PurchaseLine, - PurchaseHeader, - "Purchase Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update Sustainability Account No.,Emission CO2 ,Emission CH4 ,Emission N2O. - PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); - PurchaseLine.Validate("Qty. to Receive", LibraryRandom.RandIntInRange(5, 5)); - PurchaseLine.Validate("Sust. Account No.", AccountCode); - PurchaseLine.Validate("Emission CO2", LibraryRandom.RandInt(20)); - PurchaseLine.Validate("Emission CH4", LibraryRandom.RandInt(5)); - PurchaseLine.Validate("Emission N2O", LibraryRandom.RandInt(5)); - PurchaseLine.Modify(); - - // [GIVEN] Save Expected Emission. - EmissionCO2 := PurchaseLine."Emission CO2 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - EmissionCH4 := PurchaseLine."Emission CH4 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - EmissionN2O := PurchaseLine."Emission N2O Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - - // [GIVEN] Update Reason Code in Purchase Header. - UpdateReasonCodeinPurchaseHeader(PurchaseHeader); - - // [VERIFY] Verify Sustainability fields in Page "Purchase Cr Memo Statistics" before posting of Purchase Cr Memo. - CrMemoNo := CreateCorrectiveCreditMemoAndOpenPurchaseCrMemoStatistics(PurchaseHeader); - - // [GIVEN] Post Corrective Credit Memo. - PurchaseHeader.Get(PurchaseHeader."Document Type"::"Credit Memo", CrMemoNo); - PostedCrMemoNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); - - // [GIVEN] Clear Variable Storage. - LibraryVariableStorage.Clear(); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(-EmissionCO2); - LibraryVariableStorage.Enqueue(-EmissionCH4); - LibraryVariableStorage.Enqueue(-EmissionN2O); - - // [VERIFY] Verify Sustainability fields in Page "Posted Purchase Cr Memo Statistics" after posting of Purchase Cr Memo. - VerifyPostedPurchaseCrMemoStatistics(PostedCrMemoNo); - LibraryVariableStorage.Clear(); - end; -#pragma warning restore AL0432 -#endif - [Test] [HandlerFunctions('PurchInvoiceStatisticsPageHandler,ConfirmHandler')] procedure VerifySustainabilityFieldsInPurchCrMemoStatistics() @@ -1414,101 +1188,6 @@ codeunit 148184 "Sustainability Posting Test" PurchaseInvHeader.Navigate(); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the PurchaseStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [Test] - [HandlerFunctions('PurchaseInvoiceStatisticsPageHandler,ConfirmHandler')] - procedure VerifySustainabilityFieldsInPurchaseCrMemoSubFormPage() - var - SustainabilityAccount: Record "Sustainability Account"; - PurchaseHeader: Record "Purchase Header"; - PurchaseLine: Record "Purchase Line"; - PurchCrMemoSubformPage: TestPage "Purch. Cr. Memo Subform"; - PostedPurchCrMemoSubformPage: TestPage "Posted Purch. Cr. Memo Subform"; - EmissionCO2: Decimal; - EmissionCH4: Decimal; - EmissionN2O: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - CrMemoNo: Code[20]; - PostedCrMemoNo: Code[20]; - begin - // [SCENARIO 496561] Verify Sustainability fields in Purchase Cr Memo SubForm Page. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Create a Purchase Header. - LibraryPurchase.CreatePurchHeader(PurchaseHeader, "Purchase Document Type"::Order, LibraryPurchase.CreateVendorNo()); - - // [GIVEN] Create a Purchase Line. - LibraryPurchase.CreatePurchaseLine( - PurchaseLine, - PurchaseHeader, - "Purchase Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update Sustainability Account No.,Emission CO2 ,Emission CH4 ,Emission N2O. - PurchaseLine.Validate("Direct Unit Cost", LibraryRandom.RandIntInRange(10, 200)); - PurchaseLine.Validate("Qty. to Receive", LibraryRandom.RandIntInRange(5, 5)); - PurchaseLine.Validate("Sust. Account No.", AccountCode); - PurchaseLine.Validate("Emission CO2", LibraryRandom.RandInt(20)); - PurchaseLine.Validate("Emission CH4", LibraryRandom.RandInt(5)); - PurchaseLine.Validate("Emission N2O", LibraryRandom.RandInt(5)); - PurchaseLine.Modify(); - - // [GIVEN] Save Expected Emission. - EmissionCO2 := PurchaseLine."Emission CO2 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - EmissionCH4 := PurchaseLine."Emission CH4 Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - EmissionN2O := PurchaseLine."Emission N2O Per Unit" * PurchaseLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(EmissionCO2); - LibraryVariableStorage.Enqueue(EmissionCH4); - LibraryVariableStorage.Enqueue(EmissionN2O); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - LibraryVariableStorage.Enqueue(0); - - // [GIVEN] Update Reason Code in Purchase Header. - UpdateReasonCodeinPurchaseHeader(PurchaseHeader); - - // [WHEN] Create Corrective Credit Memo. - CrMemoNo := CreateCorrectiveCreditMemoAndOpenPurchaseCrMemoStatistics(PurchaseHeader); - - // [VERIFY] Verify Sustainability fields before posting of Corrective Credit Memo. - PurchCrMemoSubformPage.OpenEdit(); - PurchCrMemoSubformPage.Filter.SetFilter("Document No.", CrMemoNo); - PurchCrMemoSubformPage.Filter.SetFilter("No.", PurchaseLine."No."); - PurchCrMemoSubformPage."Sust. Account No.".AssertEquals(AccountCode); - PurchCrMemoSubformPage."Emission CH4".AssertEquals(EmissionCH4); - PurchCrMemoSubformPage."Emission CO2".AssertEquals(EmissionCO2); - PurchCrMemoSubformPage."Emission N2O".AssertEquals(EmissionN2O); - - // [GIVEN] Post Corrective Credit Memo. - PurchaseHeader.Get(PurchaseHeader."Document Type"::"Credit Memo", CrMemoNo); - PostedCrMemoNo := LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); - - // [GIVEN] Clear Variable Storage. - LibraryVariableStorage.Clear(); - - // [VERIFY] Verify Sustainability fields After posting of Corrective Credit Memo. - PostedPurchCrMemoSubformPage.OpenEdit(); - PostedPurchCrMemoSubformPage.Filter.SetFilter("Document No.", PostedCrMemoNo); - PostedPurchCrMemoSubformPage.Filter.SetFilter("No.", PurchaseLine."No."); - PostedPurchCrMemoSubformPage."Sust. Account No.".AssertEquals(AccountCode); - PostedPurchCrMemoSubformPage."Emission CH4".AssertEquals(EmissionCH4); - PostedPurchCrMemoSubformPage."Emission CO2".AssertEquals(EmissionCO2); - PostedPurchCrMemoSubformPage."Emission N2O".AssertEquals(EmissionN2O); - end; -#pragma warning restore AL0432 -#endif - [Test] [HandlerFunctions('PurchInvoiceStatisticsPageHandler,ConfirmHandler')] procedure VerifySustainabilityFieldsInPurchCrMemoSubFormPage() @@ -2711,119 +2390,6 @@ codeunit 148184 "Sustainability Posting Test" StrSubstNo(ValueMustBeEqualErr, SalesLine.FieldCaption("Posted Total CO2e"), TotalCO2e, SalesLine.TableCaption())); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [Test] - [HandlerFunctions('SalesOrderStatisticsPageHandler')] - procedure VerifySustainabilityFieldsInSalesOrderStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TotalCO2e: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - begin - // [SCENARIO 537481] Verify Sustainability Fields in Sales Order Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Generate "Total CO2e". - TotalCO2e := LibraryRandom.RandInt(20); - - // [GIVEN] Create a Sales Header. - LibrarySales.CreateSalesHeader(SalesHeader, "Sales Document Type"::Order, LibrarySales.CreateCustomerNo()); - - // [GIVEN] Create a Sales Line. - LibrarySales.CreateSalesLine( - SalesLine, - SalesHeader, - "Sales Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update "Unit Price", "Qty. to Ship", "Sustainability Account No.", "Total CO2e" in the Sales line. - SalesLine.Validate("Unit Price", LibraryRandom.RandIntInRange(10, 200)); - SalesLine.Validate("Qty. to Ship", LibraryRandom.RandIntInRange(5, 5)); - SalesLine.Validate("Sust. Account No.", AccountCode); - SalesLine.Validate("Total CO2e", TotalCO2e); - SalesLine.Modify(); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Sales Order Statistics" before posting of Sales order. - OpenSalesOrderStatistics(SalesHeader."No."); - LibraryVariableStorage.Clear(); - - // [GIVEN] Post a Sales Document. - LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(SalesLine."CO2e per Unit" * SalesLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5) * -1); - - // [VERIFY] Verify Sustainability fields in Page "Sales Order Statistics" after partially posting of Sales order. - OpenSalesOrderStatistics(SalesHeader."No."); - LibraryVariableStorage.Clear(); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [Test] - [HandlerFunctions('SalesInvoiceStatisticsPageHandler')] - procedure VerifySustainabilityFieldsInSalesInvoiceStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TotalCO2e: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - begin - // [SCENARIO 537481] Verify Sustainability Fields in Sales Invoice Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Generate "Total CO2e". - TotalCO2e := LibraryRandom.RandInt(20); - - // [GIVEN] Create a Sales Header. - LibrarySales.CreateSalesHeader(SalesHeader, "Sales Document Type"::Invoice, LibrarySales.CreateCustomerNo()); - - // [GIVEN] Create a Sales Line. - LibrarySales.CreateSalesLine( - SalesLine, - SalesHeader, - "Sales Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update "Unit Price", "Sustainability Account No.", "Total CO2e" in the Sales line. - SalesLine.Validate("Unit Price", LibraryRandom.RandIntInRange(10, 200)); - SalesLine.Validate("Sust. Account No.", AccountCode); - SalesLine.Validate("Total CO2e", TotalCO2e); - SalesLine.Modify(); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(0); - - // [VERIFY] Verify Sustainability fields in Page "Sales Invoice Statistics" before posting of Sales Invoice. - OpenSalesInvoiceStatistics(SalesHeader."No."); - LibraryVariableStorage.Clear(); - end; -#pragma warning restore AL0432 -#endif [Test] [HandlerFunctions('SalesOrderStatisticsPageHandlerNM')] procedure VerifySustainabilityFieldsInSalesOrderStatisticsNM() @@ -2941,68 +2507,10 @@ codeunit 148184 "Sustainability Posting Test" TotalCO2e: Decimal; CategoryCode: Code[20]; SubcategoryCode: Code[20]; - AccountCode: Code[20]; - PostedInvoiceNo: Code[20]; - begin - // [SCENARIO 537481] Verify Sustainability Fields in Posted Sales Invoice Statistics. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Update "Enable Value Chain Tracking" in Sustainability Setup. - LibrarySustainability.UpdateValueChainTrackingInSustainabilitySetup(true); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Generate "Total CO2e". - TotalCO2e := LibraryRandom.RandInt(20); - - // [GIVEN] Create a Sales Header. - LibrarySales.CreateSalesHeader(SalesHeader, "Sales Document Type"::Order, LibrarySales.CreateCustomerNo()); - - // [GIVEN] Create a Sales Line. - LibrarySales.CreateSalesLine( - SalesLine, - SalesHeader, - "Sales Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update "Unit Price", "Sustainability Account No.", "Total CO2e" in the Sales line. - SalesLine.Validate("Unit Price", LibraryRandom.RandIntInRange(10, 200)); - SalesLine.Validate("Sust. Account No.", AccountCode); - SalesLine.Validate("Total CO2e", TotalCO2e); - SalesLine.Modify(); - - // [GIVEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(-TotalCO2e); - - // [WHEN] Post Sales Document. - PostedInvoiceNo := LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [VERIFY] Verify Sustainability fields in Page "Posted Sales Invoice Statistics". - VerifyPostedSalesInvoiceStatistics(PostedInvoiceNo); - LibraryVariableStorage.Clear(); - end; - -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [Test] - [HandlerFunctions('SalesInvoiceStatisticsPageHandler,ConfirmHandler')] - procedure VerifySustainabilityFieldsInSalesCrMemoStatistics() - var - SustainabilityAccount: Record "Sustainability Account"; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - TotalCO2e: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - CrMemoNo: Code[20]; - PostedCrMemoNo: Code[20]; + AccountCode: Code[20]; + PostedInvoiceNo: Code[20]; begin - // [SCENARIO 537481] Verify Sustainability fields in Posted Sales Cr Memo Statistics. + // [SCENARIO 537481] Verify Sustainability Fields in Posted Sales Invoice Statistics. LibrarySustainability.CleanUpBeforeTesting(); // [GIVEN] Update "Enable Value Chain Tracking" in Sustainability Setup. @@ -3012,6 +2520,9 @@ codeunit 148184 "Sustainability Posting Test" CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); SustainabilityAccount.Get(AccountCode); + // [GIVEN] Generate "Total CO2e". + TotalCO2e := LibraryRandom.RandInt(20); + // [GIVEN] Create a Sales Header. LibrarySales.CreateSalesHeader(SalesHeader, "Sales Document Type"::Order, LibrarySales.CreateCustomerNo()); @@ -3023,42 +2534,23 @@ codeunit 148184 "Sustainability Posting Test" LibraryInventory.CreateItemNo(), LibraryRandom.RandIntInRange(10, 10)); - // [GIVEN] Update "Unit Price", "Qty. to Ship", "Sustainability Account No.", "Total CO2e" in the Sales line. + // [GIVEN] Update "Unit Price", "Sustainability Account No.", "Total CO2e" in the Sales line. SalesLine.Validate("Unit Price", LibraryRandom.RandIntInRange(10, 200)); - SalesLine.Validate("Qty. to Ship", LibraryRandom.RandIntInRange(5, 5)); SalesLine.Validate("Sust. Account No.", AccountCode); - SalesLine.Validate("Total CO2e", LibraryRandom.RandInt(20)); + SalesLine.Validate("Total CO2e", TotalCO2e); SalesLine.Modify(); - // [GIVEN] Save Expected "Total CO2e". - TotalCO2e := SalesLine."CO2e per Unit" * SalesLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(0); - - // [GIVEN] Update Reason Code in Sales Header. - UpdateReasonCodeinSalesHeader(SalesHeader); - - // [VERIFY] Verify Sustainability fields in Page "Sales Cr Memo Statistics" before posting of Sales Cr Memo. - CrMemoNo := CreateCorrectiveCreditMemoAndOpenSalesCrMemoStatistics(SalesHeader); - - // [GIVEN] Post Corrective Credit Memo. - SalesHeader.Get(SalesHeader."Document Type"::"Credit Memo", CrMemoNo); - PostedCrMemoNo := LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [GIVEN] Clear Variable Storage. - LibraryVariableStorage.Clear(); + // [GIVEN] Save Sustainability fields. + LibraryVariableStorage.Enqueue(-TotalCO2e); - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); + // [WHEN] Post Sales Document. + PostedInvoiceNo := LibrarySales.PostSalesDocument(SalesHeader, true, true); - // [VERIFY] Verify Sustainability fields in Page "Posted Sales Cr Memo Statistics" after posting of Sales Cr Memo. - VerifyPostedSalesCrMemoStatistics(PostedCrMemoNo); + // [VERIFY] Verify Sustainability fields in Page "Posted Sales Invoice Statistics". + VerifyPostedSalesInvoiceStatistics(PostedInvoiceNo); LibraryVariableStorage.Clear(); end; -#pragma warning restore AL0432 -#endif + [Test] [HandlerFunctions('SalesInvoiceSalesStatisticsPageHandler,ConfirmHandler')] procedure VerifySustainabilityFieldsInSalesCrMemoSalesStatistics() @@ -3233,86 +2725,6 @@ codeunit 148184 "Sustainability Posting Test" SalesInvoiceHeader.Navigate(); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [Test] - [HandlerFunctions('SalesInvoiceStatisticsPageHandler,ConfirmHandler')] - procedure VerifySustainabilityFieldsInSalesCrMemoSubFormPage() - var - SustainabilityAccount: Record "Sustainability Account"; - SalesHeader: Record "Sales Header"; - SalesLine: Record "Sales Line"; - SalesCrMemoSubformPage: TestPage "Sales Cr. Memo Subform"; - PostedSalesCrMemoSubformPage: TestPage "Posted Sales Cr. Memo Subform"; - TotalCO2e: Decimal; - CategoryCode: Code[20]; - SubcategoryCode: Code[20]; - AccountCode: Code[20]; - CrMemoNo: Code[20]; - PostedCrMemoNo: Code[20]; - begin - // [SCENARIO 537481] Verify Sustainability fields in Sales Cr Memo SubForm Page. - LibrarySustainability.CleanUpBeforeTesting(); - - // [GIVEN] Create a Sustainability Account. - CreateSustainabilityAccount(AccountCode, CategoryCode, SubcategoryCode, LibraryRandom.RandInt(10)); - SustainabilityAccount.Get(AccountCode); - - // [GIVEN] Create a Sales Header. - LibrarySales.CreateSalesHeader(SalesHeader, "Sales Document Type"::Order, LibrarySales.CreateCustomerNo()); - - // [GIVEN] Create a Sales Line. - LibrarySales.CreateSalesLine( - SalesLine, - SalesHeader, - "Sales Line Type"::Item, - LibraryInventory.CreateItemNo(), - LibraryRandom.RandIntInRange(10, 10)); - - // [GIVEN] Update "Unit Price", "Qty. to Ship", "Sustainability Account No.", "Total CO2e" in the Sales line. - SalesLine.Validate("Unit Price", LibraryRandom.RandIntInRange(10, 200)); - SalesLine.Validate("Qty. to Ship", LibraryRandom.RandIntInRange(5, 5)); - SalesLine.Validate("Sust. Account No.", AccountCode); - SalesLine.Validate("Total CO2e", LibraryRandom.RandInt(20)); - SalesLine.Modify(); - - // [GIVEN] Save Expected "Total CO2e". - TotalCO2e := SalesLine."CO2e per Unit" * SalesLine."Qty. per Unit of Measure" * LibraryRandom.RandIntInRange(5, 5); - - // [WHEN] Save Sustainability fields. - LibraryVariableStorage.Enqueue(TotalCO2e); - LibraryVariableStorage.Enqueue(0); - - // [GIVEN] Update Reason Code in Sales Header. - UpdateReasonCodeinSalesHeader(SalesHeader); - - // [WHEN] Create Corrective Credit Memo. - CrMemoNo := CreateCorrectiveCreditMemoAndOpenSalesCrMemoStatistics(SalesHeader); - - // [VERIFY] Verify Sustainability fields before posting of Corrective Credit Memo. - SalesCrMemoSubformPage.OpenEdit(); - SalesCrMemoSubformPage.Filter.SetFilter("Document No.", CrMemoNo); - SalesCrMemoSubformPage.Filter.SetFilter("No.", SalesLine."No."); - SalesCrMemoSubformPage."Sust. Account No.".AssertEquals(AccountCode); - SalesCrMemoSubformPage."Total CO2e".AssertEquals(TotalCO2e); - - // [GIVEN] Post Corrective Credit Memo. - SalesHeader.Get(SalesHeader."Document Type"::"Credit Memo", CrMemoNo); - PostedCrMemoNo := LibrarySales.PostSalesDocument(SalesHeader, true, true); - - // [GIVEN] Clear Variable Storage. - LibraryVariableStorage.Clear(); - - // [VERIFY] Verify Sustainability fields After posting of Corrective Credit Memo. - PostedSalesCrMemoSubformPage.OpenEdit(); - PostedSalesCrMemoSubformPage.Filter.SetFilter("Document No.", PostedCrMemoNo); - PostedSalesCrMemoSubformPage.Filter.SetFilter("No.", SalesLine."No."); - PostedSalesCrMemoSubformPage."Sust. Account No.".AssertEquals(AccountCode); - PostedSalesCrMemoSubformPage."Total CO2e".AssertEquals(TotalCO2e); - end; -#pragma warning restore AL0432 -#endif [Test] [HandlerFunctions('SalesInvoiceSalesStatisticsPageHandler,ConfirmHandler')] procedure VerifySustainabilityFieldsInSalesCrMemoSubFormPageSalesStatistics() @@ -6114,18 +5526,6 @@ codeunit 148184 "Sustainability Posting Test" LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - local procedure OpenPurchaseOrderStatistics(No: Code[20]) - var - PurchaseOrder: TestPage "Purchase Order"; - begin - PurchaseOrder.OpenEdit(); - PurchaseOrder.FILTER.SetFilter("No.", No); - PurchaseOrder.Statistics.Invoke(); - end; -#endif - local procedure OpenPurchOrderStatistics(No: Code[20]) var PurchaseOrder: TestPage "Purchase Order"; @@ -6135,18 +5535,6 @@ codeunit 148184 "Sustainability Posting Test" PurchaseOrder.PurchaseOrderStatistics.Invoke(); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - local procedure OpenPurchaseInvoiceStatistics(No: Code[20]) - var - PurchaseInvoice: TestPage "Purchase Invoice"; - begin - PurchaseInvoice.OpenEdit(); - PurchaseInvoice.FILTER.SetFilter("No.", No); - PurchaseInvoice.Statistics.Invoke(); - end; -#endif - local procedure OpenPurchInvoiceStatistics(No: Code[20]) var PurchaseInvoice: TestPage "Purchase Invoice"; @@ -6156,18 +5544,6 @@ codeunit 148184 "Sustainability Posting Test" PurchaseInvoice.PurchaseStatistics.Invoke(); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - local procedure OpenPurchaseCrMemoStatistics(No: Code[20]) - var - PurchaseCreditMemo: TestPage "Purchase Credit Memo"; - begin - PurchaseCreditMemo.OpenEdit(); - PurchaseCreditMemo.FILTER.SetFilter("No.", No); - PurchaseCreditMemo.Statistics.Invoke(); - end; -#endif - local procedure OpenPurchCrMemoStatistics(No: Code[20]) var PurchaseCreditMemo: TestPage "Purchase Credit Memo"; @@ -6213,31 +5589,6 @@ codeunit 148184 "Sustainability Posting Test" PostedPurchaseInvoiceStatisticsPage."Emission N2O".AssertEquals(PostedEmissionN2O); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the PurchaseStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - local procedure CreateCorrectiveCreditMemoAndOpenPurchaseCrMemoStatistics(PurchaseHeader: Record "Purchase Header"): Code[20] - var - PurchInvHeader: Record "Purch. Inv. Header"; - CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice"; - PostedDocNumber: Code[20]; - begin - PostedDocNumber := LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true); - PurchInvHeader.Get(PostedDocNumber); - - // Create Corrective Credit Memo. - CorrectPostedPurchInvoice.CreateCreditMemoCopyDocument(PurchInvHeader, PurchaseHeader); - PurchaseHeader.Validate("Vendor Cr. Memo No.", LibraryRandom.RandText(10)); - PurchaseHeader.Modify(); - - // Open Purchase Cr Memo Statistics. - OpenPurchaseCrMemoStatistics(PurchaseHeader."No."); - - exit(PurchaseHeader."No."); - end; -#pragma warning restore AL0432 -#endif - local procedure CreateCorrectiveCreditMemoAndOpenPurchCrMemoStatistics(PurchaseHeader: Record "Purchase Header"): Code[20] var PurchInvHeader: Record "Purch. Inv. Header"; @@ -6363,27 +5714,6 @@ codeunit 148184 "Sustainability Posting Test" LibrarySales.PostSalesDocument(SalesHeader, true, true); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - local procedure OpenSalesOrderStatistics(No: Code[20]) - var - SalesOrder: TestPage "Sales Order"; - begin - SalesOrder.OpenEdit(); - SalesOrder.FILTER.SetFilter("No.", No); - SalesOrder.Statistics.Invoke(); - end; - - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - local procedure OpenSalesInvoiceStatistics(No: Code[20]) - var - SalesInvoice: TestPage "Sales Invoice"; - begin - SalesInvoice.OpenEdit(); - SalesInvoice.FILTER.SetFilter("No.", No); - SalesInvoice.Statistics.Invoke(); - end; -#endif local procedure OpenSalesOrderStatisticsNM(No: Code[20]) var SalesOrder: TestPage "Sales Order"; @@ -6402,17 +5732,6 @@ codeunit 148184 "Sustainability Posting Test" SalesInvoice.SalesStatistics.Invoke(); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - local procedure OpenSalesCrMemoStatistics(No: Code[20]) - var - SalesCreditMemo: TestPage "Sales Credit Memo"; - begin - SalesCreditMemo.OpenEdit(); - SalesCreditMemo.FILTER.SetFilter("No.", No); - SalesCreditMemo.Statistics.Invoke(); - end; -#endif local procedure OpenSalesCrMemoSalesStatistics(No: Code[20]) var SalesCreditMemo: TestPage "Sales Credit Memo"; @@ -6446,28 +5765,6 @@ codeunit 148184 "Sustainability Posting Test" PostedSalesInvoiceStatisticsPage."Total CO2e".AssertEquals(PostedTotalCO2e); end; -#if not CLEAN26 -#pragma warning disable AL0432 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - local procedure CreateCorrectiveCreditMemoAndOpenSalesCrMemoStatistics(SalesHeader: Record "Sales Header"): Code[20] - var - SalesInvoiceHeader: Record "Sales Invoice Header"; - CorrectPostedSalesInvoice: Codeunit "Correct Posted Sales Invoice"; - PostedDocNumber: Code[20]; - begin - PostedDocNumber := LibrarySales.PostSalesDocument(SalesHeader, true, true); - SalesInvoiceHeader.Get(PostedDocNumber); - - // Create Corrective Credit Memo. - CorrectPostedSalesInvoice.CreateCreditMemoCopyDocument(SalesInvoiceHeader, SalesHeader); - - // Open Sales Cr Memo Statistics. - OpenSalesCrMemoStatistics(SalesHeader."No."); - - exit(SalesHeader."No."); - end; -#pragma warning restore AL0432 -#endif local procedure CreateCorrectiveCreditMemoAndOpenSalesCrMemoSalesStatistics(SalesHeader: Record "Sales Header"): Code[20] var SalesInvoiceHeader: Record "Sales Invoice Header"; @@ -6807,35 +6104,6 @@ codeunit 148184 "Sustainability Posting Test" LibrarySustainability.PostPositiveAdjustmentWithItemTracking(Item, '', AccountCode, '', Quantity, WorkDate(), '', LotNo[2], ExpectedCO2eOnLot[2]); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseOrderStatistics action. The new action uses RunObject and does not run the action trigger. Use a page extension to modify the behaviour.', '26.0')] - [ModalPageHandler] - [Scope('OnPrem')] - procedure PurchaseOrderStatisticsPageHandler(var PurchaseOrderStatisticsPage: TestPage "Purchase Order Statistics") - var - EmissionCO2: Variant; - EmissionCH4: Variant; - EmissionN2O: Variant; - PostedEmissionCO2: Variant; - PostedEmissionCH4: Variant; - PostedEmissionN2O: Variant; - begin - LibraryVariableStorage.Dequeue(EmissionCO2); - LibraryVariableStorage.Dequeue(EmissionCH4); - LibraryVariableStorage.Dequeue(EmissionN2O); - LibraryVariableStorage.Dequeue(PostedEmissionCO2); - LibraryVariableStorage.Dequeue(PostedEmissionCH4); - LibraryVariableStorage.Dequeue(PostedEmissionN2O); - - PurchaseOrderStatisticsPage."Emission C02".AssertEquals(EmissionCO2); - PurchaseOrderStatisticsPage."Emission CH4".AssertEquals(EmissionCH4); - PurchaseOrderStatisticsPage."Emission N2O".AssertEquals(EmissionN2O); - PurchaseOrderStatisticsPage."Posted Emission C02".AssertEquals(PostedEmissionCO2); - PurchaseOrderStatisticsPage."Posted Emission CH4".AssertEquals(PostedEmissionCH4); - PurchaseOrderStatisticsPage."Posted Emission N2O".AssertEquals(PostedEmissionN2O); - end; -#endif - [PageHandler] [Scope('OnPrem')] procedure PurchOrderStatisticsPageHandler(var PurchaseOrderStatisticsPage: TestPage "Purchase Order Statistics") @@ -6862,22 +6130,6 @@ codeunit 148184 "Sustainability Posting Test" PurchaseOrderStatisticsPage."Posted Emission N2O".AssertEquals(PostedEmissionN2O); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [ModalPageHandler] - [Scope('OnPrem')] - procedure SalesOrderStatisticsPageHandler(var SalesOrderStatisticsPage: TestPage "Sales Order Statistics") - var - TotalCO2e: Variant; - PostedTotalCO2e: Variant; - begin - LibraryVariableStorage.Dequeue(TotalCO2e); - LibraryVariableStorage.Dequeue(PostedTotalCO2e); - - SalesOrderStatisticsPage."Total CO2e".AssertEquals(TotalCO2e); - SalesOrderStatisticsPage."Posted Total CO2e".AssertEquals(PostedTotalCO2e); - end; -#endif [PageHandler] [Scope('OnPrem')] procedure SalesOrderStatisticsPageHandlerNM(var SalesOrderStatisticsPage: TestPage "Sales Order Statistics") @@ -6892,35 +6144,6 @@ codeunit 148184 "Sustainability Posting Test" SalesOrderStatisticsPage."Posted Total CO2e".AssertEquals(PostedTotalCO2e); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the PurchaseStatistics action. The new action uses RunObject and does not run the action trigger', '26.0')] - [ModalPageHandler] - [Scope('OnPrem')] - procedure PurchaseInvoiceStatisticsPageHandler(var PurchaseStatisticsPage: TestPage "Purchase Statistics") - var - EmissionCO2: Variant; - EmissionCH4: Variant; - EmissionN2O: Variant; - PostedEmissionCO2: Variant; - PostedEmissionCH4: Variant; - PostedEmissionN2O: Variant; - begin - LibraryVariableStorage.Dequeue(EmissionCO2); - LibraryVariableStorage.Dequeue(EmissionCH4); - LibraryVariableStorage.Dequeue(EmissionN2O); - LibraryVariableStorage.Dequeue(PostedEmissionCO2); - LibraryVariableStorage.Dequeue(PostedEmissionCH4); - LibraryVariableStorage.Dequeue(PostedEmissionN2O); - - PurchaseStatisticsPage."Emission C02".AssertEquals(EmissionCO2); - PurchaseStatisticsPage."Emission CH4".AssertEquals(EmissionCH4); - PurchaseStatisticsPage."Emission N2O".AssertEquals(EmissionN2O); - PurchaseStatisticsPage."Posted Emission C02".AssertEquals(PostedEmissionCO2); - PurchaseStatisticsPage."Posted Emission CH4".AssertEquals(PostedEmissionCH4); - PurchaseStatisticsPage."Posted Emission N2O".AssertEquals(PostedEmissionN2O); - end; -#endif - [PageHandler] [Scope('OnPrem')] procedure PurchInvoiceStatisticsPageHandler(var PurchaseStatisticsPage: TestPage "Purchase Statistics") @@ -6947,22 +6170,6 @@ codeunit 148184 "Sustainability Posting Test" PurchaseStatisticsPage."Posted Emission N2O".AssertEquals(PostedEmissionN2O); end; -#if not CLEAN26 - [Obsolete('The statistics action will be replaced with the SalesStatistics action. The new action uses RunObject and does not run the action trigger.', '26.0')] - [ModalPageHandler] - [Scope('OnPrem')] - procedure SalesInvoiceStatisticsPageHandler(var SalesStatisticsPage: TestPage "Sales Statistics") - var - TotalCO2e: Variant; - PostedTotalCO2e: Variant; - begin - LibraryVariableStorage.Dequeue(TotalCO2e); - LibraryVariableStorage.Dequeue(PostedTotalCO2e); - - SalesStatisticsPage."Total CO2e".AssertEquals(TotalCO2e); - SalesStatisticsPage."Posted Total CO2e".AssertEquals(PostedTotalCO2e); - end; -#endif [PageHandler] [Scope('OnPrem')] procedure SalesInvoiceSalesStatisticsPageHandler(var SalesStatisticsPage: TestPage "Sales Statistics")