-
Notifications
You must be signed in to change notification settings - Fork 687
SL Cloud Migration Update November 2025 #29477
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
base: main
Are you sure you want to change the base?
Conversation
…ForFieldUpdate to a public procedure
…ns, and remove obsolete codeunit
|
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. |
|
@nikolakukrika This PR is now ready for code review. Thank you. |
…te for assigning dimensions on Beginning Balance journal entries.
…nto SLMigrationUpdate2025-11
…r, and SL Batch tables to support tests.
| SLPopulateVendor1099Data: Codeunit "SL Populate Vendor 1099 Data"; | ||
| begin | ||
| if (SLCompanyAdditionalSettings.GetMigrateCurrent1099YearEnabled()) or (SLCompanyAdditionalSettings.GetMigrateNext1099YearEnabled()) then begin | ||
| SetupIRSFormsFeatureIfNeeded(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(''); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
| } | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
Summary
SL Cloud Migration Update for November 2025
This PR replaces closed PRs 29378 and 29394.
Work Item(s)
Fixes #
AB#575741
AB#609658
AB#612598