Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EVENT REQUEST] Codeunit 5790 (Available to Promise) #28028

Open
MarkusW-BSG opened this issue Jan 30, 2025 · 0 comments
Open

[EVENT REQUEST] Codeunit 5790 (Available to Promise) #28028

MarkusW-BSG opened this issue Jan 30, 2025 · 0 comments

Comments

@MarkusW-BSG
Copy link

MarkusW-BSG commented Jan 30, 2025

Describe the request

In this codeunit, for calculation of the availability to promise every sub-procedure etc. has events to customize the code.

For calculation of CalcEarliestAvailabilityDate this is not the case (or only for parts of the code).

CalculateAvailability and all its sub-parts have events

New event - UpdateAvailability

UpdateAvailabilityOnBeforeInsertModify(var AvailabilityAtDate: Record "Availability at Date"; Date: Date; var ScheduledReceipt: Decimal; var GrossRequirement: Decimal)

Call
AvailabilityAtDate."Scheduled Receipt" += ScheduledReceipt;
AvailabilityAtDate."Gross Requirement" += GrossRequirement;

UpdateAvailabilityOnBeforeInsertModify(...)

if RecordExists then
AvailabilityAtDate.Modify()
else
AvailabilityAtDate.Insert();

New event - CalculateAvailabilityByPeriod

CalculateAvailabilityByPeriodOnBeforeDeleteAvailabilityAtDate(var AvailabilityInPeriod: Record "Availability at Date";AvailabilityAtDate: Record "Availability at Date")

Call
repeat
AvailabilityInPeriod."Scheduled Receipt" += AvailabilityAtDate."Scheduled Receipt";
AvailabilityInPeriod."Gross Requirement" += AvailabilityAtDate."Gross Requirement";
CalculateAvailabilityByPeriodOnBeforeDeleteAvailabilityAtDate(...)
AvailabilityAtDate.Delete();
until AvailabilityAtDate.Next() = 0;

Existing event - OnCalcEarliestAvailabilityDateOnBeforeFilterDate

Parameters of this event are not sufficient to replace the code it should be used for.

New Parameters
ExcludeOnDate: Date

New Event - CalculateAvailabilityByPeriod

CalculateAvailabilityByPeriodOnBeforeNextTempAvailabilityAtDate(AvailabilityAtDate: Record "Availability at Date")

Call
repeat
if PeriodStart = 0D then
PeriodStart := TempAvailabilityAtDate."Period Start";
ScheduledReceipt += TempAvailabilityAtDate."Scheduled Receipt";
GrossRequirement += TempAvailabilityAtDate."Gross Requirement";
CalculateAvailabilityByPeriodOnBeforeNextTempAvailabilityAtDate(...)
until TempAvailabilityAtDate.Next() = 0;

New Event - CalculateAvailabilityByPeriod

CalculateAvailabilityByPeriodOnAfterCalculateAvailableQty(var AvailableQty: decimal;var Item: Record "Item"; ScheduledReceipt: decimal; GrossRequirement: decimal)

Call
AvailableQty := Item.Inventory - Item."Reserved Qty. on Inventory" + ScheduledReceipt - GrossRequirement;
CalculateAvailabilityByPeriodOnAfterCalculateAvailableQty(...)
if AvailableQty >= NeededQty then begin

Existing Event - OnBeforeUpdateAsmCompAvail

Parameters of this event are not sufficient to replace the code it should be used for.
New Parameter is needed for function AreEqualAssemblyLines

New Parameters
ChangedAssemblyLine: Record "Assembly Line";

Additional context

In Steel Industry, one quantity is not enough for any process. Therefore our current Business Central is customized for using a second quantity. Every item has furthermore two inventories instead of one. An inventory measured by the base UOM (the standard) and a second one measure by its second UOM.

Example:
A customer orders approx. 2 tons of steel sheets, /.100 pieces.
Quantity: 2000
UOM: KG
Sec. Quantity: 100
Sec. UOM: PCE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant