ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 7002 "Price Calculation - V16" implements "Price Calculation" -> OnAfterCalcBestAmount

Open innonav-dev opened this issue 4 years ago • 1 comments

Could you please integrate the event OnAfterCalcBestAmount?

procedure CalcBestAmount(AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceListLine: Record "Price List Line") FoundBestPrice: Boolean;
var
    BestPriceListLine: Record "Price List Line";
begin
    OnBeforeCalcBestAmount(AmountType, PriceCalculationBufferMgt, PriceListLine);
    PriceListLine.SetRange(Status, PriceListLine.Status::Active);
    if PriceListLine.FindSet() then
        repeat
            if PriceCalculationBufferMgt.IsInMinQty(PriceListLine) then begin
                PriceCalculationBufferMgt.ConvertAmount(AmountType, PriceListLine);
                PickBestLine(AmountType, PriceListLine, BestPriceListLine, FoundBestPrice);
            end;
        until PriceListLine.Next() = 0;
    if FoundBestPrice then
        PriceListLine := BestPriceListLine;
    //New Event    
    OnAfterCalcBestAmount(AmountType, PriceCalculationBufferMgt, PriceListLine);
end;

[IntegrationEvent(false, false)]
local procedure OnAfterCalcBestAmount(AmountType: Enum "Price Amount Type"; var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; var PriceListLine: Record "Price List Line")
begin
end;

innonav-dev avatar Jul 07 '22 13:07 innonav-dev

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

JesperSchulz avatar Jul 27 '22 18:07 JesperSchulz