Skip to content

Conversation

@blauerPCL
Copy link
Contributor

@blauerPCL blauerPCL commented Nov 10, 2025

Summary

  • Enhance SL Account Migrator with opening balance transaction creation.
  • Update SL Populate Accounts and Fiscal Periods for improved logic.

Work Item(s)

Fixes # AB#609658

@blauerPCL blauerPCL requested a review from a team as a code owner November 10, 2025 14:18
@github-actions
Copy link
Contributor

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.

@blauerPCL
Copy link
Contributor Author

@nikolakukrika Here is the PR for Beginning Balance Bug 609658

using Microsoft.Finance.VAT.Reporting;

codeunit 47009 "SL IRS Form Data"
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this needs to go to US version of the SL app.
We cannot put it in the W1 version as it will not compile, IRS 1099 is a US functionality

IRSReportingPeriod: Record "IRS Reporting Period";
PeriodNo: Code[20];
begin
PeriodNo := Format(ReportingYear);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not duplicate the code. Please use the codeunit 10039 "IRS Forms Data" from the IRS app.
I will remove the access internal form it.

LogMessage(MessageCodeSkippedTxt, 'SL Vendor Current 1099 Year Data Migration is not enabled on the SL Company Migration Configuration page.');
if not SLCompanyAdditionalSettings.GetMigrateNext1099YearEnabled() then
LogMessage(MessageCodeSkippedTxt, 'SL Vendor Next 1099 Year Data Migration is not enabled on the SL Company Migration Configuration page.');
if not SLCompanyAdditionalSettings.GetMigrateCurrent1099YearEnabled() and not SLCompanyAdditionalSettings.GetMigrateNext1099YearEnabled() 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.

I would say that this check should go first so we do not log duplicate messages.

DataMigrationFacadeHelper.CreateSourceCodeIfNeeded(SourceCodeTxt);
end;

local procedure CreateMappingsIfNeeded()
Copy link
Contributor

Choose a reason for hiding this comment

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

This functionality is not needed any more, we have obsoleted the old functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nikolakukrika If the CreateMappingsIfNeeded functionality is no longer needed, how should the SL 1099 box numbers be mapped to the BC IRS 1099 Codes? Also, what old functionality was obsoleted?

begin
VendorTaxBatchCode := VendorTaxBatchNameTxt + Format(TaxYear);
GenJournalBatch.Get(CreateGenJournalTemplateIfNeeded(VendorTaxBatchCode, TaxYear), VendorTaxBatchCode);

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor 2 lines

var
GenJournalBatch: Record "Gen. Journal Batch";
TemplateName: Code[10];

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor - empty line

GenJournalLine.DeleteAll();

GenJournalBatch.SetRange(Name, CurrentYearJournalBatchName);
if 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.

I would recommending checking if the GenJournalBatch has no lines before deleting


GenJournalBatch.SetRange(Name, CurrentYearJournalBatchName);
if GenJournalBatch.FindFirst() then begin
GenJournalBatch.Delete();
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete(true)

GenJournalBatch.Delete();

if (GenJournalTemplate.Get(CurrentYearJournalBatchName)) then
GenJournalTemplate.Delete();
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete(true)

GenJournalLine.SetRange("Account No.", '');
if not GenJournalLine.IsEmpty() then
GenJournalLine.DeleteAll();
GenJournalBatch.SetRange(Name, NextYearJournalBatchName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here, check for the lines if it still some exist and delete with true.
You could create a helper method for this

CalcFields(Rec."Error Message");
if Rec."Error Message".HasValue() then begin
Rec."Error Message".CreateInStream(ErrorMessageInStream);
ErrorMessageInStream.ReadText(ReturnText);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is incorrect code. There should be a while loop and a check about EOS.
This is the safer code
procedure GetInstructions(): Text
var
InstructionsBuilder: TextBuilder;
InStream: InStream;
InstructionsLine: Text;
begin
Rec.CalcFields(Instructions);
Instructions.CreateInStream(InStream, CustomAgentExport.GetEncoding());
while not InStream.EOS do begin
InStream.ReadText(InstructionsLine);
InstructionsBuilder.AppendLine(InstructionsLine);
end;
exit(InstructionsBuilder.ToText().Trim());
end;

@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label Nov 14, 2025
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