Why do you need this change?
We need a way to calculate DueDate differently.
At the moment there are no other available events to do that. It is necessary to include the event as last line of the procedure in order to be able to overwrite the already calculate DueDate.
Describe the request
In procedure CalcCompDueDate of codeunit 5870 "Calculate BOM Tree" we need an event:
[IntegrationEvent(false, false)]
local procedure OnAfterCalcCompDueDate(var DueDate: Date; DemandDate: Date; ParentItem: Record Item; LeadTimeOffset: DateFormula)
begin
end;
Changes between **:
procedure CalcCompDueDate(DemandDate: Date; ParentItem: Record Item; LeadTimeOffset: DateFormula) DueDate: Date
var
InventorySetup: Record "Inventory Setup";
EndDate: Date;
StartDate: Date;
begin
if DemandDate = 0D then
exit;
EndDate := DemandDate;
if Format(ParentItem."Safety Lead Time") <> '' then
EndDate := DemandDate - (CalcDate(ParentItem."Safety Lead Time", DemandDate) - DemandDate)
else
if InventorySetup.Get() and (Format(InventorySetup."Default Safety Lead Time") <> '') then
EndDate := DemandDate - (CalcDate(InventorySetup."Default Safety Lead Time", DemandDate) - DemandDate);
if Format(ParentItem."Lead Time Calculation") = '' then
StartDate := EndDate
else
StartDate := EndDate - (CalcDate(ParentItem."Lead Time Calculation", EndDate) - EndDate);
if Format(LeadTimeOffset) = '' then
DueDate := StartDate
else
DueDate := StartDate - (CalcDate(LeadTimeOffset, StartDate) - StartDate);
**OnAfterCalcCompDueDate(DueDate, DemandDate, ParentItem, LeadTimeOffset);**
end;
Internal work item: AB#640604
Why do you need this change?
We need a way to calculate DueDate differently.
At the moment there are no other available events to do that. It is necessary to include the event as last line of the procedure in order to be able to overwrite the already calculate DueDate.
Describe the request
In procedure CalcCompDueDate of codeunit 5870 "Calculate BOM Tree" we need an event:
Changes between **:
Internal work item: AB#640604