Please add 2 new events in codeunit 550 "VAT Rate Change Conversion" in function AddNewPurchaseLine

[IntegrationEvent(false, false)]
local procedure OnAddNewPurchaseLineOnBeforeNewPurchaseLineInsert(PurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line")
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAddNewPurchaseLineOnAfterNewPurchaseLineInsert(PurchaseLine: Record "Purchase Line"; var NewPurchaseLine: Record "Purchase Line")
begin
end;
PurchaseHeader.Get("Document Type", "Document No.");
RoundingPrecision := GetRoundingPrecision(PurchaseHeader."Currency Code");

if PurchaseHeader."Prices Including VAT" then
    Validate(
        "Direct Unit Cost",
        Round(PurchaseLine."Direct Unit Cost" * (100 + "VAT %") / (100 + PurchaseLine."VAT %"), RoundingPrecision))
else
    Validate("Direct Unit Cost", PurchaseLine."Direct Unit Cost");

Validate("Line Discount %", PurchaseLine."Line Discount %");
OnAddNewPurchaseLineOnBeforeNewPurchaseLineInsert(OldPurchaseLine, NewPurchaseLine);
Insert;
OnAddNewPurchaseLineOnAfterNewPurchaseLineInsert(OldPurchaseLine, NewPurchaseLine);
RecRef.GetTable(PurchaseLine);
VATRateChangeLogEntry.Init();
VATRateChangeLogEntry."Record ID" := RecRef.RecordId;
VATRateChangeLogEntry."Table ID" := RecRef.Number;
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: 47182.

0
© 2022 pullanswer.com - All rights reserved.