ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 99000845 Reservation Management - function CalcReservedQtyOnPick

Open Phfo opened this issue 6 years ago • 3 comments

A request at the end of this local procedure to adjust (recalculate) the results of AllocQty & AvailQty -> params - all the fields used for calculation

**_AllocQty := WhseActivLine."Qty. Outstanding (Base)" + QtyOnInvtMovement + QtyOnOutboundBins + QtyOnSpecialBins; PickQty := WhseActivLine."Qty. Outstanding (Base)" + QtyOnInvtMovement;

AvailQty :=
          Item.Inventory - PickQty - QtyOnOutboundBins - QtyOnSpecialBins -
          Item."Reserved Qty. on Inventory" + QtyReservedOnPickShip;_**

Phfo avatar Jul 01 '20 15:07 Phfo

Please provide the signature of the event along with the fragments of code that could define location of the event call unambiguously. The best way is to copy the actual AL code you would implement.

StanPesotskiy avatar Jul 03 '20 08:07 StanPesotskiy

in codeunit reservation management :

local procedure CalcReservedQtyOnPick(var AvailQty: Decimal; var AllocQty: Decimal) ... IsHandled := false; OnCalcReservedQtyOnPickOnbeforeSetAllocQty(WhseActivLine."Qty. Outstanding (Base)", QtyOnInvtMovement, QtyOnOutboundBins, QtyOnSpecialBins, AllocQty, IsHandled); if not IsHandled then AllocQty := WhseActivLine."Qty. Outstanding (Base)" + QtyOnInvtMovement + QtyOnOutboundBins + QtyOnSpecialBins;

        IsHandled := false;
        OnCalcReservedQtyOnPickOnbeforeSetPickQty(WhseActivLine."Qty. Outstanding (Base)", QtyOnInvMovement, PickQty, 
              IsHandled);
        if not IsHandled then
            PickQty := WhseActivLine."Qty. Outstanding (Base)" + QtyOnInvtMovement;

        IsHandled := false;
        OnCalcReservedQtyOnPickOnbeforeSetAvailQty(Item.Inventory, PickQty, QtyOnOutboundBins, QtyOnSpecialBins, 
                 Item."Reserved Qty. on Inventory", QtyReservedOnPickShip,
                 Item."Reserved Qty. on Inventory", QtyReservedOnPickShip, AvailQty, IsHandled)
        If not IsHandled then 
            AvailQty := Item.Inventory - PickQty - QtyOnOutboundBins - QtyOnSpecialBins - Item."Reserved Qty. on Inventory" + 
                               QtyReservedOnPickShip;            
    end;

end;

...

** 3 Events**

[IntegrationEvent(false, false)]
local procedure OnCalcReservedQtyOnPickOnbeforeSetAllocQty(WhseActivLine."Qty. Outstanding (Base)" decimal, 
                          QtyOnInvtMovement decimal, QtyOnOutboundBins decimal,  QtyOnSpecialBins decimal, var AllocQty 
                         decimal,  var IsHandled boolean);
begin
end;

[IntegrationEvent(false, false)]
local procedure OnCalcReservedQtyOnPickOnbeforeSetPickQty("WhseActivLineQtyOutstanding (Base)" decimal, 
                          QtyOnInvMovement decimal, PickQty decimal, 
                          QtyOnSpecialBins decimal, var PickQty decimal,  var IsHandled boolean);
begin
end;

[IntegrationEvent(false, false)]
local procedure OnCalcReservedQtyOnPickOnbeforeSetAvailQty(ItemInventory decimal, PickQty decimal, 
                          QtyOnOutboundBins decimal, QtyOnSpecialBins decimal, ItemReservedQtyonInventory decimal, 
                          QtyReservedOnPickShip decimal, ItemReservedQtyonInventory decimal, QtyReservedOnPickShip decimal, var 
                          AvailQty decimal, var IsHandled boolean)
begin
end;

Phfo avatar Jul 06 '20 09:07 Phfo

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.

bc-ghost avatar Jul 08 '20 06:07 bc-ghost