Calculating availability
The reports for the availableSupplyChange.v2
,
productAvailability.v2
and dgAvailabilityChange.v2
events have
total availability, which includes safety stock that is withheld.
Suppose today is January 1 and the supplies in the system are as follows:
Supply1
=lowDate
till February 1 - 10 qtySupply2
=lowDate
till March 1 - 12 qtyNote:lowDate
refers to any old date in the past. Here,lowDate
is considered as 1900-01-01.
Demand
= 3 qty and Safety
for SHP = 21 qty.The events of
availableSupplyChange.v2
, productAvailability.v2
,
and dgAvailabilityChange.v2
look as follows:availableSupplyChange.v2
fromTs
of the first availability window is thelowDate
which is 1900,toTs
is February 1, andsupplyQuantity
is theSupply1
which is 10 qty.- The
demand
of 3 qty is matched with theSupply2
of 12 qty that makes thedemand
quantity as 3 in the second block. - For the
safety = 21 qty
,consumedSafetyQuantity
becomes 10 qty for the first availability block and remaining is 21 - 10 = 11 qty for safety.
- The 11 qty of safety gets adjusted with the next supply on
Supply2
. fromTs
of the second availability window is thelowDate
which is 1900,toTs
is March 1, andsupplyQuantity
is theSupply2
which is 12 qty.- With the active supply of 12 qty and the
demand = 3 qty
adjusted, theconsumedSafetyQuantity
becomes 9 qty. - The remaining 2 qty of
safety
goes insafetyShortage
.
To calculate the availability without considering safety in any of the events, you can manually compute the availability for each block with the following formula.{ "availableQuantity" : 0.0, "consumedSafetyQuantity" : 10.0, "demandQuantity" : 0.0, "demandShortage" : 0.0, "fromTs" : "1900-01-01T00:00:00.000Z", "fulfillmentAllowed" : true, "reservationShortage" : 0.0, "reservedQuantity" : 0.0, "safetyShortage" : 0.0, "shortageQuantity" : 0.0, "supplyQuantity" : 10.0, "toTs" : "2024-02-01T00:00:00.000Z" }, { "availableQuantity" : 0.0, "consumedSafetyQuantity" : 9.0, "demandQuantity" : 3.0, "demandShortage" : 0.0, "fromTs" : "1900-01-01T00:00:00.000Z", "fulfillmentAllowed" : true, "reservationShortage" : 0.0, "reservedQuantity" : 0.0, "safetyShortage" : 2.0, "shortageQuantity" : 2.0, "supplyQuantity" : 12.0, "toTs" : "2024-03-01T00:00:00.000Z" }
Availability without considering safety = availableQuantity + consumedSafetyQuantity
For more information on definitions, see definitions.
Note:shortageQuantity
=demandShortage
+reservationShortage
+safetyShortage
.productAvailability.v2
- In the
productAvailability.v2
event, availability is represented using time ranges and not absolute dates.
During bothSupply1
andSupply2
, the supplies are active during the period that is represented bycurrentAvailability
block.- The
supplyQuantity
forcurrentAvailability
is the sum of supplies forSupply1
andSupply2
. - The
consumedSafetyQuantity
is defined assafety
that we can withheld with the available supply.
- The
futureAvailability
block considers only theSupply2
.
To calculate the availability without considering safety in any of the events, you can manually compute the availability for each block with the following formula."currentAvailability" : { "availableQuantity" : 0.0, "consumedSafetyQuantity" : 19.0, "demandQuantity" : 3.0, "demandShortage" : 0.0, "fulfillmentAllowed" : true, "reservationShortage" : 0.0, "reservedQuantity" : 0.0, "safetyShortage" : 2.0, "shortageQuantity" : 2.0, "supplyQuantity" : 22.0, "thresholdLevel" : 3, "toTs" : "2024-02-01T00:00:00.000Z" }, "futureAvailability" : [ { "availableQuantity" : 0.0, "consumedSafetyQuantity" : 9.0, "demandQuantity" : 3.0, "demandShortage" : 0.0, "fromTs" : "2020-02-01T00:00:00.000Z", "fulfillmentAllowed" : true, "reservationShortage" : 0.0, "reservedQuantity" : 0.0, "safetyShortage" : 2.0, "shortageQuantity" : 2.0, "supplyQuantity" : 12.0, "toTs" : "2024-03-01T00:00:00.000Z" } ]
When the tenant level ruleAvailability without considering safety = availableQuantity + consumedSafetyQuantity
event.alwaysPublishEventForDelMethod
is enabled with delivery method and event is published despite fulfillment being disabled, then use the following formula to calculate the availability:MAX(supplyQuantity - demandQuantity - reservedQuantity-reservationShortage, 0)
For more information on definitions, see definitions.Note:shortageQuantity
=demandShortage
+reservationShortage
+safetyShortage
. - The
dgAvailabilityChange.v2
- The example is similar to
productAvailability.v2
. For more information, see productAvailability.v2.