mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 06:36:55 +01:00
Move Finance knowledge to the Microsoft-owned layer, add nine scoped rules with eighteen AL samples, and register bounded Finance review with complete paired evaluation coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
29 lines
1.3 KiB
AL
29 lines
1.3 KiB
AL
// Demonstration only; independently authored, not copied from BaseApp.
|
|
codeunit 50100 "Post Transfer Journal"
|
|
{
|
|
procedure PostTransferBatch(TemplateName: Code[10]; BatchName: Code[10])
|
|
var
|
|
JournalLine: Record "Gen. Journal Line";
|
|
PostBatch: Codeunit "Gen. Jnl.-Post Batch";
|
|
begin
|
|
JournalLine.SetRange("Journal Template Name", TemplateName);
|
|
JournalLine.SetRange("Journal Batch Name", BatchName);
|
|
if JournalLine.Count() <> 1 then
|
|
Error(SingleTransferErr);
|
|
JournalLine.FindFirst();
|
|
JournalLine.TestField("Account Type", JournalLine."Account Type"::"G/L Account");
|
|
JournalLine.TestField("Bal. Account Type", JournalLine."Bal. Account Type"::"G/L Account");
|
|
JournalLine.TestField("Account No.");
|
|
JournalLine.TestField("Bal. Account No.");
|
|
JournalLine.TestField("Posting Date");
|
|
JournalLine.TestField("Document No.");
|
|
JournalLine.TestField(Amount);
|
|
JournalLine.TestField("Currency Code", '');
|
|
JournalLine.TestField("Gen. Posting Type", JournalLine."Gen. Posting Type"::" ");
|
|
JournalLine.TestField("Bal. Gen. Posting Type", JournalLine."Bal. Gen. Posting Type"::" ");
|
|
PostBatch.Run(JournalLine);
|
|
end;
|
|
|
|
var
|
|
SingleTransferErr: Label 'Use a journal batch containing exactly one self-balancing G/L transfer.';
|
|
}
|