Price List Headers
Price List and Live Price Grid Types are templates that add a predefined header to the Price List or LPG detail page. In the Price List / LPG detail, users can select which sections to display:
This header can be used to display summary information of the product prices and do other Price List / LPG manipulations and see how it affects the results. The header will typically contain user inputs and calculation results displayed in a table or a chart.
We can create a Groovy logic that will generate a header (kind of a "dashboard") on top of the detail of the Price List or LPG that will have a summary section that will highlight aggregate summaries in one place of line item details.
The Price List header logic is NOT similar to a "header" logic of Quotes. This header logic is executed completely separately from the Price List calculation. This means that it is NOT anyhow included in the process of recalculation of the Price List (like it is in Quotes). The Price List header logic acts more as a dashboard, which sit on top of the Price List detail page.
When the PL/LPG is created, you can open it and start using the header’s functionality. Based on the calculation logic associated with the Type, the header can contain the following sections:
Calculation inputs – Allows the client to enter values into provided user input fields (or a configurator) to drive or simulate prices of the products included in the Price List or LPG. The available input options depend on the calculation logic.
Once you enter your input values or update the Price List / LPG table below the header, you must save or recalculate the Price List / LPG.
Chart – Provides a graphical representation and visualization of the aggregated output.
Calculation results – A table displaying the calculation results.
Header Logic Operations
User Input Fields
This header logic can perform many standard operations like generating user input fields to drive or simulate prices of the products included in the Price List or LPG.
api.integerUserEntry("Discount")
api.integerUserEntry("Promotion")
We are able to call header logic from line item logic, in the line items logic for PL/LPG you need to read the inputs entered in the header.
Example of Input Fields
Using Standard Input
In the PL/LPG header logic we would define:
return api.inputMatrix("m", "Type", "Coefficient")
Then, in the PL/LPG logic we would use:
def cp = api.getParameter("m")
Adding Columns
Using this header logic we have the ability to add, rename, modify or delete columns in Price List or LPG.
Add or Remove Products
Through this header logic, we have the ability to add or remove products from the Price List or LPG.
Additional PL/LPG Header Abilities
In addition to creating input fields, adding or removing products and adding, renaming, modifying or deleting columns in a PL/LPG, this header logic can also perform the following:
Update attributes and prices for the products in the LPG and prices in Price List using the standard methods.
Read all parameters, attributes or prices from the line items (products) and do a summary and display the summary in the output header section.
PL/LPG Output
Our header logic has the additional ability to generate aggregated output via two methods; graphical charts or as a calculation results.
Output for PL/LPG Header
Chart Output
For generation of graphical results using Highchart within PL/LPG header logic there are two methods available:
For a PL Header we can utilize the setPricelistCalculationChart method.
For an LPG Header we can utilize the setPricegridCalculationChart method.
Table Output
For generation of tabular output containing the calculation results within PL/LPG header logic there are two methods available:
For a PL Header we can utilize the setPricelistCalculationOutput method.
For an LPG Header we can utilize the setPricegridCalculationOutput method.
Additionally, if we need to delete any of the calculation output for PL or LPG, we can use the following methods in our header logic:
For a PL Header we can utilize the removePricelistCalculationOutput method.
For an LPG Header we can utilize the removePricegridCalculationOutput method.
Create PL/LPG Header
PL/LPG Header Logic
In order to be able to create our header logic, the following steps need to be applied:
First, create a new pricing logic, with a formulaNature of coHeader, which stands for Calculable Object Header.
Secondly, we would add a new Groovy element and create our Inputs section. They are created in the same way as on the line item logic. In this example, the input builder approach is used:
Next, we need to find the details about the PG being calculated. This information is available via currentItem method during our execution. In the following example, we are using mock data to simulate the details:
References
Documentation (Pricefx)
Groovy API
Found an issue in documentation? Write to us.
Â