Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GP - Remove the CLEAN25 preprocessor checks from the US app #27772

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
namespace Microsoft.DataMigration.GP;

using System.Integration;
#if not CLEAN25
using System.Environment.Configuration;
#endif
using Microsoft.Purchases.Vendor;

codeunit 42004 "GP Cloud Migration US"
{
var
#if not CLEAN25
IRSFormFeatureKeyIdTok: Label 'IRSForm', Locked = true;
#endif

[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)
Expand Down Expand Up @@ -73,16 +69,10 @@ codeunit 42004 "GP Cloud Migration US"

internal procedure IsIRSFormsFeatureEnabled(): Boolean
var
#if not CLEAN25
FeatureManagementFacade: Codeunit "Feature Management Facade";
#endif
IsEnabled: Boolean;
begin
IsEnabled := true;

#if not CLEAN25
IsEnabled := FeatureManagementFacade.IsEnabled(IRSFormFeatureKeyIdTok);
#endif

exit(IsEnabled);
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,13 @@ codeunit 42003 "GP Populate Vendor 1099 Data"
var
GPCompanyAdditionalSettings: Record "GP Company Additional Settings";
IRS1099VendorFormBoxSetup: Record "IRS 1099 Vendor Form Box Setup";
#if not CLEAN25
GPCloudMigrationUS: Codeunit "GP Cloud Migration US";
#endif
begin
#if not CLEAN25
#pragma warning disable AL0432
if not GPCloudMigrationUS.IsIRSFormsFeatureEnabled() then
exit(Vendor."IRS 1099 Code" <> '');
#pragma warning restore AL0432
#endif

GPCompanyAdditionalSettings.GetSingleInstance();
if IRS1099VendorFormBoxSetup.Get(Format(GPCompanyAdditionalSettings.Get1099TaxYear()), Vendor."No.") then
exit(true);
Expand All @@ -152,18 +149,15 @@ codeunit 42003 "GP Populate Vendor 1099 Data"
GPCompanyAdditionalSettings: Record "GP Company Additional Settings";
IRS1099VendorFormBoxSetup: Record "IRS 1099 Vendor Form Box Setup";
IRS1099FormBox: Record "IRS 1099 Form Box";
#if not CLEAN25
GPCloudMigrationUS: Codeunit "GP Cloud Migration US";
#endif
begin
#if not CLEAN25
#pragma warning disable AL0432
if not GPCloudMigrationUS.IsIRSFormsFeatureEnabled() then begin
Vendor.Validate("IRS 1099 Code", IRS1099Code);
exit(true);
end;
#pragma warning restore AL0432
#endif

IRS1099FormBox.SetRange("No.", IRS1099Code);
if not IRS1099FormBox.FindFirst() then
exit(false);
Expand Down Expand Up @@ -332,11 +326,9 @@ codeunit 42003 "GP Populate Vendor 1099 Data"
GenJournalLine.Validate("Bal. Gen. Prod. Posting Group", '');
GenJournalLine.Validate("Bal. VAT Prod. Posting Group", '');
GenJournalLine.Validate("Bal. VAT Bus. Posting Group", '');
#if not CLEAN25
#pragma warning disable AL0432
GenJournalLine.Validate("IRS 1099 Code", IRS1099Code);
#pragma warning restore AL0432
#endif
GenJournalLine.Validate("Document Type", DocumentType);
GenJournalLine.Validate("Source Code", SourceCodeTxt);
GenJournalLine.Validate("External Document No.", ExternalDocumentNo);
Expand Down
Loading