ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 131300 "Library - ERM"

Open aobsgit opened this issue 5 years ago • 1 comments

Hi

Could you please add an integration event in CreateVATPostingSetupWithAccounts

procedure CreateVATPostingSetupWithAccounts(var VATPostingSetup: Record "VAT Posting Setup"; VATCalculationType: Enum 
"Tax Calculation Type"; VATRate: Decimal)
var
    VATBusinessPostingGroup: Record "VAT Business Posting Group";
    VATProductPostingGroup: Record "VAT Product Posting Group";
    isHandled: Boolean;
Begin

    >>>NEWCODE
    OnBeforeCreateVATPostingSetup(VATPostingSetup, VATCalculationType, VATRate, isHandled);
    if isHandled then
        exit;
    <<< END

    VATPostingSetup.Init();
    CreateVATBusinessPostingGroup(VATBusinessPostingGroup);
    CreateVATProductPostingGroup(VATProductPostingGroup);
    VATPostingSetup.Validate("VAT Bus. Posting Group", VATBusinessPostingGroup.Code);
    VATPostingSetup.Validate("VAT Prod. Posting Group", VATProductPostingGroup.Code);
    VATPostingSetup.Validate("VAT Calculation Type", VATCalculationType);
    VATPostingSetup.Validate("VAT %", VATRate);
    VATPostingSetup.Validate("VAT Identifier",
      LibraryUtility.GenerateRandomCode(VATPostingSetup.FieldNo("VAT Identifier"), DATABASE::"VAT Posting Setup"));
    VATPostingSetup.Validate("Sales VAT Account", CreateGLAccountNo);
    VATPostingSetup.Validate("Purchase VAT Account", CreateGLAccountNo);
    VATPostingSetup.Validate("Tax Category", 'S');
    VATPostingSetup.Insert(true);
end;

>>>NEW CODE
[IntegrationEvent(false, false)]
local procedure OnBeforeCreateVATPostingSetup(var VATPostingSetup: Record "VAT Posting Setup"; VATCalculationType: Enum "Tax Calculation Type"; VATRate: Decimal; var isHandled: Boolean)
begin
end;
<<< END

aobsgit avatar Feb 15 '21 15:02 aobsgit

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. We will update this issue with information about availability. 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.

JesperSchulz avatar Feb 20 '21 07:02 JesperSchulz