Consolidated opportunity items
The consolidated opportunity items object holds information about items on an opportunity, consolidated by product name.
An item might appear on an opportunity in multiple places. The consolidated opportunity items object merges all opportunity items related to the same product or service into a single line.
ConsolidationObjects that return consolidated opportunity items
order.consolidated_items
order.consolidated_itemsReturns consolidated items
{% for item in order.consolidated_items %}
{{ item.name }}
{% endfor %}order.consolidated_principal_opportunity_items
order.consolidated_principal_opportunity_itemsMerges only opportunity items that are principal items. This means this doesn't return any accessories.
{% for item in order.consolidated_items %}
{{ item.name }}
{% endfor %}The consolidated opportunity items object is available anywhere you can access opportunity items.
Opportunity itemscharge_excluding_tax_total
charge_excluding_tax_totalReturns a consolidated opportunity item charge total excluding tax.
Input
Output
charge_including_tax_total
charge_including_tax_totalReturns a consolidated opportunity item charge total including tax.
Input
Output
charge_total
charge_totalReturns a consolidated opportunity item charge total.
This may be including or excluding tax depending on the value of the “Catalog Prices” setting in System Preferences.
Input
Output
is_product?
is_product?Returns true if a consolidated opportunity item is linked to a product record; false otherwise.
Input
Output
is_rental?
is_rental?Returns true if a consolidated opportunity item is a rental charge, i.e. its transaction type is "Rental"; false otherwise.
Input
Output
is_sale?
is_sale?Returns true if a consolidated opportunity item is for a sale charge, i.e. its transaction type is "Sale"; false otherwise.
Input
Output
is_service?
is_service?Returns true if a consolidated opportunity item is for a service charge, i.e. its transaction type is "Service"; false otherwise.
This doesn't determine necessarily whether an opportunity item is linked to a service record; a text item may have the transaction type "Service".
Input
Output
is_service_item?
is_service_item?Returns true if an opportunity item is linked to a service record; false otherwise.
Input
Output
is_text_item?
is_text_item?Returns true if an opportunity item is a text item; false otherwise.
Input
Output
name
nameReturns an opportunity item's name.
Input
Output
opportunity
opportunityReturns opportunity objects for the opportunity that an opportunity item is related to.
When working with a document or discussion template on an opportunity record, you may simply wish to access the opportunity object as normal. For example, use {{ order.name }} to print the opportunity subject.
Input
Output
Opportunityproduct_stock_levels
product_stock_levelsReturns stock level objects for opportunity item's related stock levels where:
the item is a product
it's bulk or serialized
stock levels are in the same store
stock levels have a stock type matching the opportunity item’s stock type (i.e. rental or sale)
Keep in mind that this returns any stock levels that match the criteria above. Use the assets object to return allocated assets.
Input
Output
Stock levelquantity
quantityReturns the quantity of an opportunity item.
Input
Output
revenue_group
revenue_groupReturns the revenue group name for an opportunity item.
Input
Output
surcharge_amount
surcharge_amountReturns the surcharge amount for an opportunity item.
Surcharges are percentage or fixed fees that are applied to rental items. An opportunity item might have multiple surcharges applied.
Returns blank for groups, sale items, and service items. Returns an error for subtotals.
Input
Output
tax_total
tax_totalReturns the tax total for an opportunity item. Works for items and groups.
Input
Output
transaction_type_name
transaction_type_nameReturns the transaction type name for an opportunity item.
Rental
Sale
Service
Input
Output
use_chargeable_days
use_chargeable_daysReturns true if an opportunity item has overriden chargeable days.
This will be the case where the opportunity has the "Chargeable Days" toggle set to YES.
Input
Output
Last updated
Was this helpful?