mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-08 02:16:52 +01:00
Add Finance posting domain-knowledge pilot
Adds three atomic domain-rule knowledge files under community/knowledge/finance/ as a pilot for Type-A (normative) Business Central domain knowledge: post through the posting engine, treat posted ledger entries as immutable, and treat the Dimension Set ID as the source of truth for dimensions. Includes a good/bad AL sample pair for the posting rule. These encode BC-specific invariants that LLMs reliably get wrong, fitting the existing remedial/atomic knowledge grain with no schema or contract changes. Passes the repo frontmatter validator and is discovered by the knowledge index. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
8904ce583b
commit
3cb00e4d2d
5 changed files with 116 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
// Demonstration only. Self-contained illustration, not derived from the
|
||||
// Business Central base application source.
|
||||
//
|
||||
// BAD: insert straight into the ledger table and hand-compute Entry No.
|
||||
// The row is unbalanced (no balancing entry), has no register, no resolved
|
||||
// dimensions, and no VAT. FindLast + "+ 1" races under concurrency and will
|
||||
// collide on the primary key. Reconciliation treats the result as corrupt.
|
||||
codeunit 50100 "Post GL Adjustment"
|
||||
{
|
||||
procedure PostAdjustment(AccountNo: Code[20]; Amount: Decimal; PostingDate: Date)
|
||||
var
|
||||
GLEntry: Record "G/L Entry";
|
||||
LastGLEntry: Record "G/L Entry";
|
||||
begin
|
||||
if LastGLEntry.FindLast() then;
|
||||
|
||||
GLEntry.Init();
|
||||
GLEntry."Entry No." := LastGLEntry."Entry No." + 1;
|
||||
GLEntry."G/L Account No." := AccountNo;
|
||||
GLEntry.Amount := Amount;
|
||||
GLEntry."Posting Date" := PostingDate;
|
||||
GLEntry.Insert();
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue