-
Notifications
You must be signed in to change notification settings - Fork 685
SL Migration Account Beginning Balance Update #29394
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?
SL Migration Account Beginning Balance Update #29394
Conversation
…nto SL-Migration-Vendor1099
|
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 Here is the PR for Beginning Balance Bug 609658 |
| using Microsoft.Finance.VAT.Reporting; | ||
|
|
||
| codeunit 47009 "SL IRS Form Data" | ||
| { |
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.
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); |
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 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 |
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.
I would say that this check should go first so we do not log duplicate messages.
| DataMigrationFacadeHelper.CreateSourceCodeIfNeeded(SourceCodeTxt); | ||
| end; | ||
|
|
||
| local procedure CreateMappingsIfNeeded() |
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 functionality is not needed any more, we have obsoleted the old functionality
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.
@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); | ||
|
|
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.
Minor 2 lines
| var | ||
| GenJournalBatch: Record "Gen. Journal Batch"; | ||
| TemplateName: Code[10]; | ||
|
|
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.
Minor - empty line
| GenJournalLine.DeleteAll(); | ||
|
|
||
| GenJournalBatch.SetRange(Name, CurrentYearJournalBatchName); | ||
| if 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.
I would recommending checking if the GenJournalBatch has no lines before deleting
|
|
||
| GenJournalBatch.SetRange(Name, CurrentYearJournalBatchName); | ||
| if GenJournalBatch.FindFirst() then begin | ||
| GenJournalBatch.Delete(); |
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.
Delete(true)
| GenJournalBatch.Delete(); | ||
|
|
||
| if (GenJournalTemplate.Get(CurrentYearJournalBatchName)) then | ||
| GenJournalTemplate.Delete(); |
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.
Delete(true)
| GenJournalLine.SetRange("Account No.", ''); | ||
| if not GenJournalLine.IsEmpty() then | ||
| GenJournalLine.DeleteAll(); | ||
| GenJournalBatch.SetRange(Name, NextYearJournalBatchName); |
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.
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); |
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 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;
Summary
Work Item(s)
Fixes # AB#609658