Stock Advice Replenishment Rules
You can find Stock Advice replenishment rules in component 3342 Novulo Stock Advice. The advantage of using auxiliary expressions is that, if set up correctly, you are very flexible in determining:
1. which stock thresholds I want to includ e
2. how the exact quantity determination of the stock advice rules is performe d
For example: if you later realize that, in addition to the minimum and maximum stock, it is also important to include the minimum order quantity, or if you want to refine the determination of this further, you can do so by adjusting the expression, and you do not need to perform a new rollout of the applicati on.
This explanation is intended to provide insight into and serve as a starting point for using replenishment rules and auxiliary expressions for stock adv ice.
Defining a replenishment rule
Which stock conditions are examined is defined in the ‘stock_level_thresholds_to_consider_where’ field of the replenishment rule. For example: only products that have a standard purchase price list item, products with a specific status, those defined for the warehouse to which the stock recommendation relates , etc.
How the final quantity is determined is also defined in an expression ‘adviced_quantity_per_stock_ level’.
You can also record an explanation of how the recommended quantity was determined in the field ‘explanation_of_calculation’. This only applies if you have enabled the setting ‘create_an_application_log_with_an_explanatio n_of_t’.
Additionally, you specify from which warehouse the replenishment takes place: ‘warehouse_to_be_source d _from’.
For a replenishment rule, one or more helper expressions can b e defined.
The helper expression consists of a helper key (the name under which the value can be accessed), a data type, an expression, a sequence, and a remark.
The context of the expression is Stock levels, the Parent context is Purch ase advice.
On the stock advice template, in simple mode (Use advanced settings=No), there is a setting indicating that you are using replenishment rule(s): Use replenis hment rules.
A prerequisite is therefore that one or more replenishment rules have been defined for the stock adv ice template.
How are the helper ex pressions used
If you are going to create a new set of stock advice rules in a stock advice (e.g.: Generate advice button), you enter the process ‘Stock advice - Generate advice with background option from record’, from there into the process ‘PurchaseAdvice - Generate advice with error logging’, and from there into ‘PurchaseAdvice - G enerate advice’
Then, if configured, the requirements from the open stock destination (sales rules) are first added ‘N_Purchase advice - For open stock destinations (SR59323)’. These stock advice rules relate to sales rules, which partly determine what you ultimately want to replenish based on the replenishment rules. For the setting ‘use_replenishment_rules_for_stock_levels’, the replenishment rules are called via the process ‘Stock advice for stock le vel with rules’.
For each replenishment rule, ‘Replenishment advice - ensure PAL for advice and rule’ is called. First, the stock thresholds to be examined are determined (Evaluate stock levels (stock conditions)) via the expression ‘stock_level_thresholds_t o_consider_where’
Then the expression for calculating the quantity is retrieved (Cache expression for calculation of qty) =’adviced_quantit y_per_stock_level’
Then the expression for the supplier: ‘s upplier_to_be_used’
Then the expression for explaining the calculation (CacheValue - Cache expression for explanation): ‘explana tion_of_calculation’
Then the expression for the warehouse (Cache expression for stock location): ‘warehouse _to_be_sourced_from’.
Then all helper expressions are retrieved (Cache helper expressions for qty)
Subsequently, for each stock threshold (from Evaluate stock lev els (stock conditions):
The valuesfor the helper expressions are determined in the process‘Evaluate helper expressions for stock levels and suppliers’. This returns a list of all eval uated helper expressions
Subsequently the desired quantity is determined using the list of evaluated auxiliary expressions as placeholders (Eva luate expression for qty)
Then the supplier is dete rmined. Then the warehouse
Subsequently, a stock advice rule with the calculated quantity and an allocation rule are created via the process ‘Purchase ad vice - Ensure PAL and PAAL’
If an explanation is desired, the expression for the ‘explanation for calculation’ is evaluated and a log rule is created with the result thereof and a reference to the stock advice rule. So that it can be retrieved from the stock adv ice rule.
An example setup
Define the variables you want to use (below is an example of how this i s done at one of our clients)
The help expression with se quence 32 is defined as follows
The ‘key for the help expression’ is the name displayed in the list. In this case, ‘max_minus_current_minus_incoming’. The result is a ‘datatype’ decimal number. In the ‘expression value’, the already defined help expressions (with a sequence number < 32) can be referenced using the % prefix.
In the ‘Calculation explanation’ field, you can also refer to the context fields (stock conditions) and the placeholders (helper expressions)
For the recommended stock, you can then also refer to the auxiliary expressions. E.g. %total
Concluding remarks
The replenishment rules with the auxiliary expressions offer a very flexible setup for the stock recommendation generated from a stock recommendation template .


