Please add new event in codeunit 550 "VAT Rate Change Conversion" in function UpdatePurchase: OnUpdatePurchaseOnAfterPurchaseLineFilter

[IntegrationEvent(true, false)]
local procedure OnUpdatePurchaseOnAfterPurchaseLineFilter(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header")
begin
end;
local procedure UpdatePurchase()
var
    PurchaseHeader: Record "Purchase Header";
    PurchaseHeader2: Record "Purchase Header";
    PurchaseLine: Record "Purchase Line";
    PurchaseLineOld: Record "Purchase Line";
    VATRateChangeLogEntry: Record "VAT Rate Change Log Entry";
    RecRef: RecordRef;
    NewVATProdPotingGroup: Code[20];
    NewGenProdPostingGroup: Code[20];
    StatusChanged: Boolean;
    ConvertVATProdPostingGroup: Boolean;
    ConvertGenProdPostingGroup: Boolean;
    RoundingPrecision: Decimal;
    IsHandled: Boolean;
    IsModified: Boolean;
begin
    ProgressWindow.Update(1, PurchaseHeader.TableCaption);

    ConvertVATProdPostingGroup := ConvertVATProdPostGrp(VATRateChangeSetup."Update Purchase Documents");
    ConvertGenProdPostingGroup := ConvertGenProdPostGrp(VATRateChangeSetup."Update Purchase Documents");
    if not ConvertVATProdPostingGroup and not ConvertGenProdPostingGroup then
        exit;

    IsHandled := false;
    OnBeforeUpdatePurchase(VATRateChangeSetup, IsHandled);
    if IsHandled then
        exit;

    PurchaseHeader.SetFilter(
        "Document Type", '%1..%2|%3', PurchaseHeader."Document Type"::Quote, PurchaseHeader."Document Type"::Invoice,
        PurchaseHeader."Document Type"::"Blanket Order");
    OnUpdatePurchaseOnAfterPurchaseHeaderSetFilters(PurchaseHeader);
    if PurchaseHeader.Find('-') then
        repeat
            StatusChanged := false;
            if CanUpdatePurchase(PurchaseHeader, ConvertGenProdPostingGroup, ConvertVATProdPostingGroup) then begin
                if VATRateChangeSetup."Ignore Status on Purch. Docs." then
                    if PurchaseHeader.Status <> PurchaseHeader.Status::Open then begin
                        PurchaseHeader2 := PurchaseHeader;
                        PurchaseHeader.Status := PurchaseHeader.Status::Open;
                        PurchaseHeader.Modify();
                        StatusChanged := true;
                    end;
                if PurchaseHeader.Status = PurchaseHeader.Status::Open then begin
                    PurchaseLine.SetRange("Document Type", PurchaseHeader."Document Type");
                    PurchaseLine.SetRange("Document No.", PurchaseHeader."No.");
                    OnUpdatePurchaseOnAfterPurchaseLineFilter(PurchaseLine, PurchaseHeader);
0

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: 45057.

0
© 2022 pullanswer.com - All rights reserved.