mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-07 15:46:55 +01:00
Expand Finance pilot into a source-verified review domain
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>
This commit is contained in:
parent
639b6d1870
commit
fa63d5526c
38 changed files with 1064 additions and 124 deletions
|
|
@ -0,0 +1,56 @@
|
|||
// Demonstration only; independently authored, not copied from BaseApp.
|
||||
codeunit 50108 "Import Purchase Journal Total"
|
||||
{
|
||||
procedure ImportExampleTotal(TemplateName: Code[10]; BatchName: Code[10]; LineNo: Integer)
|
||||
var
|
||||
JournalLine: Record "Gen. Journal Line";
|
||||
VATPostingSetup: Record "VAT Posting Setup";
|
||||
GeneralLedgerSetup: Record "General Ledger Setup";
|
||||
SourceInvoice: JsonObject;
|
||||
NetToken: JsonToken;
|
||||
VATToken: JsonToken;
|
||||
GrossToken: JsonToken;
|
||||
ImportedNet: Decimal;
|
||||
ImportedVAT: Decimal;
|
||||
ImportedGross: Decimal;
|
||||
begin
|
||||
SourceInvoice.ReadFrom('{"netAmount":100,"vatAmount":25,"grossAmount":125}');
|
||||
SourceInvoice.Get('netAmount', NetToken);
|
||||
SourceInvoice.Get('vatAmount', VATToken);
|
||||
SourceInvoice.Get('grossAmount', GrossToken);
|
||||
ImportedNet := NetToken.AsValue().AsDecimal();
|
||||
ImportedVAT := VATToken.AsValue().AsDecimal();
|
||||
ImportedGross := GrossToken.AsValue().AsDecimal();
|
||||
if ImportedGross <> ImportedNet + ImportedVAT then
|
||||
Error(TotalsErr);
|
||||
|
||||
JournalLine.Get(TemplateName, BatchName, LineNo);
|
||||
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("Currency Code", '');
|
||||
JournalLine.TestField("Gen. Posting Type", JournalLine."Gen. Posting Type"::Purchase);
|
||||
JournalLine.TestField("VAT Posting", JournalLine."VAT Posting"::"Automatic VAT Entry");
|
||||
JournalLine.TestField("VAT Calculation Type", JournalLine."VAT Calculation Type"::"Normal VAT");
|
||||
JournalLine.TestField("VAT %", 25);
|
||||
JournalLine.TestField("VAT Difference", 0);
|
||||
JournalLine.TestField("Non-Deductible VAT %", 0);
|
||||
JournalLine.TestField("Bal. Gen. Posting Type", JournalLine."Bal. Gen. Posting Type"::" ");
|
||||
JournalLine.TestField("Bal. VAT %", 0);
|
||||
VATPostingSetup.Get(JournalLine."VAT Bus. Posting Group", JournalLine."VAT Prod. Posting Group");
|
||||
VATPostingSetup.TestField("VAT Calculation Type", VATPostingSetup."VAT Calculation Type"::"Normal VAT");
|
||||
VATPostingSetup.TestField("VAT %", 25);
|
||||
VATPostingSetup.TestField("Non-Deductible VAT %", 0);
|
||||
VATPostingSetup.TestField("Unrealized VAT Type", VATPostingSetup."Unrealized VAT Type"::" ");
|
||||
GeneralLedgerSetup.Get();
|
||||
GeneralLedgerSetup.TestField("Additional Reporting Currency", '');
|
||||
GeneralLedgerSetup.TestField("Amount Rounding Precision", 0.01);
|
||||
|
||||
JournalLine.Validate(Amount, ImportedNet);
|
||||
JournalLine.Modify(true);
|
||||
end;
|
||||
|
||||
var
|
||||
TotalsErr: Label 'The invoice total must equal its net amount plus VAT.';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue