Skip to content

Conversation

@blauerPCL
Copy link
Contributor

@blauerPCL blauerPCL commented Dec 1, 2025

Summary

SL Cloud Migration Update for November 2025

  • New US extension that includes migration of IRS 1099 information
  • Update for GL Account Beginning Balances
  • Update to only migrate open AP and AR amounts from released and posted documents
  • Update for blank SL subaccount segments
  • Update for dimension shortcuts in General Ledger Setup

This PR replaces closed PRs 29378 and 29394.

Work Item(s)

Fixes #
AB#575741
AB#609658
AB#612598

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link.

@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label Dec 1, 2025
@blauerPCL blauerPCL changed the title [DRAFT] SL Cloud Migration Update November 2025 SL Cloud Migration Update November 2025 Dec 2, 2025
@blauerPCL blauerPCL marked this pull request as ready for review December 2, 2025 04:30
@blauerPCL blauerPCL requested a review from a team as a code owner December 2, 2025 04:30
@blauerPCL blauerPCL requested a review from dcenic December 2, 2025 04:30
@blauerPCL
Copy link
Contributor Author

@nikolakukrika This PR is now ready for code review. Thank you.

SLPopulateVendor1099Data: Codeunit "SL Populate Vendor 1099 Data";
begin
if (SLCompanyAdditionalSettings.GetMigrateCurrent1099YearEnabled()) or (SLCompanyAdditionalSettings.GetMigrateNext1099YearEnabled()) then begin
SetupIRSFormsFeatureIfNeeded();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GP Migration has this method EnsureSupportedReportingYear.
Do we need to do additional checks?

SLPopulateVendor1099Data.Run();
UnbindSubscription(SLPopulateVendor1099Data);
end;
end;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GP Migration has SetPreferredVendorBankAccountsUseForElectronicPayments();
Do we need this method too?

SLVendor1099MappingHelpers.InsertSupportedTaxYear(TaxYear);

// MISC
SLVendor1099MappingHelpers.InsertMapping(TaxYear, '1', '1M', 'MISC', 'MISC-01');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have obsoleted the old IRS1099 functionality. Are you sure that this is the correct implementation?
The GP code looks different

IRS1099Code: Code[10];
TaxAmount: Decimal;
begin
if SLAPBalances.Get(VendorNo, CompanyName) then begin
Copy link
Contributor

@nikolakukrika nikolakukrika Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This level of nesting is too much. The better is
if SLAPBalances.Get(VendorNo, CompanyName) then
exit;

VendorYear1099AmountDictionary.Add(IRS1099Code, SLAPBalances.CYBox13);
if SLAPBalances.CYBox12 > 0 then
IRS1099Code := SLVendor1099MappingHelpers.GetIRS1099BoxCode(TaxYear, '25')
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these can be refactored to:

if SLAPBalances.CYBox12 > 0 then begin
IRS1099Code := SLVendor1099MappingHelpers.GetIRS1099BoxCode(TaxYear, '25')
if IRS1099Code <> '' then
if VendorYear1099AmountDictionary.Get(IRS1099Code, TaxAmount) then
VendorYear1099AmountDictionary.Set(IRS1099Code, TaxAmount + SLAPBalances.CYBox12)
else
VendorYear1099AmountDictionary.Add(IRS1099Code, SLAPBalances.CYBox12);
end;

It is more readable and less dependencies on clearing the code

GenJournalBatch.SetRange(Name, GeneralJournalBatchCode);
GenJournalBatch.SetRange("No. Series", NoSeriesCode);
GenJournalBatch.SetRange("Posting No. Series", PostingNoSeriesCode);
if not GenJournalBatch.FindFirst() then begin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if GenJournalBatch.IsEmpty() then begin

We are not using the value anywhere

begin
// [Given] SL Data
Initialize();
SLTestHelperFunctions.ClearBCVendorTableData();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three lines should be a part of the initialize method

TempVendor.FindSet();
repeat
Assert.IsTrue(Vendor.Get(TempVendor."No."), 'Vendor record not found for No. ' + TempVendor."No.");
Assert.AreEqual(TempVendor."Federal ID No.", Vendor."Federal ID No.", 'Federal ID No. does not match for Vendor No. ' + TempVendor."No.");
Copy link
Contributor

@nikolakukrika nikolakukrika Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration code is moving more, balances, payment entries. Should we check these as well?
We should get asserts for all things we are migrating

CreateOpeningBalanceTrx(Sender, RecordIdToMigrate);
end;

internal procedure CreateOpeningBalanceTrx(var Sender: Codeunit "GL Acc. Data Migration Facade"; RecordIdToMigrate: RecordId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add tests for these?

IRS1099VendorFormBoxSetup: Record "IRS 1099 Vendor Form Box Setup";
begin
SLCompanyAdditionalSettings.GetSingleInstance();
if IRS1099VendorFormBoxSetup.Get(TaxYear, Vendor."No.") then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit(false) is missing at the bottom.
It is better to refactor to exit(IRS1099VendorFormBoxSetup.Get(TaxYear, Vendor."No."));

if GLAccount.Get(VendorPostingGroup."Payables Account") then
exit(GLAccount."No.");

exit('');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be blank or DefaultPayablesAccountCode?
If it should be blank can we get a comment explaining why?


CreateMappingsIfNeeded();

Evaluate(Day31, Day31Txt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is simpler to use PostingDate := DMY2Date(31, 12, CurrentYear);

CurrentYearJournalBatchName := VendorTaxBatchNameTxt + Format(SLCurr1099Yr);
GenJournalLine.SetRange("Journal Batch Name", CurrentYearJournalBatchName);
GenJournalLine.SetFilter("Account No.", '<>%1', '');
if (not GenJournalLine.IsEmpty()) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct logic? If we do not have a current year but we have a next year, we will exit and not clean the next year.
Do all the exits in this method make sense?

}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple blank lines

ErrorMessageInStream.ReadText(ErrorMessageLine);
ErrorMessageBuilder.AppendLine(ErrorMessageLine);
end;
exit(ErrorMessageBuilder.ToText().Trim())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - missing terminating ; on the line

SLCompanyAdditionalSettings: Record "SL Company Additional Settings";
IRS1099VendorFormBoxSetup: Record "IRS 1099 Vendor Form Box Setup";
begin
SLCompanyAdditionalSettings.GetSingleInstance();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SLCompanyAdditionalSettings are not used after this line. Is it a bug or should the reference be removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration GitHub request for Integration area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants