---
schema_version: "1"
id: 5b58a0cc490586039a6e6b0e98f681167c6b56de4d569c67625148fd580fcdf1
title: Implement Penny Perfect Pricing
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_reference_admin_ppp_usecases.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_reference_admin_ppp_usecases.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 65f7e35938ba1f5bf60b49adde1f8b2eb4e5b48cdea5d02116e14967d5db1ca1
description: Review these scenarios for implementing and calculating complex pricing for orders.
products:
  - Consumer Goods
release: "264"
---
# Implement Penny Perfect Pricing

Review these scenarios for implementing and calculating complex pricing for orders.

### Required Editions

Make sure you complete all the tasks listed at [Prerequisites for Penny Perfect Pricing](https://help.salesforce.com/s/articleView?id=ind.cg_concept_admin_enable_advanced_pricing.htm&release=264.0.0&type=5 "Before you use Penny Perfect Pricing, you must complete a few tasks such as schedule the pricing worker batch, configure translations for picklist values, configure customer data, and populate data in the Complex Pricing Condition object.").

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
          <colgroup>
            <col>
          </colgroup>
          <tbody>
            <tr class="">
              <td class="slds-cell-wrap" style="vertical-align:top;">
                <p>Available in: Lightning Experience</p>
                <p style="margin-bottom:0;">Available in: <strong>Enterprise</strong> and
                  <strong>Unlimited</strong> Editions that have Consumer Goods Cloud enabled
                </p>
              </td>
            </tr>
          </tbody>
        </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
          <colgroup>
            <col style="width:50%">
            <col style="width:50%">
          </colgroup>
          <thead class="slds-text-title_caps ">
            <tr class="">
              <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d111147e58">User Permissions
                Needed</th>
            </tr>
          </thead>
          <tbody>
            <tr class="">
              <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e58 ">To implement Penny Perfect Pricing:</td>
              <td class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e58 ">
                <p>(CGCloud Business Admin</p>
                <p>OR</p>
                <p>CGCloud Retail Business Admin)</p>
                <p style="margin-bottom:0;">AND</p>
                <p style="margin-bottom:0;">Penny
                  Perfect Pricing</p>
              </td>
            </tr>
          </tbody>
        </table>

## Calculate Base Price for Orders Using Penny Perfect Pricing

Implement Penny Perfect Pricing (PPP) for NTO Store #226. Calculate the base price for order items using PPP. Base price calculation is the mandatory calculation step for an order.

### Configure PPP on the CG Cloud desktop app for Base Price Calculation

1. [Create a key type](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_key_types.htm&release=264.0.0&type=5 "A Key type is a combinations of key attributes that are used to search for specific conditions. Most common keys such as customer, customer set, and product can be directly defined in the key definition section of the key type. More flexible keys (out of customer, product, order entity) can be defined in key attributes (Key Definitions section). A key type can contain up to 10 key attributes.") as My Customer + Product with these configurations:
    1. Select the **Customer or Customer Hierarchy** and **Product or Product Hierarchy** fields.
    2. To synchronize conditions only for the sales rep’s customer, select the Distribution Category as **Customer**.
2. [Create a key type](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_key_types.htm&release=264.0.0&type=5 "A Key type is a combinations of key attributes that are used to search for specific conditions. Most common keys such as customer, customer set, and product can be directly defined in the key definition section of the key type. More flexible keys (out of customer, product, order entity) can be defined in key attributes (Key Definitions section). A key type can contain up to 10 key attributes.") as My Product with these configurations:
    1. Select the **Product or Product Hierarchy** field.
    2. To synchronize conditions for all products of the sales rep, select the Distribution Category as **To All**.
    3. This key type can be reused for the product sub-category condition.
3. For the product condition search, [create a search strategy](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_search_strategies.htm&release=264.0.0&type=5 "Search strategy is a set of key attribute combinations that determine pricing conditions. Depending on the key attribute combination, condition search can be specific or generic. The search strategy assigned to a pricing condition defines how a pricing condition template searches for pricing conditions. Well-designed search strategies can improve search results.") as My Base Price Search and set it as Active.
4. [Add a search step](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_search_strategy_step.htm&release=264.0.0&type=5 "A search strategy consists of search strategy steps to be processed in a particular sequence. The sequence is defined by the sort column in the search strategy. The strategy steps link the key types to a search strategy. A search step can be exclusive (stop if a condition is found) or non-exclusive (executes all search steps). If multiple conditions are found, the system combines all of the conditions. For example, it’s possible to collect discounts spread over hierarchy levels.") with these configurations:
    1. Select Key type as **My Customer + Product**.
    2. Select the Customer Role as Orderer as we’re searching for a specific customer.
    3. Set the **Exclusive** flag to stop the condition search when it’s found.
    4. Set the customer or product hierarchy as No.
5. [Add a search step](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_search_strategy_step.htm&release=264.0.0&type=5 "A search strategy consists of search strategy steps to be processed in a particular sequence. The sequence is defined by the sort column in the search strategy. The strategy steps link the key types to a search strategy. A search step can be exclusive (stop if a condition is found) or non-exclusive (executes all search steps). If multiple conditions are found, the system combines all of the conditions. For example, it’s possible to collect discounts spread over hierarchy levels.") with these configurations:
    1. Select Key type as **My Product**.
    2. To stop the condition search after the product is found, set the **Exclusive** flag.
    3. Set the Customer Hierarchy Search or Product Hierarchy Search as **No**.
6. [Add a search step](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_search_strategy_step.htm&release=264.0.0&type=5 "A search strategy consists of search strategy steps to be processed in a particular sequence. The sequence is defined by the sort column in the search strategy. The strategy steps link the key types to a search strategy. A search step can be exclusive (stop if a condition is found) or non-exclusive (executes all search steps). If multiple conditions are found, the system combines all of the conditions. For example, it’s possible to collect discounts spread over hierarchy levels.") with these configurations:
    1. Select the key type as **My Product**.
    2. To stop the condition search after the product hierarchy is found, set the **Exclusive** flag.
    3. Set the **Product Hierarchy Search**.
7. [Create a pricing condition template](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_pricing_condition_template.htm&release=264.0.0&type=5 "The Pricing Condition Template defines various conditions, such as discounts or surcharges used in the calculation steps of a calculation schema.") as My Base Price with these configurations:
    1. Select Record Type as **Default**.
    2. Select Meta Type as **Price**.
    3. Select Condition Level as **Order Item** because the calculation is price per product.
    4. Deactivate **Rounding**.
    5. Set the Condition Search field as **My Base Price Search**.
8. [Create a schema](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_calculation_schema.htm&release=264.0.0&type=5 "A Calculation Schema defines how the price of an order and the order items are calculated. The calculation schema contains a sequence of condition steps (the calculation step is linked with a condition template) and defines the calculation steps to be performed in a particular sequence.") as My Price Calculation with these configurations: 
    1. Add a calculation step and set it to **Active**.
    2. Select the Pricing Condition Template as **My Base Price**, Target Condition as **Base Price (Receipt)**, Target Result as **Value(Receipt)**, Price relevant as **Yes**, and mark the step as **Mandatory**.
9. For [schema determination](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_calculation_schema_determination_online.htm&release=264.0.0&type=5 "Determine the correct calculation schema for an order by using Calculation Schema Determination, which specifies the valid calculation schema for a unique combination of customer price type and order price type. You can have only one calculation schema determination for a unique combination of order price type and customer price type."):
    1. On the Customer Extension object, set the Pricing Type field for the customer to Standard.
    2. On the Order Template, configure Compute Price as **Offline (Button)**, Generate Pricing Log as **Yes**, and Pricing Type as **Standard**.
    3. On Calculation Schema Determination, select **My Price Calculation** as Schema, and Pricing, Customer, and Order Price Type as **Standard**.
10. [Set the Unit of Measure](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_uom.htm&release=264.0.0&type=5 "You can define multiple units of measure (UoMs) for each product. Use UoMs to efficiently manage orders for a product and its distribution.") for various products and configure:
    1. One Sales Unit has 12 Consumer Units for Empower Cola and Empower Cherry.
    2. One Sales Unit as 10 Consumer Units for Empower Lemon.

### Validate Pricing Conditions

[Prepare and integrate the pricing conditions](https://help.salesforce.com/s/articleView?id=ind.cg_concept_pricing_condition_batch_integration_synchronization.htm&release=264.0.0&type=5 "Typically, pricing conditions are stored in an Enterprise Resource Planning (ERP) system in different condition tables, such as Product key Customer key Combination of product, customer, and customer classification keys. Dynamically, for each key type or key combination a table is created. These pricing conditions are integrated from an ERP system to provide the same pricing behavior, to reuse condition data, and to handle complete calculated documents in Salesforce.") from the ERP systems. The system must have these pricing conditions for the same sales org.

1. Condition value as $17.88 for NTO Store #226 and Empower Cola 1.0 L PET (store and Stock Keeping Unit (SKU) level).
2. Condition value as 21.48 for the Empower Lemon 1.5 L PET Bottle (product level).
3. Condition value as 22.68 for Empower Cola 1.0 L PET (product level).
4. Condition value as 23.88 for Soft Drinks (Product hierarchy level - Subcategory).

### Create an Order and Calculate Price on the CG Cloud Offline mobile app

1. Start the mobile app to sync new configurations and conditions.
2. Create an order for \*NTO Store #226.
3. Modify the quantity as 10 Sales Units and 12 Consumer Units for Empower Cola 1.0 L PET and Empower Lemon 1.5 L PET Bottle.
4. Order another soft drink of your choice (for example, Empower Cherry 1.5 L PET Bottle).
5. Click the **Calculate** button.

Verify the prices of various products on the NTO Store #226 order page: 

- The receipt value for the Empower Cola Sales Unit must be $178.80 ($17.88\* 10).
- The receipt value for the Empower Cola Consumer Unit must be $17.88 (($17.88/12)\*12).
- The receipt value for the Empower Cherry Sales Unit must be $238.80 (23.88\*10).
- The receipt value for the Empower Cherry Consumer Unit must be $23.88 ((23.88/12)\*12).
- The receipt value for the Empower Lemon Sales Unit must be $214.80 (21.48\*10) and the Consumer Unit must be $25.78 ((21.48 / 10) \* 12).
- The gross total value must be $699.94, which is the sum of all receipt values.
- Post sync, the order is available in the order overview on the CG Cloud desktop app. The [Pricing Log](https://help.salesforce.com/s/articleView?id=ind.cg_concept_user_pricing_logs.htm&release=264.0.0&type=5 "The pricing engine writes and syncs a pricing log only if the Generate Pricing Log field of the corresponding order template is set to Yes. If the pricing engine skips a calculation step while calculating an order, then the pricing log captures the step's details, such as the field that skipped the step: either User Exit, Calculation Group, or Promotion. To view the pricing log, go to the Pricing Information and Attachments tab of an order. The Pricing Log shows the conditions that aren’t found for the order.") File is shown in the Pricing Information section on Advanced Order with detailed pricing information.

## Calculate Freight Surcharge for Orders

Apply a freight surcharge for an order based on the total weight of products using From scales for NTO Store #226 with base price calculation in place. The order has 1500 kg of standard products, 200 kg of returns, and 100 kg of free items.

Scale Information:

- For the first scale, from a scale of 0 Kg, regardless of the customer priority, a freight surcharge of $4.99 is applied.
- From a scale rate of 1000 kg, priority A customers must pay a freight surcharge of $4.99, priority B customers must pay $5.99, and priority C customers and customers without priority must pay $6.99.3.
- From a scale of 5000 Kg, priority A customers must pay a $4.99 surcharge, and the remaining customers must pay a $19.99 surcharge.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:25%">
              <col style="width:25%">
              <col style="width:25%">
              <col style="width:25%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d111147e716">Scale</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d111147e719">Scale Value (weight in kg)</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d111147e722">Rate</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d111147e725">Priority(Account_Extension__c.Priority__c)</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Scale" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e716 ">1</td>

                <td data-label="Scale Value (weight in kg)" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e719 ">0</td>

                <td data-label="Rate" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e722 ">$4.99</td>

                <td data-label="Priority(Account_Extension__c.Priority__c)" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e725 ">
                  <p>A - Priority</p>
                  <p>B - Priority</p>
                  <p>C - Priority</p>
                  <p style="margin-bottom:0;">Blank</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Scale" class="slds-cell-wrap" rowspan="3" style="vertical-align:top;" headers="d111147e716 ">2</td>

                <td data-label="Scale Value (weight in kg)" class="slds-cell-wrap" rowspan="3" style="vertical-align:top;" headers="d111147e719 ">1000</td>

                <td data-label="Rate" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e722 ">$4.99</td>

                <td data-label="Priority(Account_Extension__c.Priority__c)" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e725 ">A - Priority</td>

              </tr>
              <tr class="">
                <td data-label="Rate" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e722 ">$5.99</td>

                <td data-label="Priority(Account_Extension__c.Priority__c)" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e725 ">B - Priority</td>

              </tr>
              <tr class="">
                <td data-label="Rate" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e722 ">$6.99</td>

                <td data-label="Priority(Account_Extension__c.Priority__c)" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e725 ">
                  <p>C - Priority</p>
                  <p style="margin-bottom:0;">Blank</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Scale" class="slds-cell-wrap" rowspan="2" style="vertical-align:top;" headers="d111147e716 ">3</td>

                <td data-label="Scale Value (weight in kg)" class="slds-cell-wrap" rowspan="2" style="vertical-align:top;" headers="d111147e719 ">5000</td>

                <td data-label="Rate" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e722 ">$4.99</td>

                <td data-label="Priority(Account_Extension__c.Priority__c)" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e725 ">A - Priority</td>

              </tr>
              <tr class="">
                <td data-label="Rate" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e722 ">$19.99</td>

                <td data-label="Priority(Account_Extension__c.Priority__c)" class="slds-cell-wrap" style="vertical-align:top;" headers="d111147e725 ">
                  <p>B - Priority</p>
                  <p>C - Priority</p>
                  <p style="margin-bottom:0;">Blank</p>
                </td>

              </tr>
            </tbody>
          </table>

### Configure PPP on the CG Cloud desktop app for Freight Surcharge Calculation

1. [Create a key attribute](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_key_atrributes.htm&release=264.0.0&type=5 "A key attribute defines a specific object field that the pricing engine uses as part of a condition record search key. Key attributes are the building blocks of key types. A key type combines multiple key attributes to define the exact combination of fields the engine uses to look up a condition record.") as Customer Priority using Account\_Extension\_\_c.Priority\_\_c with these configurations:
    1. Select Object as **Customer**.
    2. Select Mobility Entity as **Customer**.
    3. Select Mobility Attribute as **Priority**.
2. Check if the attribute is available for the pricing engine:
    1. Check the data source `DsComplex_Pricing_sf` in the modeler.
    2. Check the query `CndCpReadCustomerAttributes`.
    3. The attribute is available with the name set as Priority.
3. [Create a key type](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_key_types.htm&release=264.0.0&type=5 "A Key type is a combinations of key attributes that are used to search for specific conditions. Most common keys such as customer, customer set, and product can be directly defined in the key definition section of the key type. More flexible keys (out of customer, product, order entity) can be defined in key attributes (Key Definitions section). A key type can contain up to 10 key attributes.") as My Customer Priority with Distribution Category as **To All** since the customer attribute and not the customer is used in the key type.
4. [Create a search strategy](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_search_strategies.htm&release=264.0.0&type=5 "Search strategy is a set of key attribute combinations that determine pricing conditions. Depending on the key attribute combination, condition search can be specific or generic. The search strategy assigned to a pricing condition defines how a pricing condition template searches for pricing conditions. Well-designed search strategies can improve search results.") as My Freight Surcharge Search and don’t set the search strategy active during creation. Otherwise, you get a validation error that there exist no search steps.
5. [Add a search step](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_search_strategy_step.htm&release=264.0.0&type=5 "A search strategy consists of search strategy steps to be processed in a particular sequence. The sequence is defined by the sort column in the search strategy. The strategy steps link the key types to a search strategy. A search step can be exclusive (stop if a condition is found) or non-exclusive (executes all search steps). If multiple conditions are found, the system combines all of the conditions. For example, it’s possible to collect discounts spread over hierarchy levels.") and select Key Type as My Customer Priority.
6. Activate the search strategy in step 4 (via the Details tab).
7. [Create a pricing condition template](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_pricing_condition_template.htm&release=264.0.0&type=5 "The Pricing Condition Template defines various conditions, such as discounts or surcharges used in the calculation steps of a calculation schema.") as My Freight Surcharge and select:
    1. **Active** as true.
    2. Meta Type as **Flat Rate** because the surcharge is added one time.
    3. Condition Level as **Order Header** since the condition is added per order and not per order item.
    4. Base as **Weight** because product weight is used to determine the scale range.
    5. Scale Type as **From Scale**.
8. [Add a calculation step](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_calculation_schema_step.htm&release=264.0.0&type=5 "Use calculation steps to determine the behavior for a calculation schema.") to My Price Calculation schema (see step 8 in use case 1) and select:
    1. Pricing Condition Template as **My Freight Surcharge**.
    2. Item Meta Rule as **Delivery (excl. Free Item)**.
9. [Set the Item Meta Rules](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_calculation_schema_step.htm&release=264.0.0&type=5 "Use calculation steps to determine the behavior for a calculation schema.") in the respective Order Item Templates:
    1. For the standard order item template, set the Delivery (excl. Free Item) field as **Add** in the Item Meta Rule section.
    2. Set the Delivery (excl. Free Item) field as **Neutral** in the Item Meta Rule section for returns.
    3. Set the Delivery (excl. Free Item) field as **Neutral** in the Item Meta Rule section for free items.
10. [Set the Unit of Measure](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_uom.htm&release=264.0.0&type=5 "You can define multiple units of measure (UoMs) for each product. Use UoMs to efficiently manage orders for a product and its distribution.") for Empower Cola Cherry 0.33 L Can and configure:
    1. The Consumer Unit with weight definition as 1.05 kg.
    2. One Sales Unit has 12 Consumer Units.
11. Set the NTO Store #226 as **B -Priority** customer in [Customer Extension](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_add_customer_extensions.htm&type=5&language=en_US).

### Import and Validate Pricing Conditions

[Prepare the pricing condition records](https://help.salesforce.com/s/articleView?id=ind.cg_concept_pricing_condition_batch_integration_synchronization.htm&release=264.0.0&type=5 "Typically, pricing conditions are stored in an Enterprise Resource Planning (ERP) system in different condition tables, such as Product key Customer key Combination of product, customer, and customer classification keys. Dynamically, for each key type or key combination a table is created. These pricing conditions are integrated from an ERP system to provide the same pricing behavior, to reuse condition data, and to handle complete calculated documents in Salesforce.") in a CSV and import them using the Data Loader. You must be able to view condition records for each priority customer.

### Create an Order and Calculate Price on the CG Cloud Offline mobile app

1. To sync new configurations and conditions, restart the mobile app.
2. Create an order for \*NTO Store #226.
3. Modify the quantity as 100 Sales Units for Empower Cola Cherry 0.33 L Can.
4. Click the **Calculate** button.
5. Navigate to the Header page and click **Preview**.

On the order PDF, a freight surcharge of $5.99 is applied to the order. The 100 Sales Units of Empower Cola Cherry 0.33 L Can are converted to 1200 (12\*100) Consumer Units as the weight of the Sales Unit isn’t set and the total weight is calculated as 1260 Kg. Based on the scale conditions, for a weight of 1260 Kg, the surcharge value of $5.99 is applied.