Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Report 12 "VAT Statement" - OnAfterVATEntrySetFilters #27704

Open
TriangleSPV opened this issue Nov 26, 2024 · 0 comments
Open
Labels
event-request Request for adding an event Finance GitHub request for Finance area

Comments

@TriangleSPV
Copy link

TriangleSPV commented Nov 26, 2024

Describe the request

Current code:

local procedure CalcLineFromVATEntry1C(VATStatementLine: Record "VAT Statement Line")
begin
    VATEntry.Reset();
    SetVATEntryKeyAndRangesForVATDate(VATStatementLine);

    VATEntry.SetRange(Type, VATStatementLine."Gen. Posting Type");
    SetVATDate("VAT Statement Line");

    case Selection of
        Selection::Open:
            VATEntry.SetRange(Closed, false);
        Selection::Closed:
            VATEntry.SetRange(Closed, true);
        else
            VATEntry.SetRange(Closed);
    end;
    if VATEntry.FindFirst() then;
    case VATStatementLine."Amount Type" of
        VATStatementLine."Amount Type"::Amount:

Requested:

local procedure CalcLineFromVATEntry1C(VATStatementLine: Record "VAT Statement Line")
begin
    VATEntry.Reset();
    SetVATEntryKeyAndRangesForVATDate(VATStatementLine);

    VATEntry.SetRange(Type, VATStatementLine."Gen. Posting Type");
    SetVATDate("VAT Statement Line");

    case Selection of
        Selection::Open:
            VATEntry.SetRange(Closed, false);
        Selection::Closed:
            VATEntry.SetRange(Closed, true);
        else
            VATEntry.SetRange(Closed);
    end;

    OnAfterVATEntrySetFilters(VATStatementLine, VATEntry);  //NEW CODE

    if VATEntry.FindFirst() then;
    case VATStatementLine."Amount Type" of
        VATStatementLine."Amount Type"::Amount:

//NEW LINES
[IntegrationEvent(false, false)]
local procedure OnAfterVATEntrySetFilters(VATStatementLine: Record "VAT Statement Line"; var VATEntry: Record "VAT Entry")
begin
end;
//NEW LINES

Additional context

We need an event to modify filters in VATEntries when calculating VAT Statement lines with Type = "VAT Entry Totaling", as it works for Type "EC Entry Totaling" in event OnCalcLineTotalOnVATEntryTotalingOnAfterVATEntrySetFilters.
Internal work item: AB#558866

@ChethanT ChethanT added event-request Request for adding an event Finance GitHub request for Finance area labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event Finance GitHub request for Finance area
Projects
None yet
Development

No branches or pull requests

2 participants