SL Migration Account Beginning Balance Update#29394
SL Migration Account Beginning Balance Update#29394blauerPCL wants to merge 4 commits intomicrosoft:mainfrom
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.
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.
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.
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.
This functionality is not needed any more, we have obsoleted the old functionality
There was a problem hiding this comment.
@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); | ||
|
|
| var | ||
| GenJournalBatch: Record "Gen. Journal Batch"; | ||
| TemplateName: Code[10]; | ||
|
|
| GenJournalLine.DeleteAll(); | ||
|
|
||
| GenJournalBatch.SetRange(Name, CurrentYearJournalBatchName); | ||
| if GenJournalBatch.FindFirst() then begin |
There was a problem hiding this comment.
I would recommending checking if the GenJournalBatch has no lines before deleting
|
|
||
| GenJournalBatch.SetRange(Name, CurrentYearJournalBatchName); | ||
| if GenJournalBatch.FindFirst() then begin | ||
| GenJournalBatch.Delete(); |
| GenJournalBatch.Delete(); | ||
|
|
||
| if (GenJournalTemplate.Get(CurrentYearJournalBatchName)) then | ||
| GenJournalTemplate.Delete(); |
| GenJournalLine.SetRange("Account No.", ''); | ||
| if not GenJournalLine.IsEmpty() then | ||
| GenJournalLine.DeleteAll(); | ||
| GenJournalBatch.SetRange(Name, NextYearJournalBatchName); |
There was a problem hiding this comment.
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.
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;
|
Replaced with PR #29477 |
Summary
Work Item(s)
Fixes # AB#609658