In this tutorial, we will provide an overview of the pricing fields in quotes and quote line items. When a quote is generated into an order, all the pricing fields will be copied to the order and order products as well.
General Pricing Logic
In Nue, each line item, which can be a quote line item, or an order product, must be associated with a product, which has a price book entry in the price book selected for the quote or order.
List Price and List Total
So for all types of line items, we always calculate the LIst Price directly from the corresponding price book entry of the product. When a user searches for a product in the Line Editor's Select Product panel, we return all price book entries available for products satisfying the searching criteria in the selected price book.
In Nue, a product may have more than one price book entries in one price book because of multi-attribute pricing. For example, if a price book "Partner Price Book" is associated to 3 pricing attributes: Currency, UOM, and Partner Level, there may be a price book entry for each combination of the pricing attribute, for example, USD, License/Month, and Titanium.
In addition to List Price, we also calculate List Total, which is the List Price multiplied by the quantity and the subscription term. If the product's revenue model is One Time or Credit, the subscription term is considered 1.
List Total is the total price of the line item if there is no further discounts.
Sales Price, Subtotal and System Discount
Next, we calculate the Subtotal by applying the Price Tags (including price tags and discount tags) applicable to this product line.
A price tag overrides the List Price. It is applied first. If there are more than one price tags related to the line item, only the first one will be applied.
A discount tag adds discount, either in dollar value or percentage, on top of the price. We apply all discount tags on top of the price one by one, according to a certain sequence order.
Once all applicable price tags and discount tags are applied, the Subtotal is determined.
For example, if product VROOM PRO has a list price $15 with UOM License/Month, and we have the following price tags associated to this price book entry:
Name |
Price Tag Type |
Tier Type |
Price Type |
Description |
PT-1 |
Price Tag |
Tiered |
Quantity |
0-10 users: $15 Per Unit 10-100 users: $14 Per Unit 100+ users: $13 Per Unit |
DT-1 |
Discount Tag |
Volume |
Quantity |
50+ users: 25% off (Special Promotion) |
DT-2 |
Discount Tag |
Volume |
Term |
24 month subscription: 10% off |
A user adds this product to the quote, and set the quantity to be 150 licenses, and the subscription term as 36 months (3 years). The Subtotal calculation process is:
- Apply Price Tag PT-1: $15 * 10 + $14 * 90 + $13 * 50 = $2060 per Month
- Apply Discount Tag DT-1: $2060 * (1 - 25%) = $1545 per Month
- Apply DT-2: $1545 * (1 - 10%) = $1390.5 per Month for 150 users
- Subtotal = $1390.5 * 36 Month = $50,058
Once Subtotal is determined, the Sales Price will be calculated as Subtotal / Quantity / Subscription Term. For products with revenue model One Time or Credit, the Subscription Term is considered 1.
In the above example,
- Sales Price = $50,058 / 150 / 36 = $9.27
We use the difference between the List Price and Subtotal to calculate the System Discount. The System Discount value is determined by the price tags configured by the admin, so it is read-only and cannot be manually changed. There are 2 system discount fields:
- System Discount Amount
- System Discount Amount = LIst Total - Subtotal
- System Discount %
- System Discount % = Percent((List Total - Subtotal) / List Total)
Net Sales Price, Total Price and Discount
In the Line Editor, a user can apply on-the-fly Discount, either in dollar value or discount percentage, to a line item or to the quote or order header. The discount amount or percentage applied to the quote or order header will be propagated to each line item evenly.
We apply the on-the-fly discount over the Subtotal to calculate the Total Price.
There are 2 fields in the line item representing discounts:
- Discount %: The on-the-fly discount percentage
- Discount Amount: The on-the-fly discount amount calculated from the discount over subtotal.
We use field-level permission to control who can issue an on-the-fly discount.
If the user has field-level permission to above fields, she can then enter Discount (or Discount Amount) for a line item in the Line Editor.
In the Line Editor, Discount, Discount Amount, and Total Price can be recalculated from each other from Subtotal:
- If the user enters a Discount, the Discount Amount and Total Price will be automatically re-calculated.
- If the user enters a Discount Amount, the Discount and Total Price will be automatically re-calculated.
- If the user enters a Total Price, the Discount and Discount Amount will be automatically re-calculated.
After the Total Price is calculated by applying discounts over Subtotal, the Net Sales Price will be calculated as Total Price / Quantity / Subscription Term. If the product has One Time or Credit revenue model, the subscription term is considered 1.
In the example above, if a user applies 10% discount, then we have:
- List Price: $15
- Quantity: 150
- Term: 36
- List Total: $15 * 36 * 150 = $81000
- Subtotal: $50,058
- Sales Price: $50058/36/150 = $9.27
- System Discount: 81000 - 50058 = $31942
- Discount: 10%
- Discount Amount: $5005.8
- Total Price: $50058 - $5005.8 = $45052.2
- Net Sales Price: $45052.2 / 150 / 36 = $8.343
If the user manually set the discount amount as 5000, then we have:
- Discount: 9.99%
- Discount Amount: $5000
- Total Price: $50058 - $5000 = $45058
- Net Sales Price: $45058 / 150 / 36 = $8.344
Tax Amount and Total Amount
If a product is taxable, the Tax Amount will be applied to the Total Price using the Tax Rate associated to the tax code of the product.
After the Tax Amount is calculated, the Total Amount will be calculated using the following formula:
- If the Tax Mode is exclusive, Total Amount = Total Price + Tax Amount.
- if the Tax Mode is inclusive, Total Amount = Total Price.
The Total Amount is in general considered the total price the customer is committed to pay for the quote or order.
Put it All Together
In summary, a quote or an order has one or more line items. In each line item, we calculate prices by applying the following logic :
- Find out the List Price of the product, given the price book entry selected
- Apply all applicable price tags and discount tags, associated to the product, the product option (if this line item is part of a product bundle), and the product group (if this line item is part of a product group) to calculate the Subtotal, Sales Price and System Discounts
- Apply any additional on-the-fly discounts to calculate Total Price, Net Sales Price and Discounts
- Apply tax rate to the Total Price and calculate Tax Amount and Total Amount.
These pricing fields at the line-level will be aggregated to the quote and order header.
- Please note that, each line has a Line Type, which indicates if the line item is a Summary Line, regular Line Item, Ramp Line or Split Line. Only the pricing values of the regular Line Item and Ramp Lines are aggregated to the quote and order header.
In the Price Summary panel of the Line Editor, we can see all these pricing fields.
List Price
X Quantity
X Subscription Term
--------------------------------
= List Total
- System Discount Amount
--------------------------------
= Subtotal (= Sales Price * Quantity * Subscription Term)
- Discount Amount
--------------------------------
= Total Price (= Net Sales Price * Quantity * Subscription Term)
+ Tax Amount
--------------------------------
= Total Amount