Pricing scale
Introduction
At the moment, pricing scale functionality only exists for the Pricing module and allows to create calculation rules solely from the SaleOrderLine object. The main objectif is to be able to create calculation rules for any type of object, such as determining a delivery date based on the type of delivery, the time of the year and the weight of the delivery, for example.
Configuration : in order to use pricing scale in AOS, first activate the general configuration of the pricing function in Application config → Apps management → Sales → Configure → Enable pricing scale.
What is pricing in AOS?
The pricing function in AOS is used for creating calculation rules in order to evaluate a field (an integer, a decimal, a date, etc.) of an object (an order line, an order, a quotation, a stock movement, etc.) according to parameters (called a classification rule).
The pricing scale also applies, when the product is added as an additional object.
Functional example of pricing scale
Access : Sales → Pricing → create a new pricing scale file
Here is an example of the functional use of pricing module.
For example, there is a need to automatically change the price of an order line to include the delivery cost.
In this situation, it's best to use the pricing module.
Usually it's a known fact what price is applied, which depends on the carrier and selected shipping method, as well as the total weight of the order. It's also known that if a delivery is made via a forwarder, the delivery price is increased by an additional coefficient.
In this case, it is advisable to use one, or even two pricing scales.
In the first pricing scale, fill in next information :
- The carrier as classification rule 1 ;
- The shipping method as classification rule 2 ;
- The total weight of the order as classification rule 3 (using the ">" operator) ;
- The price as result rule 1, which will be a fixed price depending solely on the classifications.
In the second pricing scale, write next data :
- The freight forwarder as classification rule 1 ;
- The additional percentage as result rule 1: this formula will add to the order price the price of result rule 1 of the previous pricing scale. The percentage of this result rule 1 must be added to the price of result rule 1.
Pricing scales 1 & 2. This image serves to illustrate the example above.
For example, an order is using Mondial Relay home delivery with a weight not exceeding 10kg and is going through a freight forwarder, then the price of 12 (8*1.5) will be added to the order line.
The different attributes of pricing scale in AOS
Pricing
Configuration: The configuration of pricing in AOS is done in the module in the Pricing menu.
Access : Sales → Pricing → add a new pricing scale file
General data
Create a new file and fill il the general data such as :
-
Name : give a name to a pricing scale.
-
Company : indicate a company, to which the pricing scale applies.
-
Start date : date from which the pricing scale will be taken into account.
-
Concerned model : object / model to which the pricing scale applies.
Current limitation: for the moment, it's possible to select only SaleOrderLine.
Pricing rules
The term "pricing rule" covers the classification and result rules for pricing scales.
Configuration: pricing scale rules in AOS are configured in the pricing scale module in the Configuration → Pricing rules.
Access : Sales → Configuration → Pricing rules
Classification Rules
Classification rules are used to "filter" entries in the pricing scale. A classification rule can be established using a text, an integer or a decimal established by a formula, and which will be compared with the value given in the pricing scale.
It's possible to create up to 4 classification rules.
The classification rules are applied in order, i.e. AOS first checks that the object/model meets classification rule 1, then classification rule 2 and so on, up to 4.
Current limitation: currently, when a pricing scale can be applied, but a situation does not fall within the existing classification rules, the last rule line will be applied.
When using a product or product category with a pricing scale, knowing that the situation does not correspond to any of the classification rules, an error message will appear to warn a user that no pricing scale is being applied.
Result rules
Result rules are used to "calculate the outputs" of the pricing scale. This rule can be a constant value (e.g. a coefficient, a percentage, etc.) or a formula to apply. It's also possible to use previous result rules or elements of previous or following pricing rules.
It's possible to create up to 4 result rules.
Current limitation: for the moment, it is only possible to create a previous scale in AOS. In addition, the use of previous or subsequent pricing scale elements is currently limited to a depth of 1.
Product/Product model
When a user decides to apply pricing scale to a product or product model, they should be aware that it will not be possible to apply this pricing scale to a product category.
Product Category
When choosing to apply a pricing scale to a product category, keep in mind that it will not be possible to apply this pricing scale to a specific product or product model. The pricing scale will apply to all products and product models in the category and its sub-categories.
If there is a pricing scale for a category and one of its sub-categories, the pricing scale of the lowest category will be taken into account for an object belonging to these two categories.
Previous / next pricing scale
The previous or next pricing scale allows for launching another pricing scale before or after the pricing scale that is being created. This field allows the user to use values contained in the sub-pricing scales.
Current limitation: for the time being, sub-pricing scale values can only be used to a depth of 1. In addition, it is currently only possible to establish a previous pricing scale in AOS.
Pricing lines
Pricing lines help to define the values. These values will be compared to the values in the classification rules. At the same time, the pricing lines establish the values that can be used in the result rules.
Pricing rules configuration
The term "pricing rule" covers the classification and result rules for pricing scales.
Configuration: pricing rules in AOS are configured in the pricing scale module in the Configuration → Pricing rules.
Access : Sales → Configuration → Pricing rules
General data
Create a new pricing rule and enter the general data such as :
-
Name : give a name to a pricing rule.
-
Company : company for which the pricing rule applies.
-
Concerned model : the object/model to which the pricing rule applies.
Current restriction: for the moment, it's possible to select only SaleOrderLine.
-
Type : select a type of pricing rule: Classification or Result. Note that some fields are linked to Classification type.
-
Field Type : the type of field that will be given in the pricing scale: Integer, Character string, Decimal.
-
Operator (for integer and decimal fields) : operator is used for comparing a precise field in the table of pricing scale with the result of the formula. Select between > , < , or =.
The operator compares the value in the pricing scale with the result of the formula (value in the pricing scale [operator] result of the formula).
The formula
Formulas are using groovy as language.
For a Classification pricing rule, the formula will let a user to create a groovy formula. The result of the formula will be compared to the value of the field given in the pricing scale.
The use of decimals is poorly handled by groovy.
Fields linked to the Result type & the formula
Formulas are using groovy as language.
The use of decimals is poorly handled by groovy.
For a Result pricing rule: the formula can be used to create a groovy formula. Its result will be either "stored" or "sent".
Useful formulas :
pricingLine.classificationParamX
: value of the Xth classification rule column (with 1 ≤ X ≤ 4).
pricingLine.resultParamX
: value of the Xth result rule column (with 1 ≤ X ≤ 4).
To use the columns of previous or next pricing, use previousPricingLine.classificationParamX
or previousPricingLine.resultParamX
.
Current limitation: groovy formulas can have a difficult time when managing bigDecimal.
Field to fill in
This is the field to which the result rule will send a result in a concerned model.
Current limitation: for the time being, it is not possible to use JSON fields in pricing scales.
Pricing scale logs (v 6.3)
To make monitoring pricing scales easier when using it in a command line, consult the pricing scale logs in the "Configuration" tab of the sale order line (since version 6.3). For example, open a sale quotation, then click on a detail line. A Sale order line window will open. There, click on the tab "Configuration" and consult a pricing scale that has been applied.
How to use a pricing scale in AOS?
For this example, we are going to use the context, previously established in the functional example.
Here's an example of the functional use of a pricing scale.
A need arises to automatically modify the price of an order line, to include the delivery cost. In this situation it's best to use a pricing scale.
It's known what price is being applied, since it depends on the carrier and selected shipping method, and the total weight of the order. It's also known, that if a delivery goes through a forwarding agent, the delivery price is increased by an additional coefficient.
In this case, use one or even two pricing scales.
In the first pricing scale, fill in the necessary data :
- The carrier as classification rule 1 ;
- The shipping method as classification rule 2;
- The total weight of the order as classification rule 3 (using the ">" operator);
- The price as result rule 1, which will be a fixed price depending solely on the classifications.
In the second pricing scale, indicate the rest of the information :
- The freight forwarder as classification rule 1;
- The additional percentage as result rule 1: by using the formula, the price of result rule 1 of the previous scale is added to the order price, plus the percentage of this result rule 1.
For example, for an order using Mondial Relay home delivery, with a weight not exceeding 10kg and going through a Forwarding Agent, the price of 12 (8*1.5) will be added to the order line.
Pricing scales 1 & 2. This image serves to illustrate the example above.
Pricing rules configuration
Configuration: the pricing scale rules in AOS are configured in the scale module in the menu Sales → Configuration → Pricing rules. Select its type as Classification or Result.
Classification rules configuration
First classification rule
- For the carrier type
Explanation of the formula: if a carrier (carrierPartner
) of the order (saleOrder
) of concerned object (SaleOrderLine
) is not defined, the given value in the pricing scale is compared to "None
", otherwise, the given value in the pricing scale will be compared to the name (fullName
) of the carrier of the order of your order line.
- For the shipping method
Explanation of the formula: if the shipping mode (shipmentMode
) of the order (saleOrder
) of concerned object (SaleOrderLine
) is not defined, the given value in the pricing scale is compared to "None
", otherwise, the given value in the pricing scale will be compared to the name (name
) of the shipping mode of the order of your order line.
- For the total weight of the order
Explanation of the formula : if the sum (.sum()
) of the product of the quantity by the net mass (it?.qty * it?.product.netMass
) of all the order lines (saleOrderLineList.collect()
) of the order (saleOrder
) of concerned object (SaleOrderLine
) is less than the given value in the pricing scale (given value in the scale > result of the formula).
Second classification rule
- For a forwarding agent : defined or absent (true or false)
Explanation of the formula: if the forwarder (forwarderPartner
) of the order (saleOrder
) of concerned object (SaleOrderLine
) is not defined, the given value in the pricing scale is compared with "false
", otherwise, when the forwarder is defined, the given value in the pricing scale is compared with "true
".
Result rules configuration
First result rule
- For the transport price
Explanation of the formula: the formula can be left blank. This result rule will only be used when calculating the next scale.
Second result rule
- For the freight forwarder's coefficient
Explanation of the formula : add to the product price (product.salePrice
) the value given in the first result column of the previous scale (previousPricingLine.resultParam1
) which you multiply by the value given in the first result column of the current scale (pricingLine.resultParam1
).
Pricing configuration
Configuration: The configuration of the pricing scales in AOS is done in the module Sales in the Pricing menu.
Sales → Pricing → create a new file. In a new file, define the parameters for the first pricing scale. Keep in mind that it's necessary to configure first pricing rules (Sales → Configuration → Pricing rules), in order to apply them later on a Pricing file.
Sales → Pricing → create a new file. In a new file, define the parameters for the second pricing scale. Keep in mind that it's necessary to configure first pricing rules (Sales → Configuration → Pricing rules), in order to apply them later on a Pricing file.
An example of a sale order using the pricing scale
Sales → open a Sale order → click on Delivery tab → define the delivery settings
Sales → open a Sale order → click on Content tab → the price will be displayed in Details lines. Here, the Printer price is 341 euro (price: 341 (=329+8*1.5)).
Application config → Referential → Products → Products → open a product file in order to define / consult its price. Here, the image depcits a Printer product sheet and its price (329 euro).