From 1a13eb291e86b28deb5fa8176909287bd17869ea Mon Sep 17 00:00:00 2001 From: jaymckinney-enavate <99509805+jaymckinney-enavate@users.noreply.github.com> Date: Mon, 30 Sep 2024 05:46:06 -0400 Subject: [PATCH] GP Updates - September 2024 (#27265) This PR contains the following enhancements to the GP migrations. - Hide the Run Data Upgrade Now action when the One Step Migration is enabled. - Remove the dependency on Sales and Inventory Forecast app. - Obsolete the old GP pages around the staging table data. Fixes #26487 Fixes [AB#550763](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/550763) --------- Co-authored-by: jaymckinney --- .../Permissions/HybridGPEdit.PermissionSet.al | 4 + .../HybridGPObjects.PermissionSet.al | 29 +- .../Permissions/HybridGPRead.PermissionSet.al | 4 + .../INTELLIGENTCLOUDHGP.PermissionSetExt.al | 4 + .../d365basicHGP.permissionsetext.al | 4 + .../d365teammemberHGP.permissionsetext.al | 4 + Apps/W1/HybridGP/app/app.json | 6 - .../src/Migration/Accounts/GPAccount.page.al | 6 + .../Accounts/GPFiscalPeriods.page.al | 6 + .../Accounts/GPGLTransactions.page.al | 6 + .../Migration/Customers/GPCustomer.page.al | 6 + .../Customers/GPCustomerTransactions.page.al | 10 +- .../History/AI/GPForecastHandler.codeunit.al | 412 +-------------- .../History/AI/GPForecastTemp.table.al | 5 + .../app/src/Migration/Items/GPItem.page.al | 6 + .../Support/GPPostingAccounts.page.al | 8 +- .../src/Migration/Vendors/GPVendor.page.al | 8 +- .../Vendors/GPVendorMigrator.codeunit.al | 2 + .../Vendors/GPVendorTransactions.page.al | 9 +- .../IntelligentCloudExtension.PageExt.al | 10 + Apps/W1/HybridGP/test/app.json | 6 - .../test/src/GPForecastingTests.codeunit.al | 489 ------------------ .../test/src/GPRunAllTests.codeunit.al | 2 - 23 files changed, 118 insertions(+), 928 deletions(-) delete mode 100644 Apps/W1/HybridGP/test/src/GPForecastingTests.codeunit.al diff --git a/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al b/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al index 38fb304bda..13c6a94eb7 100644 --- a/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al +++ b/Apps/W1/HybridGP/app/Permissions/HybridGPEdit.PermissionSet.al @@ -49,7 +49,11 @@ 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, diff --git a/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al b/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al index 2dccb01473..35597fedaa 100644 --- a/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al +++ b/Apps/W1/HybridGP/app/Permissions/HybridGPObjects.PermissionSet.al @@ -10,17 +10,12 @@ permissionset 4029 "HybridGP - Objects" codeunit "Hybrid Handle GP Upgrade Error" = X, codeunit "Hybrid GP Management" = X, codeunit "Hybrid GP Wizard" = X, - page "GP Account" = X, table "GP Account" = X, codeunit "GP Account Migrator" = X, - page "GP Fiscal Periods" = X, table "GP Fiscal Periods" = X, - page "GP GLTransactions" = X, table "GP GLTransactions" = X, - page "GP Customer" = X, table "GP Customer" = X, codeunit "GP Customer Migrator" = X, - page "GP Customer Transactions" = X, table "GP Customer Transactions" = X, table "GPIVBinQtyTransferHist" = X, table "GPIVDistributionHist" = X, @@ -58,12 +53,9 @@ permissionset 4029 "HybridGP - Objects" table "GPSOPTrxHist" = X, table "GPSOPUserDefinedWorkHist" = X, table "GPSOPWorkflowWorkHist" = X, - codeunit "GPForecastHandler" = X, codeunit "GP PO Migrator" = X, codeunit "GP Populate Hist. Tables" = X, - table "GPForecastTemp" = X, codeunit "Install GP SmartLists" = X, - page "GP Item" = X, table "GP Item" = X, table "GP Item Location" = X, codeunit "GP Item Migrator" = X, @@ -74,7 +66,6 @@ permissionset 4029 "HybridGP - Objects" table "GP Codes" = X, table "GP Configuration" = X, table "GP Payment Terms" = X, - page "GP Posting Accounts" = X, table "GP Posting Accounts" = X, table "GP Segments" = X, Codeunit "Helper Functions" = X, @@ -83,10 +74,8 @@ permissionset 4029 "HybridGP - Objects" table "GP Checkbook MSTR" = X, table "GP Checkbook Transactions" = X, codeunit "GP Intelligent Cloud Upgrade" = X, - page "GP Vendor" = X, table "GP Vendor" = X, codeunit "GP Vendor Migrator" = X, - page "GP Vendor Transactions" = X, table "GP Vendor Transactions" = X, page "GP Migration Settings List" = X, page "Hybrid GP Errors Factbox" = X, @@ -141,7 +130,25 @@ permissionset 4029 "HybridGP - Objects" codeunit "GP Migration Error Handler" = X, page "GP Migration Error Overview" = X, #if not CLEAN24 +#pragma warning disable AL0432 page "Hybrid GP Errors Overview Fb" = X, +#pragma warning restore AL0432 +#endif + +#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, diff --git a/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al b/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al index 25dacac83e..752af413b3 100644 --- a/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al +++ b/Apps/W1/HybridGP/app/Permissions/HybridGPRead.PermissionSet.al @@ -49,7 +49,11 @@ 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, diff --git a/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al b/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al index 897601a3df..15d93df222 100644 --- a/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al +++ b/Apps/W1/HybridGP/app/Permissions/INTELLIGENTCLOUDHGP.PermissionSetExt.al @@ -8,7 +8,11 @@ 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, diff --git a/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al b/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al index 7563351e55..c5da03d269 100644 --- a/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al +++ b/Apps/W1/HybridGP/app/Permissions/d365basicHGP.permissionsetext.al @@ -8,7 +8,11 @@ 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, diff --git a/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al b/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al index 933135491d..f81da6258a 100644 --- a/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al +++ b/Apps/W1/HybridGP/app/Permissions/d365teammemberHGP.permissionsetext.al @@ -8,7 +8,11 @@ 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, diff --git a/Apps/W1/HybridGP/app/app.json b/Apps/W1/HybridGP/app/app.json index cefcc9cb04..e094eb830f 100644 --- a/Apps/W1/HybridGP/app/app.json +++ b/Apps/W1/HybridGP/app/app.json @@ -24,12 +24,6 @@ "publisher": "Microsoft", "version": "26.0.0.0" }, - { - "id": "c526b3e9-b8ca-4683-81ba-fcd5f6b1472a", - "name": "Sales and Inventory Forecast", - "publisher": "Microsoft", - "version": "26.0.0.0" - }, { "id": "ea130081-c669-460f-a5f4-5dde14f03131", "name": "Statistical Accounts", diff --git a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al b/Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al index fb314ec3ac..660ed43cac 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Accounts/GPAccount.page.al @@ -1,3 +1,4 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4090 "GP Account" @@ -8,6 +9,10 @@ page 4090 "GP Account" 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'; layout { @@ -74,3 +79,4 @@ page 4090 "GP Account" } } } +#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 index 605c05fd0b..8d0cff34a8 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPFiscalPeriods.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Accounts/GPFiscalPeriods.page.al @@ -1,3 +1,4 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4092 "GP Fiscal Periods" @@ -8,6 +9,10 @@ page 4092 "GP Fiscal Periods" 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'; layout { @@ -39,3 +44,4 @@ page 4092 "GP Fiscal Periods" } } } +#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 index 009878dc09..7d3ead951d 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Accounts/GPGLTransactions.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Accounts/GPGLTransactions.page.al @@ -1,3 +1,4 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4091 "GP GLTransactions" @@ -5,6 +6,10 @@ 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'; layout { @@ -115,3 +120,4 @@ page 4091 "GP GLTransactions" } } } +#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 index c3e17d0245..5d7d16a2e1 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomer.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomer.page.al @@ -1,3 +1,4 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4093 "GP Customer" @@ -8,6 +9,10 @@ page 4093 "GP Customer" 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'; layout { @@ -130,3 +135,4 @@ page 4093 "GP Customer" } } } +#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 index d677039045..70f427f9f7 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerTransactions.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerTransactions.page.al @@ -1,13 +1,16 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4094 "GP Customer Transactions" { Caption = 'GP Customer Transactions'; - AdditionalSearchTerms = 'staging'; PageType = List; SourceTable = "GP Customer Transactions"; ApplicationArea = All; - UsageCategory = Lists; + UsageCategory = None; + ObsoleteState = Pending; + ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; + ObsoleteTag = '26.0'; layout { @@ -97,4 +100,5 @@ page 4094 "GP Customer Transactions" } } } -} \ No newline at end of file +} +#endif \ No newline at end of file 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 index 6fa99bcb7e..e7c9788aec 100644 --- a/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastHandler.codeunit.al +++ b/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastHandler.codeunit.al @@ -1,413 +1,15 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; -using System.AI; -using System.Reflection; -using Microsoft.CashFlow.Forecast; -using Microsoft.CashFlow.Setup; -using Microsoft.Inventory.InventoryForecast; - codeunit 4034 "GPForecastHandler" { - trigger OnRun() - begin - - end; - - var - TempGPTimeSeriesBuffer: Record "Time Series Buffer" temporary; - TempGPForecastTemp: Record "GPForecastTemp" temporary; - CashFlowSetup: Record "Cash Flow Setup"; - MSSalesForecastSetup: Record "MS - Sales Forecast Setup"; - TimeSeriesManagement: Codeunit "Time Series Management"; - SalesForecastHandler: Codeunit "Sales Forecast Handler"; - GPStatus: Option " ","Missing API","Not enough historical data","Out of limit"; - TimeSeriesLibState: Option Uninitialized,Initialized,"Data Prepared",Done; - XINVOICETxt: Label 'INVOICE', Locked = true; - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Cash Flow Forecast Handler", 'OnAfterHasMinimumHistoricalData', '', true, true)] - local procedure OnAfterHasMinimumHistoricalData(var HasMinimumHistoryLoc: Boolean; var NumberOfPeriodsWithHistoryLoc: integer; PeriodType: Integer; ForecastStartDate: Date) - var - GPSOPTrxHist: Record GPSOPTrxHist; - GPRMOpen: Record GPRMOpen; - GPRMHist: Record GPRMHist; - GPPOPPOHist: Record GPPOPPOHist; - GPPMHist: Record GPPMHist; - NumberOfPeriodsWithHistory: Integer; - begin - if not Initialize() then - exit; - - GPSOPTrxHist.SetCurrentKey(DUEDATE); - GPSOPTrxHist.SetFilter(SOPTYPE, '%1', GPSOPTrxHist.SOPTYPE::Invoice); - GPRMOpen.SetCurrentKey(DUEDATE); - GPRMOpen.SetFilter(RMDTYPAL, '%1|%2', GPRMOpen.RMDTYPAL::"Sales/Invoices", GPRMOpen.RMDTYPAL::"Credit Memos"); - GPRMHist.SetCurrentKey(DUEDATE); - GPRMHist.SetFilter(RMDTYPAL, '%1|%2', GPRMHist.RMDTYPAL::"Sales/Invoices", GPRMHist.RMDTYPAL::"Credit Memos"); - GPPOPPOHist.SetCurrentKey(DUEDATE); - GPPMHist.SetCurrentKey(DUEDATE); - GPPMHist.SetFilter(DOCTYPE, '%1|%2', GPPMHist.DOCTYPE::Invoice, GPPMHist.DOCTYPE::"Credit Memo"); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistory, - GPSOPTrxHist, - GPSOPTrxHist.FieldNo(DUEDATE), - PeriodType, - ForecastStartDate); - ComparePeriods(NumberOfPeriodsWithHistoryLoc, NumberOfPeriodsWithHistory); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistory, - GPRMOpen, - GPRMOpen.FieldNo(DUEDATE), - PeriodType, - ForecastStartDate); - ComparePeriods(NumberOfPeriodsWithHistoryLoc, NumberOfPeriodsWithHistory); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistory, - GPRMHist, - GPRMHist.FieldNo(DUEDATE), - PeriodType, - ForecastStartDate); - ComparePeriods(NumberOfPeriodsWithHistoryLoc, NumberOfPeriodsWithHistory); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistory, - GPPOPPOHist, - GPPOPPOHist.FieldNo(DUEDATE), - PeriodType, - ForecastStartDate); - ComparePeriods(NumberOfPeriodsWithHistoryLoc, NumberOfPeriodsWithHistory); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistory, - GPPMHist, - GPPMHist.FieldNo(DUEDATE), - PeriodType, - ForecastStartDate); - ComparePeriods(NumberOfPeriodsWithHistoryLoc, NumberOfPeriodsWithHistory); - end; - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Cash Flow Forecast Handler", 'OnAfterPrepareSalesHistoryData', '', true, true)] - local procedure OnAfterPrepareSalesHistoryData(var TimeSeriesBuffer: Record "Time Series Buffer"; PeriodType: Integer; ForecastStartDate: Date; NumberOfPeriodsWithHistory: Integer) - var - TempTimeSeriesBuffer: Record "Time Series Buffer" temporary; - GPSOPTrxHist: Record GPSOPTrxHist; - GPRMOpen: Record GPRMOpen; - GPRMHist: Record GPRMHist; - begin - if not Initialize() then - exit; - - GPRMOpen.SetCurrentKey(DUEDATE); - GPRMOpen.SetFilter(RMDTYPAL, '%1|%2', GPRMOpen.RMDTYPAL::"Sales/Invoices", GPRMOpen.RMDTYPAL::"Credit Memos"); - AddToTempTable(GPRMOpen, GPRMOpen.FieldNo(DOCNUMBR), GPRMOpen.FieldNo(RMDTYPAL), GPRMOpen.FieldNo(DUEDATE), GPRMOpen.FieldNo(SLSAMNT)); - GPRMHist.SetCurrentKey(DUEDATE); - GPRMHist.SetFilter(RMDTYPAL, '%1|%2', GPRMHist.RMDTYPAL::"Sales/Invoices", GPRMHist.RMDTYPAL::"Credit Memos"); - AddToTempTable(GPRMHist, GPRMHist.FieldNo(DOCNUMBR), GPRMHist.FieldNo(RMDTYPAL), GPRMHist.FieldNo(DUEDATE), GPRMHist.FieldNo(SLSAMNT)); - - GPSOPTrxHist.SetCurrentKey(DUEDATE); - GPSOPTrxHist.SetFilter(SOPTYPE, '%1', GPSOPTrxHist.SOPTYPE::Invoice); - AddToTempTable(GPSOPTrxHist, GPSOPTrxHist.FieldNo(SOPNUMBE), GPSOPTrxHist.FieldNo(SOPTYPE), GPSOPTrxHist.FieldNo(DUEDATE), GPSOPTrxHist.FieldNo(DOCAMNT)); - - TempGPForecastTemp.Reset(); - TempGPForecastTemp.SetCurrentKey(DueDate); - PrepareData(TempTimeSeriesBuffer, - TempGPForecastTemp, - TempGPForecastTemp.FieldNo(DocType), - TempGPForecastTemp.FieldNo(DueDate), - TempGPForecastTemp.FieldNo(Amount), - Format(TempGPForecastTemp.DocType::Invoice), - Format(TempGPForecastTemp.DocType::"Credit Memo"), - PeriodType, - ForecastStartDate, - NumberOfPeriodsWithHistory); - - if TempTimeSeriesBuffer.FindSet() then - AppendRecords(TimeSeriesBuffer, TempTimeSeriesBuffer, XINVOICETxt); - TempTimeSeriesBuffer.DeleteAll(); - - TimeSeriesBuffer.Reset(); - end; - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Cash Flow Forecast Handler", 'OnAfterPreparePurchHistoryData', '', true, true)] - local procedure OnAfterPreparePurchHistoryData(var TimeSeriesBuffer: Record "Time Series Buffer"; PeriodType: Integer; ForecastStartDate: Date; NumberOfPeriodsWithHistory: Integer) - var - TempTimeSeriesBuffer: Record "Time Series Buffer" temporary; - GPPOPPOHist: Record GPPOPPOHist; - GPPMHist: Record GPPMHist; - begin - if not Initialize() then - exit; - - GPPMHist.SetCurrentKey(DUEDATE); - GPPMHist.SetFilter(DOCTYPE, '%1|%2', GPPMHist.DOCTYPE::Invoice, GPPMHist.DOCTYPE::"Credit Memo"); - AddToTempTable(GPPMHist, GPPMHist.FieldNo(DOCNUMBR), GPPMHist.FieldNo(DOCTYPE), GPPMHist.FieldNo(DUEDATE), GPPMHist.FieldNo(DOCAMNT)); - - GPPOPPOHist.SetCurrentKey(DUEDATE); - AddToTempTable(GPPOPPOHist, GPPOPPOHist.FieldNo(PONUMBER), GPPOPPOHist.FieldNo(POTYPE), GPPOPPOHist.FieldNo(DUEDATE), GPPOPPOHist.FieldNo(SUBTOTAL)); - - TempGPForecastTemp.SetCurrentKey(DueDate); - PrepareData(TempTimeSeriesBuffer, - TempGPForecastTemp, - TempGPForecastTemp.FieldNo(DocType), - TempGPForecastTemp.FieldNo(DueDate), - TempGPForecastTemp.FieldNo(Amount), - Format(TempGPForecastTemp.DocType::Invoice), - Format(TempGPForecastTemp.DocType::"Credit Memo"), - PeriodType, - ForecastStartDate, - NumberOfPeriodsWithHistory); - - if TempTimeSeriesBuffer.FindSet() then - AppendRecords(TimeSeriesBuffer, TempTimeSeriesBuffer, XINVOICETxt); - TempTimeSeriesBuffer.DeleteAll(); - - TimeSeriesBuffer.Reset(); - end; - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Forecast Handler", 'OnAfterPrepareSalesInvData', '', true, true)] - local procedure OnAfterPrepareSalesInvData(ItemNo: Code[20]; var TempTimeSeriesBuffer: Record "Time Series Buffer"; PeriodType: Integer; ForecastStartDate: Date; NumberOfPeriodsWithHistory: Integer; var Status: Option " ","Missing API","Not enough historical data","Out of limit"); - var - GPIVTrxAmountsHist: Record GPIVTrxAmountsHist; - begin - if not InitializeSI() then begin - Status := GPStatus; - exit; - end; - - GPIVTrxAmountsHist.SetCurrentKey(DOCTYPE, ITEMNMBR, DOCDATE, DOCNUMBR); - SetGPIVTrxAmountsHistFilters(GPIVTrxAmountsHist, ItemNo); - GPIVTrxAmountsHist.SetFilter(DOCDATE, '<=%1', WorkDate()); - - if not SalesForecastHandler.InitializeTimeseries(TimeSeriesManagement, MSSalesForecastSetup) then - exit; - - TimeSeriesManagement.SetMaximumHistoricalPeriods(MSSalesForecastSetup."Historical Periods"); - - PrepareSIData(TempGPTimeSeriesBuffer, - GPIVTrxAmountsHist, - GPIVTrxAmountsHist.FieldNo(ITEMNMBR), - GPIVTrxAmountsHist.FieldNo(DOCDATE), - GPIVTrxAmountsHist.FieldNo(TRXQTY), - MSSalesForecastSetup."Period Type", - ForecastStartDate, - NumberOfPeriodsWithHistory); - - TempGPTimeSeriesBuffer.SetRange("Group ID", ItemNo); - if TempGPTimeSeriesBuffer.FindSet() then - AppendSIRecords(TempTimeSeriesBuffer, TempGPTimeSeriesBuffer, ItemNo); - end; - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Forecast Handler", 'OnAfterHasMinimumSIHistData', '', true, true)] - local procedure OnAfterHasMinimumSIHistData(ItemNo: Code[20]; var HasMinimumHistoryLoc: boolean; var NumberOfPeriodsWithHistoryLoc: Integer; PeriodType: Integer; ForecastStartDate: Date; var Status: Option " ","Missing API","Not enough historical data","Out of limit") - var - GPIVTrxAmountsHist: Record GPIVTrxAmountsHist; - begin - if not InitializeSI() then begin - Status := GPStatus; - exit; - end; - - GPIVTrxAmountsHist.SetCurrentKey(DOCTYPE, ITEMNMBR, DOCDATE, DOCNUMBR); - SetGPIVTrxAmountsHistFilters(GPIVTrxAmountsHist, ItemNo); - GPIVTrxAmountsHist.SetFilter(DOCDATE, '<=%1', ForecastStartDate); - - //if not SalesForecastHandler.InitializeTimeseries(TimeSeriesManagement, MSSalesForecastSetup) then - // exit; - - TimeSeriesManagement.SetMaximumHistoricalPeriods(MSSalesForecastSetup."Historical Periods"); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistoryLoc, - GPIVTrxAmountsHist, - GPIVTrxAmountsHist.FieldNo(DOCDATE), - MSSalesForecastSetup."Period Type", - ForecastStartDate); - end; - - [EventSubscriber(ObjectType::Page, Page::"Sales Forecast", 'OnAfterHasMinimumSIHistData', '', true, true)] - local procedure OnAfterHasMinSIHistDataSF(ItemNo: Code[20]; var HasMinimumHistoryLoc: boolean; var NumberOfPeriodsWithHistoryLoc: Integer; PeriodType: Integer; ForecastStartDate: Date; var StatusType: Option " ","No columns due to high variance","Limited columns due to high variance","Forecast expired","Forecast period type changed","Not enough historical data","Zero Forecast","No Forecast available") - var - GPIVTrxAmountsHist: Record GPIVTrxAmountsHist; - begin - if not InitializeSI() then begin - StatusType := StatusType::" "; - exit; - end; - - GPIVTrxAmountsHist.SetCurrentKey(DOCTYPE, ITEMNMBR, DOCDATE, DOCNUMBR); - SetGPIVTrxAmountsHistFilters(GPIVTrxAmountsHist, ItemNo); - GPIVTrxAmountsHist.SetFilter(DOCDATE, '<=%1', ForecastStartDate); - - TimeSeriesManagement.SetMaximumHistoricalPeriods(MSSalesForecastSetup."Historical Periods"); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistoryLoc, - GPIVTrxAmountsHist, - GPIVTrxAmountsHist.FieldNo(DOCDATE), - MSSalesForecastSetup."Period Type", - ForecastStartDate); - end; - - [EventSubscriber(ObjectType::Page, Page::"Sales Forecast No Chart", 'OnAfterHasMinimumSIHistData', '', true, true)] - local procedure OnAfterHasMinSIHistDataSFNoC(ItemNo: Code[20]; var HasMinimumHistoryLoc: boolean; var NumberOfPeriodsWithHistoryLoc: Integer; PeriodType: Integer; ForecastStartDate: Date; var StatusType: Option " ","No columns due to high variance","Limited columns due to high variance","Forecast expired","Forecast period type changed","Not enough historical data","Zero Forecast","No Forecast available") - var - GPIVTrxAmountsHist: Record GPIVTrxAmountsHist; - begin - if not InitializeSI() then begin - StatusType := StatusType::" "; - exit; - end; - - GPIVTrxAmountsHist.SetCurrentKey(DOCTYPE, ITEMNMBR, DOCDATE, DOCNUMBR); - SetGPIVTrxAmountsHistFilters(GPIVTrxAmountsHist, ItemNo); - GPIVTrxAmountsHist.SetFilter(DOCDATE, '<=%1', ForecastStartDate); - - TimeSeriesManagement.SetMaximumHistoricalPeriods(MSSalesForecastSetup."Historical Periods"); - - HasMinimumHistoryLoc := TimeSeriesManagement.HasMinimumHistoricalData( - NumberOfPeriodsWithHistoryLoc, - GPIVTrxAmountsHist, - GPIVTrxAmountsHist.FieldNo(DOCDATE), - MSSalesForecastSetup."Period Type", - ForecastStartDate); - end; - - local procedure PrepareData(var TempTimeSeriesBuffer: Record "Time Series Buffer" temporary; RecordVariant: Variant; GroupIdFieldNo: Integer; DateFieldNo: Integer; ValueFieldNo: Integer; InvoiceOption: Text; CreditMemoOption: Text; PeriodType: Integer; ForecastStartDate: Date; NumberOfPeriodsWithHistory: Integer) - var - TempCreditMemoTimeSeriesBuffer: Record "Time Series Buffer" temporary; - begin - TimeSeriesManagement.PrepareData(RecordVariant, GroupIdFieldNo, DateFieldNo, ValueFieldNo, PeriodType, ForecastStartDate, NumberOfPeriodsWithHistory); - TimeSeriesManagement.GetPreparedData(TempTimeSeriesBuffer); - TempCreditMemoTimeSeriesBuffer.Copy(TempTimeSeriesBuffer, true); - TempCreditMemoTimeSeriesBuffer.SetRange("Group ID", CreditMemoOption); - - TempTimeSeriesBuffer.SetRange("Group ID", InvoiceOption); - - if TempTimeSeriesBuffer.FindSet() and TempCreditMemoTimeSeriesBuffer.FindSet() then - repeat - TempTimeSeriesBuffer.Value := TempTimeSeriesBuffer.Value - TempCreditMemoTimeSeriesBuffer.Value; - TempTimeSeriesBuffer.Modify(); - until (TempTimeSeriesBuffer.Next() = 0) and (TempCreditMemoTimeSeriesBuffer.Next() = 0); - end; - - local procedure AppendRecords(var TargetTimeSeriesBuffer: Record "Time Series Buffer"; var SourceTimeSeriesBuffer: Record "Time Series Buffer" temporary; GroupId: Text[50]) - begin - if SourceTimeSeriesBuffer.FindSet() then - repeat - if TargetTimeSeriesBuffer.Get(GroupId, SourceTimeSeriesBuffer."Period No.") then begin - TargetTimeSeriesBuffer.Validate(Value, (TargetTimeSeriesBuffer.Value + SourceTimeSeriesBuffer.Value)); - TargetTimeSeriesBuffer.Modify(); - end else begin - TargetTimeSeriesBuffer.Validate(Value, SourceTimeSeriesBuffer.Value); - TargetTimeSeriesBuffer.Validate("Period Start Date", SourceTimeSeriesBuffer."Period Start Date"); - TargetTimeSeriesBuffer.Validate("Period No.", SourceTimeSeriesBuffer."Period No."); - TargetTimeSeriesBuffer.Validate("Group ID", GroupId); - TargetTimeSeriesBuffer.Insert(); - end; - until SourceTimeSeriesBuffer.Next() = 0; - end; - - local procedure Initialize(): Boolean - begin - if not CashFlowSetup.Get() then - exit(false); - - if (TimeSeriesLibState = TimeSeriesLibState::Initialized) then - exit(true); - - TempGPTimeSeriesBuffer.DeleteAll(); - TempGPForecastTemp.DeleteAll(); - - exit(TimeSeriesManagement.InitializeFromCashFlowSetup(TimeSeriesLibState)); - end; - - local procedure ComparePeriods(var NumberOfPeriodsWithHistoryLoc: integer; NumberOfPeriodsWithHistory: integer) - begin - if NumberOfPeriodsWithHistory > NumberOfPeriodsWithHistoryLoc then - NumberOfPeriodsWithHistoryLoc := NumberOfPeriodsWithHistory; - end; - - local procedure PrepareSIData(var TempTimeSeriesBuffer: Record "Time Series Buffer"; - RecordVariant: Variant; - GroupIdFieldNo: Integer; - DateFieldNo: Integer; - ValueFieldNo: Integer; - PeriodType: Integer; - ForecastStartDate: Date; NumberOfPeriodsWithHistory: Integer) - begin - TimeSeriesManagement.PrepareData(RecordVariant, GroupIdFieldNo, DateFieldNo, ValueFieldNo, PeriodType, ForecastStartDate, NumberOfPeriodsWithHistory); - TimeSeriesManagement.GetPreparedData(TempTimeSeriesBuffer); - end; - - local procedure AppendSIRecords(var TargetTimeSeriesBuffer: Record "Time Series Buffer"; var SourceTimeSeriesBuffer: Record "Time Series Buffer" temporary; GroupId: Text[50]) - begin - if SourceTimeSeriesBuffer.FindSet() then - repeat - if TargetTimeSeriesBuffer.Get(GroupId, SourceTimeSeriesBuffer."Period No.") then begin - // Already exists, so must merge source and dest... - TargetTimeSeriesBuffer.Validate(Value, (TargetTimeSeriesBuffer.Value + SourceTimeSeriesBuffer.Value)); - TargetTimeSeriesBuffer.Modify(); - end else begin - TargetTimeSeriesBuffer.Validate("Group ID", GroupId); - TargetTimeSeriesBuffer.Validate("Period No.", SourceTimeSeriesBuffer."Period No."); - TargetTimeSeriesBuffer.Validate("Period Start Date", SourceTimeSeriesBuffer."Period Start Date"); - TargetTimeSeriesBuffer.Validate(Value, SourceTimeSeriesBuffer.Value); - TargetTimeSeriesBuffer.Insert(); - end; - until SourceTimeSeriesBuffer.Next() = 0; - end; - - local procedure InitializeSI(): Boolean - begin - Clear(GPStatus); - TempGPTimeSeriesBuffer.DeleteAll(); - MSSalesForecastSetup.GetSingleInstance(); - if MSSalesForecastSetup.URIOrKeyEmpty() then begin - GPStatus := GPStatus::"Missing API"; - exit(false); - end; - - exit(true); - end; + 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 - GPIVTrxAmountsHist.SetRange(DOCTYPE, GPIVTrxAmountsHist.DOCTYPE::Sale); - GPIVTrxAmountsHist.SetRange(ITEMNMBR, ItemNo); - end; - - local procedure AddToTempTable(RecordVariant: Variant; DocNumberFieldNo: Integer; DocTypeFieldNo: Integer; DateFieldNo: Integer; AmountFieldNo: Integer) - var - DataTypeManagement: Codeunit "Data Type Management"; - RecRef: RecordRef; - DocNumberFieldRef: FieldRef; - DocTypeFieldRef: FieldRef; - DateFieldRef: FieldRef; - AmountFieldRef: FieldRef; - begin - DataTypeManagement.GetRecordRef(RecordVariant, RecRef); - if RecRef.IsEmpty() then - exit; - - repeat - DocNumberFieldRef := RecRef.Field(DocNumberFieldNo); - DocTypeFieldRef := RecRef.Field(DocTypeFieldNo); - DateFieldRef := RecRef.Field(DateFieldNo); - AmountFieldRef := RecRef.Field(AmountFieldNo); - - TempGPForecastTemp.Init(); - TempGPForecastTemp.Validate(DocNumber, DocNumberFieldRef.Value()); - - if ((Format(DocTypeFieldRef.Value()) = Format(TempGPForecastTemp.DocType::"Credit Memo")) or (Format(DocTypeFieldRef.Value()) = Format(TempGPForecastTemp.DocType::"Credit Memos"))) then - TempGPForecastTemp.Validate(DocType, TempGPForecastTemp.DocType::"Credit Memo") - else - TempGPForecastTemp.Validate(DocType, TempGPForecastTemp.DocType::Invoice); - - TempGPForecastTemp.Validate(DueDate, DateFieldRef.Value()); - TempGPForecastTemp.Validate(Amount, AmountFieldRef.Value()); - if not TempGPForecastTemp.Insert() then; - until RecRef.Next() = 0; end; -} \ No newline at end of file +} +#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 index 7bca55ca1f..340b549a8e 100644 --- a/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastTemp.table.al +++ b/Apps/W1/HybridGP/app/src/Migration/History/AI/GPForecastTemp.table.al @@ -1,3 +1,4 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; #pragma warning disable AS0109 @@ -6,6 +7,9 @@ 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 { @@ -45,3 +49,4 @@ table 4031 "GPForecastTemp" } } #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 index 336958c9b7..728980a5e2 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Items/GPItem.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Items/GPItem.page.al @@ -1,3 +1,4 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4095 "GP Item" @@ -8,6 +9,10 @@ page 4095 "GP Item" 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'; layout { @@ -123,3 +128,4 @@ page 4095 "GP Item" } } } +#endif \ 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 index d255376501..bc2adb104a 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Support/GPPostingAccounts.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Support/GPPostingAccounts.page.al @@ -1,16 +1,19 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4026 "GP Posting Accounts" { Caption = 'GP Posting Accounts'; - AdditionalSearchTerms = 'staging'; PageType = Card; SourceTable = "GP Posting Accounts"; DeleteAllowed = false; InsertAllowed = false; PromotedActionCategories = 'Posting Accounts'; ApplicationArea = All; - UsageCategory = Administration; + UsageCategory = None; + ObsoleteState = Pending; + ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; + ObsoleteTag = '26.0'; layout { @@ -140,3 +143,4 @@ page 4026 "GP Posting Accounts" } } } +#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al index d18d73e850..a01dd2eae7 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendor.page.al @@ -1,3 +1,4 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4096 "GP Vendor" @@ -8,6 +9,10 @@ page 4096 "GP Vendor" 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'; layout { @@ -124,4 +129,5 @@ page 4096 "GP Vendor" } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al index e4c313d14b..abb0c0f8a4 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al +++ b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al @@ -372,7 +372,9 @@ codeunit 4022 "GP Vendor Migrator" VendorDataMigrationFacade.SetGenBusPostingGroup(CopyStr(PostingGroupCodeTxt, 1, MaxStrLen(GenBusinessPostingGroup."Code"))); end; +#pragma warning disable AL0432 VendorDataMigrationFacade.SetHomePage(COPYSTR(GPVendor.INET2, 1, MaxStrLen(Vendor."Home Page"))); +#pragma warning restore AL0432 GPPM00200.SetLoadFields(VADDCDPR); if GPPM00200.Get(VendorNo) then diff --git a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al index d8236859b3..0f0068de5c 100644 --- a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al +++ b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorTransactions.page.al @@ -1,13 +1,16 @@ +#if not CLEAN26 namespace Microsoft.DataMigration.GP; page 4097 "GP Vendor Transactions" { Caption = 'GP Vendor Transactions'; - AdditionalSearchTerms = 'staging'; PageType = List; SourceTable = "GP Vendor Transactions"; ApplicationArea = All; - UsageCategory = Lists; + UsageCategory = None; + ObsoleteState = Pending; + ObsoleteReason = 'Removing the GP staging table pages because they cause confusion and should not be used.'; + ObsoleteTag = '26.0'; layout { @@ -93,4 +96,4 @@ page 4097 "GP Vendor Transactions" } } } - +#endif \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al b/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al index 383a60f2ec..7eb042c1ca 100644 --- a/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al +++ b/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al @@ -41,6 +41,11 @@ pageextension 4015 "Intelligent Cloud Extension" extends "Intelligent Cloud Mana actions { + modify(RunDataUpgrade) + { + Visible = UseTwoStepProcess; + } + addafter(RunReplicationNow) { action(ConfigureGPMigration) @@ -104,6 +109,7 @@ pageextension 4015 "Intelligent Cloud Extension" extends "Intelligent Cloud Mana HybridCompany: Record "Hybrid Company"; GPConfiguration: Record "GP Configuration"; GPCompanyAdditionalSettings: Record "GP Company Additional Settings"; + GPUpgradeSettings: Record "GP Upgrade Settings"; HybridGPWizard: Codeunit "Hybrid GP Wizard"; UserPermissions: Codeunit "User Permissions"; begin @@ -115,6 +121,9 @@ pageextension 4015 "Intelligent Cloud Extension" extends "Intelligent Cloud Mana HybridCompany.SetRange(Replicate, true); HasCompletedSetupWizard := not HybridCompany.IsEmpty(); + GPUpgradeSettings.GetonInsertGPUpgradeSettings(GPUpgradeSettings); + UseTwoStepProcess := not GPUpgradeSettings."One Step Upgrade"; + if HybridCompany.Get(CompanyName()) then begin GPConfiguration.GetSingleInstance(); if GetHasCompletedMigration() then @@ -148,6 +157,7 @@ pageextension 4015 "Intelligent Cloud Extension" extends "Intelligent Cloud Mana IsSuper: Boolean; FactBoxesVisible: Boolean; HasCompletedSetupWizard: Boolean; + UseTwoStepProcess: Boolean; DetailSnapshotNotConfiguredMsg: Label 'GP Historical Snapshot is not configured to migrate.'; ConfirmRerunQst: Label 'Are you sure you want to rerun the GP Historical Snapshot migration?'; ResetPreviousRunQst: Label 'Do you want to reset your previous GP Historical Snapshot migration? Choose No if you want to continue progress from the previous attempt.'; diff --git a/Apps/W1/HybridGP/test/app.json b/Apps/W1/HybridGP/test/app.json index 8402bda5b2..60332c3dff 100644 --- a/Apps/W1/HybridGP/test/app.json +++ b/Apps/W1/HybridGP/test/app.json @@ -30,12 +30,6 @@ "publisher": "Microsoft", "version": "26.0.0.0" }, - { - "id": "c526b3e9-b8ca-4683-81ba-fcd5f6b1472a", - "name": "Sales and Inventory Forecast", - "publisher": "Microsoft", - "version": "26.0.0.0" - }, { "id": "ea130081-c669-460f-a5f4-5dde14f03131", "name": "Statistical Accounts", diff --git a/Apps/W1/HybridGP/test/src/GPForecastingTests.codeunit.al b/Apps/W1/HybridGP/test/src/GPForecastingTests.codeunit.al deleted file mode 100644 index 00b1cbe03f..0000000000 --- a/Apps/W1/HybridGP/test/src/GPForecastingTests.codeunit.al +++ /dev/null @@ -1,489 +0,0 @@ -codeunit 139668 "GP Forecasting Tests" -{ - // [FEATURE] [GP Forecasting] - - EventSubscriberInstance = Manual; - Subtype = Test; - TestPermissions = Disabled; - - var - MSSalesForecastSetup: Record "MS - Sales Forecast Setup"; - Assert: Codeunit Assert; - CashFlowForecastHandler: Codeunit "Cash Flow Forecast Handler"; - LibraryLowerPermissions: Codeunit "Library - Lower Permissions"; - MSSalesForecastHandler: Codeunit "Sales Forecast Handler"; - LibraryInventory: Codeunit "Library - Inventory"; - LibrarySales: Codeunit "Library - Sales"; - MockServiceURITxt: Label 'https://localhost:8080/services.azureml.net/workspaces/2eaccaaec84c47c7a1f8f01ec0a6eea7', Locked = true; - MockServiceKeyTxt: Label 'TestKey', Locked = true; - XPAYABLESTxt: label 'PAYABLES', Locked = true; - XRECEIVABLESTxt: label 'RECEIVABLES', Locked = true; - - [Test] - [TransactionModel(TransactionModel::AutoRollback)] - procedure TestGPOnPrepareCashFlowData() - var - TimeSeriesBuffer: Record "Time Series Buffer"; - begin - // [SCENARIO] Normal prediction of item with GP history - LibraryLowerPermissions.SetOutsideO365Scope(); - - CreateCashFlowSetup(); - CashFlowForecastHandler.Initialize(); - - // [GIVEN] 6 historical periods - CreateCashFlowTestData(WorkDate(), true, false); - - // [THEN] Forecast is prepared - LibraryLowerPermissions.SetAccountReceivables(); - Assert.IsTrue(CashFlowForecastHandler.PrepareForecast(TimeSeriesBuffer), 'Forecast failed'); - - // [THEN] There are Forecast entries including 6 for payables and 6 for receivables coming from GP history tables - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SETRANGE("Group ID", XPAYABLESTxt); - TimeSeriesBuffer.FindSet(); - Assert.RecordCount(TimeSeriesBuffer, 6); - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SETRANGE("Group ID", XRECEIVABLESTxt); - Assert.RecordCount(TimeSeriesBuffer, 6); - end; - - [Test] - [TransactionModel(TransactionModel::AutoRollback)] - procedure TestGPCashFlowDataValues() - var - TimeSeriesBuffer: Record "Time Series Buffer"; - begin - // [SCENARIO] normal forecast records set from GP history tables - LibraryLowerPermissions.SetOutsideO365Scope(); - - CreateCashFlowSetup(); - CashFlowForecastHandler.Initialize(); - - // [GIVEN] 6 historical periods with some duplicate document numbers in GP history tables - CreateCashFlowTestData(WorkDate(), true, false); - - // [GIVEN] Forecast is prepared - LibraryLowerPermissions.SetAccountReceivables(); - Assert.IsTrue(CashFlowForecastHandler.PrepareForecast(TimeSeriesBuffer), 'Forecast failed'); - - // [THEN] the value for receivables period 6 should be 180 - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SetFilter("Group ID", XRECEIVABLESTxt); - TimeSeriesBuffer.SetFilter("Period No.", '6'); - TimeSeriesBuffer.FindSet(); - Assert.AreEqual(180, TimeSeriesBuffer.Value, 'Invalid Amount for period 6 receivables.'); - - // [THEN] the value for payables period 6 should be 120 - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SetFilter("Group ID", XPAYABLESTxt); - TimeSeriesBuffer.SetFilter("Period No.", '6'); - TimeSeriesBuffer.FindSet(); - Assert.AreEqual(120, TimeSeriesBuffer.Value, 'Invalid Amount for period 6 payables.'); - - // [THEN] the value for receivables period 1 should be 20 - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SetFilter("Group ID", XRECEIVABLESTxt); - TimeSeriesBuffer.SetFilter("Period No.", '1'); - TimeSeriesBuffer.FindSet(); - Assert.AreEqual(20, TimeSeriesBuffer.Value, 'Invalid Amount for period 1 receivables.'); - - // [THEN] the value for receivables period 2 should be 20 - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SetFilter("Group ID", XRECEIVABLESTxt); - TimeSeriesBuffer.SetFilter("Period No.", '2'); - Assert.AreEqual(20, TimeSeriesBuffer.Value, 'Invalid Amount for period 2 receivables.'); - - // [THEN] the value for payables period 1 should be 20 - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SetFilter("Group ID", XPAYABLESTxt); - TimeSeriesBuffer.SetFilter("Period No.", '1'); - Assert.AreEqual(20, TimeSeriesBuffer.Value, 'Invalid Amount for period 1 payables.'); - end; - - [Test] - [TransactionModel(TransactionModel::AutoRollback)] - procedure TestGPCashFlowDataValuesWithCreditMemos() - var - TimeSeriesBuffer: Record "Time Series Buffer"; - begin - // [SCENARIO] normal forecast records set from GP history tables - LibraryLowerPermissions.SetOutsideO365Scope(); - - CreateCashFlowSetup(); - CashFlowForecastHandler.Initialize(); - - // [GIVEN] 6 historical periods with some duplicate document numbers in GP history tables and some credit memos - CreateCashFlowTestData(WorkDate(), true, true); - - // [GIVEN] Forecast is prepared - LibraryLowerPermissions.SetAccountReceivables(); - Assert.IsTrue(CashFlowForecastHandler.PrepareForecast(TimeSeriesBuffer), 'Forecast failed'); - - // [THEN] the value for receivables period 3 should be 30 - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SetFilter("Group ID", XRECEIVABLESTxt); - TimeSeriesBuffer.SetFilter("Period No.", '3'); - TimeSeriesBuffer.FindSet(); - Assert.AreEqual(30, TimeSeriesBuffer.Value, 'Invalid Amount for period 3 receivables.'); - - // [THEN] the value for payables period 3 should be 30 - TimeSeriesBuffer.Reset(); - TimeSeriesBuffer.SetFilter("Group ID", XPAYABLESTxt); - TimeSeriesBuffer.SetFilter("Period No.", '3'); - Assert.AreEqual(30, TimeSeriesBuffer.Value, 'Invalid Amount for period 3 payables.'); - end; - - // [Test] - [TransactionModel(TransactionModel::AutoRollback)] - procedure TestGPOnPrepareSandIHistoryData() - var - MSSalesForecast: Record "MS - Sales Forecast"; - Item: Record Item; - MSSalesForecastParameter: Record "MS - Sales Forecast Parameter"; - TimeSeriesManagement: Codeunit "Time Series Management"; - begin - // [SCENARIO] Normal prediction of item with history - SI_Initialize(); - LibraryLowerPermissions.SetOutsideO365Scope(); - - // [Given] Sales history for an Item with six historic entries - CreateSITestData(Item, true, 6); - LibraryLowerPermissions.SetAccountReceivables(); - - // [Given] The Api Uri key has been set and the horizon is 12 periods - SetupSI(); - // [When] Item sales is being forecast for the given item - Assert.IsTrue(MSSalesForecastHandler.PrepareForecast(MSSalesForecastParameter, Item."No.", TimeSeriesManagement), 'Forecast failed'); - - // [THEN] There are 6 Forecast entries 6 for an item - MSSalesForecast.SETRANGE("Item No.", Item."No."); - Assert.RecordCount(MSSalesForecast, 6); - end; - - local procedure CreateCashFlowSetup() - var - CashFlowSetup: Record "Cash Flow Setup"; - ApiKey: Text; - begin - CashFlowSetup.Get(); - ApiKey := 'dummykey'; - CashFlowSetup.SaveUserDefinedAPIKey(ApiKey); - CashFlowSetup.Validate("API URL", 'https://ussouthcentral.services.azureml.net'); - CashFlowSetup.Validate("Period Type", CashFlowSetup."Period Type"::Year); - CashFlowSetup.Validate("Historical Periods", 18); - CashFlowSetup.Validate("Azure AI Enabled", true); - CashFlowSetup.Validate("Taxable Period", CashFlowSetup."Taxable Period"::Monthly); - CashFlowSetup.Modify(true); - end; - - local procedure CreateCashFlowTestData(Date: Date; Cleanup: Boolean; CreateCreditMemos: Boolean) - var - CustLedgerEntry: Record "Cust. Ledger Entry"; - VendorLedgerEntry: Record "Vendor Ledger Entry"; - GPSOPTrxHist: Record GPSOPTrxHist; - GPRMOpen: Record GPRMOpen; - GPRMHist: Record GPRMHist; - begin - if CleanUp then begin - CustLedgerEntry.DeleteAll(); - VendorLedgerEntry.DeleteAll(); - GPSOPTrxHist.DeleteAll(); - GPRMOpen.DeleteAll(); - GPRMHist.DeleteAll(); - end; - - CreateCustomerLedgerEntry(CalcDate('<-6Y+1D>', Date)); - CreateCustomerLedgerEntry(CalcDate('<-5Y+1D>', Date)); - CreateCustomerLedgerEntry(CalcDate('<-4Y+1D>', Date)); - CreateCustomerLedgerEntry(CalcDate('<-3Y+1D>', Date)); - CreateCustomerLedgerEntry(CalcDate('<-2Y+1D>', Date)); - CreateCustomerLedgerEntry(CalcDate('<-1Y+1D>', Date)); - - CreateVendorLedgerEntry(CalcDate('<-6Y+1D>', Date)); - CreateVendorLedgerEntry(CalcDate('<-5Y+1D>', Date)); - CreateVendorLedgerEntry(CalcDate('<-4Y+1D>', Date)); - CreateVendorLedgerEntry(CalcDate('<-3Y+1D>', Date)); - CreateVendorLedgerEntry(CalcDate('<-2Y+1D>', Date)); - CreateVendorLedgerEntry(CalcDate('<-1Y+1D>', Date)); - - // SALES - CreateRMOpenEntry(CalcDate('<-6Y+1D>', Date), 10, 10, false); - CreateRMOpenEntry(CalcDate('<-5Y+1D>', Date), 20, 20, false); - CreateRMOpenEntry(CalcDate('<-4Y+1D>', Date), 30, 30, false); - CreateRMOpenEntry(CalcDate('<-3Y+1D>', Date), 40, 40, false); - CreateRMOpenEntry(CalcDate('<-2Y+1D>', Date), 50, 50, false); - CreateRMOpenEntry(CalcDate('<-1Y+1D>', Date), 60, 60, false); - - CreateRMTrxHistEntry(CalcDate('<-6Y+1D>', Date), 10, 10, false); - CreateRMTrxHistEntry(CalcDate('<-5Y+1D>', Date), 80, 20, false); - CreateRMTrxHistEntry(CalcDate('<-4Y+1D>', Date), 90, 30, false); - CreateRMTrxHistEntry(CalcDate('<-3Y+1D>', Date), 100, 40, false); - CreateRMTrxHistEntry(CalcDate('<-2Y+1D>', Date), 110, 50, false); - CreateRMTrxHistEntry(CalcDate('<-1Y+1D>', Date), 120, 60, false); - - CreateSOPTrxHistEntry(CalcDate('<-6Y+1D>', Date), 130, 10); - CreateSOPTrxHistEntry(CalcDate('<-5Y+1D>', Date), 20, 20); - CreateSOPTrxHistEntry(CalcDate('<-4Y+1D>', Date), 150, 30); - CreateSOPTrxHistEntry(CalcDate('<-3Y+1D>', Date), 160, 40); - CreateSOPTrxHistEntry(CalcDate('<-2Y+1D>', Date), 170, 50); - CreateSOPTrxHistEntry(CalcDate('<-1Y+1D>', Date), 180, 60); - - //PURCHASING - CreatePMHistEntry(CalcDate('<-6Y+1D>', Date), 190, 10, false); - CreatePMHistEntry(CalcDate('<-5Y+1D>', Date), 200, 20, false); - CreatePMHistEntry(CalcDate('<-4Y+1D>', Date), 210, 30, false); - CreatePMHistEntry(CalcDate('<-3Y+1D>', Date), 220, 40, false); - CreatePMHistEntry(CalcDate('<-2Y+1D>', Date), 230, 50, false); - CreatePMHistEntry(CalcDate('<-1Y+1D>', Date), 240, 60, false); - - CreatePOP_PO_HistEntry(CalcDate('<-6Y+1D>', Date), 190, 10); - CreatePOP_PO_HistEntry(CalcDate('<-5Y+1D>', Date), 260, 20); - CreatePOP_PO_HistEntry(CalcDate('<-4Y+1D>', Date), 270, 30); - CreatePOP_PO_HistEntry(CalcDate('<-3Y+1D>', Date), 280, 40); - CreatePOP_PO_HistEntry(CalcDate('<-2Y+1D>', Date), 290, 50); - CreatePOP_PO_HistEntry(CalcDate('<-1Y+1D>', Date), 300, 60); - - if CreateCreditMemos then begin - CreateRMOpenEntry(CalcDate('<-4Y+1D>', Date), 35, 30, true); - CreateRMTrxHistEntry(CalcDate('<-4Y+1D>', Date), 95, 30, true); - CreatePMHistEntry(CalcDate('<-4Y+1D>', Date), 215, 30, true); - end; - - CreateCustomer(); - CreateVendor(); - end; - - local procedure CreateCustomerLedgerEntry(DueDate: Date) - var - CustLedgerEntry: Record "Cust. Ledger Entry"; - EntryNo: Integer; - begin - if CustLedgerEntry.FindLast() then; - EntryNo := CustLedgerEntry."Entry No." + 1; - CustLedgerEntry.Init(); - CustLedgerEntry.Open := true; - CustLedgerEntry."Document Type" := CustLedgerEntry."Document Type"::Invoice; - CustLedgerEntry."Due Date" := DueDate; - CustLedgerEntry."Entry No." := EntryNo; - CustLedgerEntry.Insert(); - end; - - local procedure CreateVendorLedgerEntry(DueDate: Date) - var - VendorLedgerEntry: Record "Vendor Ledger Entry"; - EntryNo: Integer; - begin - if VendorLedgerEntry.FindLast() then; - EntryNo := VendorLedgerEntry."Entry No." + 1; - VendorLedgerEntry.Init(); - VendorLedgerEntry.Open := true; - VendorLedgerEntry."Document Type" := VendorLedgerEntry."Document Type"::Invoice; - VendorLedgerEntry."Due Date" := DueDate; - VendorLedgerEntry."Entry No." := EntryNo; - VendorLedgerEntry.Insert(); - end; - - local procedure CreateSOPTrxHistEntry(DueDate: Date; SOPNumber: Integer; DocAmount: Decimal) - var - GPSOPTrxHist: Record GPSOPTrxHist; - begin - GPSOPTrxHist.Init(); - GPSOPTrxHist.SOPNUMBE := Format(SOPNumber); - GPSOPTrxHist.SOPTYPE := GPSOPTrxHist.SOPTYPE::Invoice; - GPSOPTrxHist.DUEDATE := DueDate; - GPSOPTrxHist.DOCAMNT := DocAmount; - GPSOPTrxHist.Insert(); - end; - - local procedure CreateRMTrxHistEntry(DueDate: Date; DocNumber: Integer; DocAmount: Decimal; CreateAsCreditMemo: Boolean) - var - GPRMHist: Record GPRMHist; - begin - GPRMHist.Init(); - GPRMHist.DOCNUMBR := Format(DocNumber); - if CreateAsCreditMemo then - GPRMHist.RMDTYPAL := GPRMHist.RMDTYPAL::"Credit Memos" - else - GPRMHist.RMDTYPAL := GPRMHist.RMDTYPAL::"Sales/Invoices"; - GPRMHist.DUEDATE := DueDate; - GPRMHist.CUSTNMBR := '1'; - GPRMHist.SLSAMNT := DocAmount; - GPRMHist.Insert(); - end; - - local procedure CreateRMOpenEntry(DueDate: Date; DocNumber: Integer; DocAmount: Decimal; CreateAsCreditMemo: Boolean) - var - GPRMOpen: Record GPRMOpen; - begin - GPRMOpen.Init(); - GPRMOpen.DOCNUMBR := Format(DocNumber); - if CreateAsCreditMemo then - GPRMOpen.RMDTYPAL := GPRMOpen.RMDTYPAL::"Credit Memos" - else - GPRMOpen.RMDTYPAL := GPRMOpen.RMDTYPAL::"Sales/Invoices"; - GPRMOpen.DUEDATE := DueDate; - GPRMOpen.CUSTNMBR := '1'; - GPRMOpen.SLSAMNT := DocAmount; - GPRMOpen.Insert(); - end; - - local procedure CreatePOP_PO_HistEntry(DueDate: Date; PONumber: Integer; DocAmount: Decimal) - var - GPPOPPOHist: Record GPPOPPOHist; - begin - GPPOPPOHist.Init(); - GPPOPPOHist.PONUMBER := Format(PONumber); - GPPOPPOHist.POTYPE := GPPOPPOHist.POTYPE::Standard; - GPPOPPOHist.DUEDATE := DueDate; - GPPOPPOHist.CUSTNMBR := '1'; - GPPOPPOHist.SUBTOTAL := DocAmount; - GPPOPPOHist.Insert(); - end; - - - local procedure CreatePMHistEntry(DueDate: Date; PONumber: Integer; DocAmount: Decimal; CreateAsCreditMemo: Boolean) - var - GPPMHist: Record GPPMHist; - begin - GPPMHist.Init(); - GPPMHist.VCHRNMBR := Format(PONumber); - GPPMHist.DOCNUMBR := GPPMHist.VCHRNMBR; - if CreateAsCreditMemo then - GPPMHist.DOCTYPE := GPPMHist.DOCTYPE::"Credit Memo" - else - GPPMHist.DOCTYPE := GPPMHist.DOCTYPE::Invoice; - GPPMHist.DUEDATE := DueDate; - GPPMHist.VENDORID := '1'; - GPPMHist.DOCAMNT := DocAmount; - GPPMHist.Insert(); - end; - - local procedure CreateCustomer() - var - Customer: Record Customer; - CustomerNumber: Code[20]; - begin - Customer.DeleteAll(); - Evaluate(CustomerNumber, '1'); - Customer.Init(); - Customer."No." := CustomerNumber; - Customer.Insert(); - end; - - local procedure CreateVendor() - var - Vendor: Record Vendor; - begin - Vendor.DeleteAll(); - Evaluate(Vendor."No.", '1'); - Vendor.Init(); - Vendor.Insert(); - end; - - local procedure SI_Initialize(); - var - MSSalesForecast: Record "MS - Sales Forecast"; - MSSalesForecastParameter: Record "MS - Sales Forecast Parameter"; - JobQueueEntry: Record "Job Queue Entry"; - LibraryPermissions: Codeunit "Library - Permissions"; - LibraryNotificationMgt: Codeunit "Library - Notification Mgt."; - begin - LibraryPermissions.SetTestabilitySoftwareAsAService(true); - LibraryNotificationMgt.DisableAllNotifications(); // do not get polluted by Image analysis notifications - - MSSalesForecastSetup.DeleteAll(); - MSSalesForecast.DeleteAll(); - MSSalesForecastParameter.DeleteAll(); - - JobQueueEntry.SetRange("Object Type to Run", JobQueueEntry."Object Type to Run"::Codeunit); - JobQueueEntry.SetRange("Object ID to Run", Codeunit::"Sales Forecast Update"); - JobQueueEntry.DeleteAll(); - end; - - local procedure CreateSITestData(var Item: Record Item; Cleanup: Boolean; NumberOfEntries: Integer) - var - GPIVTrxAmountsHist: Record GPIVTrxAmountsHist; - Customer: Record Customer; - - begin - if CleanUp then - GPIVTrxAmountsHist.DeleteAll(); - - LibraryInventory.CreateItem(Item); - LibrarySales.CreateCustomer(Customer); - CreateLedgerEntriesBeforeWorkdate(Item, Customer, NumberOfEntries, false); - end; - - procedure CreateLedgerEntriesBeforeWorkdate(var Item: Record Item; var Customer: Record Customer; NumberOfEntries: Integer; PeriodTypeDay: Boolean); - var - ItemLedgerEntry: Record "Item Ledger Entry"; - PostingDate: Date; - EntryNo: Integer; - LastEntryNo: Integer; - QtyToIncrease: Decimal; - begin - PostingDate := CalcDate('<-1D>', WorkDate()); - QtyToIncrease := 5; - - ItemLedgerEntry.FindLast(); - LastEntryNo := ItemLedgerEntry."Entry No."; - CLEAR(ItemLedgerEntry); - - // Increasing, linear sales - for EntryNo := 1 to NumberOfEntries do begin - ItemLedgerEntry.Init(); - ItemLedgerEntry."Entry No." := LastEntryNo + EntryNo; - ItemLedgerEntry."Item No." := Item."No."; - ItemLedgerEntry."Entry Type" := ItemLedgerEntry."Entry Type"::Sale; - ItemLedgerEntry."Posting Date" := PostingDate; - ItemLedgerEntry.Quantity := -(NumberOfEntries * QtyToIncrease - (EntryNo - 1) * QtyToIncrease); - ItemLedgerEntry."Source Type" := ItemLedgerEntry."Source Type"::Customer; - ItemLedgerEntry."Source No." := Customer."No."; - ItemLedgerEntry.Insert(); - - CreateGPIVTrxEntry(PostingDate, Item, Customer); - - if PeriodTypeDay then - PostingDate := CalcDate('<-1D>', PostingDate) - else - PostingDate := CalcDate('<-1M>', PostingDate); - end; - end; - - local procedure CreateGPIVTrxEntry(DueDate: Date; Item: Record Item; Customer: Record Customer) - var - GPIVTrxAmountsHist: Record GPIVTrxAmountsHist; - LibraryRandom: Codeunit "Library - Random"; - DocNumber: integer; - ItemQuantity: Decimal; - begin - LibraryRandom.Init(); - ItemQuantity := LibraryRandom.RandDec(10, 3); - DocNumber := 0; - if GPIVTrxAmountsHist.FindLast() then - Evaluate(DocNumber, GPIVTrxAmountsHist.DOCNUMBR); - DocNumber := DocNumber + 100; - GPIVTrxAmountsHist.Init(); - GPIVTrxAmountsHist.DOCTYPE := GPIVTrxAmountsHist.DOCTYPE::Sale; - GPIVTrxAmountsHist.DOCNUMBR := Format(DocNumber); - GPIVTrxAmountsHist.DOCDATE := DueDate; - GPIVTrxAmountsHist.TRXQTY := ItemQuantity; - GPIVTrxAmountsHist.LNSEQNBR := 10; - GPIVTrxAmountsHist.ITEMNMBR := Item."No."; - GPIVTrxAmountsHist.CUSTNMBR := CopyStr(Customer."No.", 1, 16); - GPIVTrxAmountsHist.Insert(); - end; - - procedure SetupSI(); - var - ApiKey: Text; - begin - MSSalesForecastSetup.GetSingleInstance(); - MSSalesForecastSetup.Validate("API URI", MockServiceURITxt); - ApiKey := MockServiceKeyTxt; - MSSalesForecastSetup.SetUserDefinedAPIKey(ApiKey); - MSSalesForecastSetup.Modify(true); - end; - -} \ No newline at end of file diff --git a/Apps/W1/HybridGP/test/src/GPRunAllTests.codeunit.al b/Apps/W1/HybridGP/test/src/GPRunAllTests.codeunit.al index a4aa272e2a..73433d0aa1 100644 --- a/Apps/W1/HybridGP/test/src/GPRunAllTests.codeunit.al +++ b/Apps/W1/HybridGP/test/src/GPRunAllTests.codeunit.al @@ -7,7 +7,6 @@ codeunit 139669 "GP RunAllTests" GPItemTests: Codeunit "GP Item Tests"; GPDataMigrationTests: Codeunit "GP Data Migration Tests"; GPTransactionTests: Codeunit "GP Transaction Tests"; - GPForecastingTests: Codeunit "GP Forecasting Tests"; GPCheckbookTests: Codeunit "GP Checkbook Tests"; GPSettingsTests: Codeunit "GP Settings Tests"; begin @@ -15,7 +14,6 @@ codeunit 139669 "GP RunAllTests" GPDataMigrationTests.Run(); GPTransactionTests.Run(); GPItemTests.Run(); - GPForecastingTests.Run(); GPCheckbookTests.Run(); GPSettingsTests.Run(); end;