microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
770 stars 610 forks source link

[Event Request] Codeunit 12 "Gen. Jnl.-Post Line" - OnInitGLEntryVATOnBeforeSummarizeVAT #27009

Open RZ440 opened 1 month ago

RZ440 commented 1 month ago

Describe the request

In the Event Request #26831 we asked for a new event OnInitGLEntryVATOnBeforeSummarizeVAT in Codeunit 12 "Gen. Jnl.-Post Line".

    procedure InitGLEntryVAT(GenJnlLine: Record "Gen. Journal Line"; AccNo: Code[20]; BalAccNo: Code[20]; Amount: Decimal; AmountAddCurr: Decimal; UseAmtAddCurr: Boolean)
    var
        GLEntry: Record "G/L Entry";
    begin
        OnBeforeInitGLEntryVAT(GenJnlLine, GLEntry);
        if UseAmtAddCurr then
            InitGLEntry(GenJnlLine, GLEntry, AccNo, Amount, AmountAddCurr, true, true)
        else begin
            InitGLEntry(GenJnlLine, GLEntry, AccNo, Amount, 0, false, true);
            GLEntry."Additional-Currency Amount" := AmountAddCurr;
            GLEntry."Bal. Account No." := BalAccNo;
        end;
        OnInitGLEntryVATOnBeforeSummarizeVAT(GenJnlLine, GLEntry, VATEntry);
        SummarizeVATFromInitGLEntryVAT(GLEntry, Amount);
        OnAfterInitGLEntryVAT(GenJnlLine, GLEntry);
    end;
    [IntegrationEvent(false, false)]
    local procedure OnInitGLEntryVATOnBeforeSummarizeVAT(GenJournalLine: Record "Gen. Journal Line"; var GLEntry: Record "G/L Entry"; VATEntry: Record "VAT Entry")
    begin
    end;

Additional context

You rejected the request recommending to use OnAfterCopyGLEntryFromGenJnlLine(Rec, GenJnlLine) in CopyFromGenJnlLine called from InitGLEntry. We are using OnAfterCopyGLEntryFromGenJnlLine to fill additional fields that are to be set in all G/L Entries. But some fields we would like to set only in G/L Entries created in InitGLEntryVAT, but in InitGLEntry/CopyFromGenJnlLine/OnAfterCopyGLEntryFromGenJnlLine we do not know where it is called from. Internal work item: AB#544405

AndersLarsenMicrosoft commented 1 week ago

Please reach out to mee on andersla@microsoft.com as you have submitted a lot of requests. We need to understand the priorities of those requests to adresse them in the right order. Some of them will be rejected if we see alternatives