Shelf-Life Control in MySales Orders: Key Fields and Calculation Algorithms

Shelf-Life Control in MySales Orders: Key Fields and Calculation Algorithms

Shelf-Life Control in MySales Orders

For products with a limited shelf life, it is important not only to avoid OOS, but also not to create stock that the store will not have time to sell before it is written off.

In MySales, shelf-life control is part of the order calculation. The system takes into account forecast demand, available stock, future write-offs, and shelf-life control parameters to determine:

  • how much product needs to be replenished;

  • what stock volume remains permissible;

  • what part of the current stock will actually be available for future sales.

Parameters can be applied at the SKU or SKU × Store level.

How Shelf-Life Control Works

The logic can be presented in three steps:

  1. Determining the need
    MySales compares future demand with the stock that will be available for sale.

  2. Checking permissible stock
    Shelf term, Sh.life %, and Max SD help determine what stock level is permissible, taking shelf life into account.

  3. Accounting for future write-offs
    If part of the current stock expires before it can cover future demand, the system accounts for it as future Write-offs.

As a result, MySales works not only with physical stock, but with stock that will actually remain available for sale.

Main Parameters

Parameter

What it controls

Parameter

What it controls

Shelf term

The SKU’s shelf life and the basis for calculating future write-offs

Sh.life %

The portion of Shelf term taken into account when determining permissible stock

Max SD

Maximum stock in days of sales

Shelf limit

Enables or disables the application of shelf-life control

Waste limit

Target remaining stock taken into account during the calculation

% max SS

Maximum Safety Stock relative to Forecast D1D2

Shelf term — Shelf Life

Shelf term determines the product’s storage period.

The base value comes from the client’s system through the PRODUCTS.SHELF_DAYS field and is used for:

  • controlling permissible stock;

  • estimating future write-offs;

  • calculating Write-offs D1 and D1D2.

For example:

Shelf term = 10 days

The system takes into account that the stock must be sold within the corresponding period.

Shelf term is important not only for limiting the order. It also helps determine what part of the current stock may cease to be available for future sales.

Sh.life % — A Portion of Shelf Life

Sh.life % allows only a specified portion of Shelf term to be used in the calculation.

For example:

Shelf term = 30 days
Sh.life % = 50%

We get:

30 × 50% = 15 days

Therefore, permissible stock is based on approximately 15 days of sales, rather than all 30.

Sh.life % works together with Shelf term and does not replace Max SD.

Max SD — Maximum Stock in Days of Sales

Max SD sets the maximum stock level in days of forecast sales.

For example:

Max SD = 12

means that permissible stock is based on approximately 12 days of sales.

If Max SD is set, it is used as a separate limit on permissible stock instead of the calculation through Shelf term + Sh.life %.

At the same time, Shelf term continues to be used for the logic of future write-offs.

Shelf limit — Managing Shelf-Life Control

Shelf limit manages the application of shelf-life control.

If Shelf limit Is Active

The system takes into account:

  • Shelf term;

  • Sh.life %;

  • Max SD;

  • Write-offs D1 / D1D2;

  • permissible stock limits.

If Shelf limit Is Disabled

Shelf-life restrictions are not applied to the order calculation within this logic.

This allows shelf-life control to be managed separately for the corresponding SKU or SKU × Store.

Waste limit — Target Remaining Stock

Waste limit sets the target remaining stock level that is additionally taken into account during the order calculation.

It should not be interpreted as an unconditional +Nunits added to the order.

For example, if the base need is:

6 units

and Waste limit provides for additional target remaining stock of:

1 unit

the system may use:

6 + 1 = 7

if this does not violate other permissible stock limits.

% max SS — A Limit on Safety Stock

The % max SS parameter limits the maximum Safety Stock relative to Forecast D1D2.

For example:

Forecast D1D2 = 20
% max SS = 50%

Maximum Safety Stock:

20 × 50% = 10

If the calculated Safety Stock exceeds the set limit, it is capped at the corresponding value.

This helps control situations where excessive safety stock may increase the risk of overstock for products with a short shelf life.

How the Parameters Affect the Order

For a simplified explanation, the base need can be presented as follows:

Need = Forecast − Available Stock

After this, MySales takes into account Safety Stock, Presentation Stock, future write-offs, and shelf-life restrictions.

Simplified logic:

Forecast + available Stock
↓
Need calculation
↓
Safety Stock / Presentation Stock
↓
Shelf-life control
↓
Permissible stock limits: Shelf term + Sh.life % or Max SD, if it is set
↓
Waste limit / % max SS
↓
Final order quantity

This diagram shows the role of the parameters in the calculation, rather than the technical order of code execution.

If Stock Is Insufficient

MySales determines the quantity required to cover future demand.

At the same time, the system checks whether the new order will create stock that exceeds the permissible level, taking shelf life into account.

Therefore, even if the product needs to be replenished, the final quantity may be limited.

If Stock Is Sufficient or Excessive

If available stock is already sufficient to cover future needs, the system may:

  • not generate a new order;

  • reduce it;

  • limit the quantity to avoid creating excess stock.

Thus, MySales simultaneously controls two risks:

OOS — there is not enough product to cover demand;
Overstock / Write-offs — there is more stock than can actually be sold.

Calculation Example

Suppose:

  • Forecast = 10 units;

  • Stock = 4 units;

  • Shelf term = 30 days;

  • Sh.life % = 50%;

  • Max SD = 12 days;

  • Waste limit = 1;

  • Forecast D1D2 = 20 ;

  • % max SS = 50% .

1. Determine the Base Need

Need = 10 − 4 = 6

To cover forecast demand, 6 units need to be replenished.

2. Check Shelf term + Sh.life %

30 × 50% = 15 days

Without Max SD, permissible stock would be based on approximately 15 days of sales.

3. Take Max SD into Account

Max SD = 12 days

Since Max SD is set, permissible stock is limited to a level covering approximately 12 days of forecast sales.

4. Take Waste limit into Account

Base need:

6

Target additional remaining stock:

1

The system may use:

6 + 1 = 7

if this does not violate the set shelf-life restrictions.

5. Check % max SS

20 × 50% = 10

The maximum Safety Stock in this example is 10 units.

Result

The final quantity is determined not by a single parameter, but by a combination of forecast need, available stock, Safety Stock, and shelf-life restrictions.

How Write-offs D1 and D1D2 Are Taken into Account

Shelf-life control affects not only maximum stock, but also what remaining stock the system considers actually available to cover future demand.

In replenishment logic, D1 and D1D2 are calculation horizons associated with the upcoming deliveries.

Write-offs D1 / D1D2 show what part of the stock may be written off during the corresponding horizon.

If the product is physically in stock but will expire by the time it is needed to cover demand, such stock should not be considered fully available.

How Shelf term Is Related to Write-Offs

Shelf term helps determine when stock will cease to be suitable for sale.

For example:

Shelf term = 10 days

means that when forecasting available stock, the system takes into account its limited period of use.

If part of the product is to be written off before the corresponding D1 or D1D2 horizon, it is accounted for as future Write-offs.

How Max SD Is Related to Write-Offs

Max SD performs a different function.

It controls maximum permissible stock in days of sales, but does not itself determine when the product is written off.

Therefore:

  • Shelf term is responsible for shelf life and is related to Write-offs;

  • Max SD controls the permissible stock level.

These parameters address different tasks and complement each other.

Example: The Product Is Physically Available but Will Soon Be Written Off

Suppose:

  • Stock = 100;

  • part or all of the stock is approaching the end of its shelf life;

  • this stock is expected to no longer be suitable for sale by the next calculation horizon.

Physically, the system sees:

Stock = 100

But if:

Write-offs D1 = 100

then this stock can effectively no longer be considered available to cover future demand.

This is precisely why MySales distinguishes between:

“How much product is physically available?”

and

“How much product will actually remain available for future sales?”

Result

Shelf-life control in MySales helps find a balance between two main risks:

OOS
there is not enough product to cover future demand;

Overstock / Write-offs
there is more product than can be sold before the end of its shelf life.

To do this, the system takes into account:

  • Shelf term;

  • Sh.life %;

  • Max SD;

  • Shelf limit;

  • Waste limit;

  • % max SS;

  • Forecast;

  • available stock;

  • Write-offs D1 / D1D2;

  • Safety Stock;

  • Presentation Stock.

As a result, MySales answers not only the question:

“How much product needs to be ordered?”

but also a more important one:

“How much product is reasonable to order to cover future demand while avoiding the creation of stock that will not have time to sell before the end of its shelf life?”