Can you add an event OnCalcLineTotalOnAccountTotalingOnAfterGLAccountSetFilters in procedure CalcLineTotalWithBase? Example: procedure CalcLineTotalWithBase(VATStmtLine2: Record "VAT Statement Line"; var TotalAmount: Decimal; var TotalBase: Decimal; Level: Integer): Boolean var VATReportSetup: Record "VAT Report Setup"; begin if Level = 0 then begin TotalBase := 0; TotalAmount := 0; end; case VATStmtLine2.Type of VATStmtLine2.Type::"Account Totaling": begin GLAcc.SetFilter("No.", VATStmtLine2."Account Totaling"); if EndDateReq = 0D then EndDate := DMY2Date(31, 12, 9999) else EndDate := EndDateReq; GLAcc.SetRange("Date Filter", StartDate, EndDate); // New Event OnCalcLineTotalOnAccountTotalingOnAfterGLAccountSetFilters(VATStmtLine2,GLAcc); Amount := 0; if GLAcc.Find('-') and (VATStmtLine2."Account Totaling" <> '') then repeat GLAcc.CalcFields("Net Change", "Additional-Currency Net Change"); Amount := ConditionalAdd(Amount, GLAcc."Net Change", GLAcc."Additional-Currency Net Change"); until GLAcc.Next() = 0; OnCalcLineTotalOnBeforeCalcTotalAmountAccountTotaling(VATStmtLine2, VATEntry, Amount, UseAmtsInAddCurr); CalcTotalAmount(VATStmtLine2, TotalAmount, TotalBase); end;

[IntegrationEvent(false, false)] local procedure OnCalcLineTotalOnAccountTotalingOnAfterGLAccountSetFilters(VATStmtLine: Record "VAT Statement Line"; var GLAccount: Record "G/L Account") begin end;

© 2022 pullanswer.com - All rights reserved.