Why do you need this change?
We need to read the next VAT entry number after a G/L posting cycle completes, together with the G/L register record and the other entry counters. When a G/L posting cycle follows another posting context that already created VAT entries, the VAT entry numbering must continue from the prior context rather than starting from freshly queried database values.
The standard Code procedure calls FinishPosting which finalizes GLReg."To VAT Entry No." from NextVATEntryNo. After FinishPosting returns, OnAfterGLFinishPosting fires with GLReg, NextEntryNo, and NextTransactionNo as var parameters. However, NextVATEntryNo is not included, even though it is part of the same register state and was just used to set GLReg."To VAT Entry No.".
The existing OnAfterFinishPosting event fires inside FinishPosting and also does not include NextVATEntryNo. No event currently exposes NextVATEntryNo together with the other register fields after a posting cycle.
Describe the request
Add var NextVATEntryNo: Integer to the existing integration event OnAfterGLFinishPosting in the Code procedure in Codeunit 12 "Gen. Jnl.-Post Line". The new parameter follows the existing parameters at the end.
OnCodeOnBeforeFinishPosting(GenJnlLine, Balancing, FirstEntryNo);
IsTransactionConsistent := FinishPosting(GenJnlLine);
end;
OnAfterGLFinishPosting(
GlobalGLEntry, GenJnlLine, IsTransactionConsistent, FirstTransactionNo, GLReg, TempGLEntryBuf,
NextEntryNo, NextTransactionNo, NextVATEntryNo); // <---- New parameter at end
GLEntryInconsistent := not IsTransactionConsistent;
end;
Event Signature:
[IntegrationEvent(false, false)]
local procedure OnAfterGLFinishPosting(GLEntry: Record "G/L Entry"; var GenJnlLine: Record "Gen. Journal Line"; var IsTransactionConsistent: Boolean; FirstTransactionNo: Integer; var GLRegister: Record "G/L Register"; var TempGLEntryBuf: Record "G/L Entry" temporary; var NextEntryNo: Integer; var NextTransactionNo: Integer; var NextVATEntryNo: Integer)
begin
end;
Alternatives evaluated: OnAfterFinishPosting fires inside FinishPosting and passes GLReg as var but does not include NextVATEntryNo or NextTransactionNo. OnBeforeFinishPosting fires at the start of FinishPosting before G/L entries are inserted and before GLReg."To VAT Entry No." is set, so the register state is not yet final. OnAfterSettingIsTransactionConsistent fires before G/L entries are inserted. No event currently exposes NextVATEntryNo as var after a G/L posting cycle completes.
Internal work item: AB#639377
Why do you need this change?
We need to read the next VAT entry number after a G/L posting cycle completes, together with the G/L register record and the other entry counters. When a G/L posting cycle follows another posting context that already created VAT entries, the VAT entry numbering must continue from the prior context rather than starting from freshly queried database values.
The standard
Codeprocedure callsFinishPostingwhich finalizesGLReg."To VAT Entry No."fromNextVATEntryNo. AfterFinishPostingreturns,OnAfterGLFinishPostingfires withGLReg,NextEntryNo, andNextTransactionNoasvarparameters. However,NextVATEntryNois not included, even though it is part of the same register state and was just used to setGLReg."To VAT Entry No.".The existing
OnAfterFinishPostingevent fires insideFinishPostingand also does not includeNextVATEntryNo. No event currently exposesNextVATEntryNotogether with the other register fields after a posting cycle.Describe the request
Add
var NextVATEntryNo: Integerto the existing integration eventOnAfterGLFinishPostingin theCodeprocedure in Codeunit 12 "Gen. Jnl.-Post Line". The new parameter follows the existing parameters at the end.Event Signature:
Alternatives evaluated:
OnAfterFinishPostingfires insideFinishPostingand passesGLRegasvarbut does not includeNextVATEntryNoorNextTransactionNo.OnBeforeFinishPostingfires at the start ofFinishPostingbefore G/L entries are inserted and beforeGLReg."To VAT Entry No."is set, so the register state is not yet final.OnAfterSettingIsTransactionConsistentfires before G/L entries are inserted. No event currently exposesNextVATEntryNoasvarafter a G/L posting cycle completes.Internal work item: AB#639377