Example Pricing Algorithm, Part 8, Calculate Cost and Margin
Now we calculate cost, and then margin.
Before we get into the details, note that you can get actual costs from a source that isn't the cost list. For example, get the average cost from the Oracle Costing Service and use it when you calculate the margin. You can also use the service to calculate markup and base list price. You call the service through Oracle Integration Cloud or Integration Cloud Service. You can call a service that resides outside of Oracle Pricing from the pricing algorithm to calculate costs, margin, markups, or base list price.
Now let's get back to our example. Here are the SDOs.
Note
-
The output SDO from the Calculate Tax step provides the input SDO.
-
The running unit price on the input SDO is 300 USD.
-
The running unit price on the output SDO is 100 USD.
Here's what the algorithms do.
What the Algorithms Do |
How the Algorithms Do It |
---|---|
1. Determine cost list. |
Get the cost list that the pricing strategy references. Look up costs in sequential order according to precedence. Stop looking as soon as we find the cost list that applies for this customer and item. |
2. Get cost elements. |
Get cost elements from the cost charges on the cost list. A specific item takes precedence over an All Items specification on the list. |
3. Create charge components for costs. |
Write each cost that remains after finishing the get cost elements step. Create a separate charge component in the output SDO for each element. This example includes only one charge component because there's only one cost. The algorithm adjusts the running unit price in the output SDO for each charge component it adds. |
4. Delete cost elements. |
Delete them so they don't cause problems the next time the algorithm runs. |
5. Calculate margin. |
Calculate the final running unit price. |
Here are details about attributes in the SDOs.
Entity |
Attributes in Input SDO |
Attributes in Output SDO |
---|---|---|
ChargeComponent (for the costs) |
- |
Unit Price is the amount of the cost. |
ChargeComponent (for the margin) |
- |
Unit Price is the margin. |
Here are some of the functions you can use with the algorithms.
Algorithm Name |
Function Name |
Description |
---|---|---|
Calculate Margin |
- |
No functions are available. |
Derive Cost List |
getCostCharge |
Get the cost charges. |
Get Cost Elements |
getCosts |
Get costs for the item. |
Create Charge Component with Running Unit Price |
- |
See the Finalize List Price step. |