[Event Request] Report 20 "Calc. and Post VAT Settlement" -OnClosingGLAndVATEntryOnAfterIncrementGenPostingType
Hi,
We would like to request an event in Report 20 "Calc. and Post VAT Settlement".
We wanted to update the VAT Entry filters based on the VAT type Sales and/or Purchase which will allow our customers to filter Sales VAT entry with the VAT Prod. Posting group (or any other field) and Purchase VAT entry with different VAT Prod. Posting group (or any other field). Thus allowing them to have more control over the VAT Entries.
This can be achieved by implementing the following event:
Event signature:
[IntegrationEvent(true, false)]
local procedure OnClosingGLAndVATEntryOnAfterIncrementGenPostingType(VATPostingSetup: Record "VAT Posting Setup"; VATType: enum "General Posting Type"; var VATEntry: Record "VAT Entry")
begin
end;
Code: ` trigger OnAfterGetRecord() ..
case "VAT Posting Setup"."VAT Calculation Type" of
"VAT Posting Setup"."VAT Calculation Type"::"Normal VAT",
"VAT Posting Setup"."VAT Calculation Type"::"Reverse Charge VAT",
"VAT Posting Setup"."VAT Calculation Type"::"Full VAT":
begin
VATEntry.SetCurrentKey(Type, Closed, "VAT Bus. Posting Group", "VAT Prod. Posting Group", "Posting Date");
if FindFirstEntry then begin
if not VATEntry.Find('-') then
repeat
VATType := IncrementGenPostingType(VATType);
VATEntry.SetRange(Type, VATType);
OnClosingGLAndVATEntryOnAfterIncrementGenPostingType("VAT Posting Setup", VATType, VATEntry);
until (VATType = VATEntry.Type::Settlement) or VATEntry.Find('-');
FindFirstEntry := false;
end else begin
if VATEntry.Next = 0 then
repeat
VATType := IncrementGenPostingType(VATType);
VATEntry.SetRange(Type, VATType);
OnClosingGLAndVATEntryOnAfterIncrementGenPostingType("VAT Posting Setup", VATType, VATEntry);
until (VATType = VATEntry.Type::Settlement) or VATEntry.Find('-');
end;
if IsNotSettlement(VATType) then
VATEntry.Find('+');
end;
`
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.