microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
785 stars 621 forks source link

[EventRequest] Tableextension 11705 "Purchase Header CZL".UpdateGlobalIsIntrastatTransaction #18628

Closed fridrichovsky closed 2 years ago

fridrichovsky commented 2 years ago

Please add new event

    local procedure UpdateGlobalIsIntrastatTransaction(): Boolean
    var
        CountryRegion: Record "Country/Region";
        //---------------------------------------OnBeforeUpdateGlobalIsIntrastatTransaction:BEGIN
        IsHandled: Boolean;
        Result: Boolean;
        //---------------------------------------OnBeforeUpdateGlobalIsIntrastatTransaction:END        
    begin
        //---------------------------------------OnBeforeUpdateGlobalIsIntrastatTransaction:BEGIN
        OnBeforeUpdateGlobalIsIntrastatTransaction(Rec, Result, IsHandled);
        if IsHandled then
            exit(Result);
        //---------------------------------------OnBeforeUpdateGlobalIsIntrastatTransaction:END

        if "EU 3-Party Intermed. Role CZL" then
            exit(false);
        if "Intrastat Exclude CZL" then
            exit(false);
        if IsCreditDocType() then
            exit(CountryRegion.IsIntrastatCZL("VAT Country/Region Code", true));
        if "VAT Country/Region Code" = "Ship-to Country/Region Code" then
            exit(false);
        if CountryRegion.IsLocalCountryCZL("Ship-to Country/Region Code", true) then
            exit(CountryRegion.IsIntrastatCZL("VAT Country/Region Code", true));
        exit(CountryRegion.IsIntrastatCZL("Ship-to Country/Region Code", true));
    end;    

    //---------------------------------------OnBeforeUpdateGlobalIsIntrastatTransaction:BEGIN
    [IntegrationEvent(true, false)]
    OnBeforeUpdateGlobalIsIntrastatTransaction(PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
    begin
    end;
    //---------------------------------------OnBeforeUpdateGlobalIsIntrastatTransaction:BEGIN
JesperSchulz commented 2 years ago

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.

Build ID: 42323.