Opportunity items

Opportunity item objects hold information held against an item an opportunity.

Opportunity items are items that you've added to an opportunity.

When printed, an items list will consist of a group, the items inside the group, and then a subtotal row.

A group from the default quotation document.

To build this in Liquid, you'd use a similar structure:

There's no subtotal row in the web interface. Subtotal items are included in the opportunity items object to make it easy to include and style a subtotal row. A subtotal item iterates after a group and its items have iterated. They're purely informational rows, so most of the objects below will return "Liquid error" when used with a subtotal item.

The items list from the example above in the web interface.

Opportunity item objects are always accessed within a forloop that iterates for each item.

Document layouts

The item object can be accessed in document layouts created against the following modules:

Opportunity

Project

Returns opportunity items for opportunities on a project.

Invoice

Returns opportunity items for opportunities that are sources on a particular invoice.

Member

Returns opportunity items for opportunities linked to a particular organization.

Returns opportunities items for active opportunities linked to a particular organization.

Quarantine

Returns opportunity item objects for the source opportunity of a quarantine.

Returns opportunity item objects for the opportunity that a quarantined asset is next booked on.

Discussion templates

The item object can be accessed in discussion templates created against the following modules:

Opportunity

Project

Returns opportunity items for opportunities on a project.

Invoice

Returns opportunity items for opportunities that are sources on a particular invoice.

Member

Returns opportunity items for opportunities linked to a particular organization.

Returns opportunities items for active opportunities linked to a particular organization.

Quarantine

Returns opportunity item objects for the source opportunity of a quarantine.

Returns opportunity item objects for the opportunity that a quarantined asset is next booked on.

accessories

Returns opportunity item objects for an opportunity item. Works in the same way that the children object does.

Input

Output

accessory_is_default?

Returns true if an opportunity item is an accessory and the accessory’s inclusion type is “Default”.

Input

Output

accessory_is_mandatory?

Returns true if an opportunity item is an accessory and the accessory’s inclusion type is “Mandatory”.

Input

Output

accessory_is_optional?

Returns true if an opportunity item is an accessory and the accessory’s inclusion type is “Optional”.

Input

Output

accessory_mode_is_accessory?

Returns true if an opportunity item is an accessory and the accessory’s mode is “Accessory”.

Input

Output

accessory_mode_is_component?

Returns true if an opportunity item is an accessory and the accessory’s mode is “Component”.

Input

Output

accessory_mode_is_safety?

Returns true if an opportunity item is an accessory and the accessory’s mode is “Safety”.

Input

Output

accessory_mode_name

Returns the accessory’s mode name where an opportunity item is an accessory; blank otherwise.

  • accessory

  • component

  • safety item

Input

Output

assets

Returns opportunity item assets for an opportunity item. Keep in mind that an opportunity item might have multiple asset allocations.

Input

Output

Opportunity item assets

charge_excluding_tax_total

Returns an opportunity item charge total excluding tax.

Input

Output

Use the currency filter or a number filter to change the way that the number is formatted.

charge_including_tax_total

Returns an opportunity item charge total including tax.

Input

Output

charge_total_including_children

Returns an opportunity item charge total, including the charge total of any accessory items.

Generally used where you’d like to roll up the price of accessories into their parent item, like when working with packages or kits.

Input

Output

charge_total

Returns an 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

chargeable_days

Returns the number of chargeable days for an opportunity item.

For service items, the value of the “Rate Quantity” field is returned. The rate type may be hour or distance.

For sale items, returns 0.

Input

Output

charging_periods

Returns charging period objects for an opportunity item.

Input

Output

Charging period

children

Returns opportunity item objects for an opportunity item.

  • When an item is an item, this will return accessories.

  • When the item is a group, this will return items within that group.

The children object only returns objects that are the next level deep in the tree. For example, accessories on accessories aren't returned.

Input

Output

combined_discount_total

Returns the total discount from both percentage and deal discounting for opportunity items that are groups.

For items, returns 0. For subtotals, returns an error.

Input

Output

Deal pricing

deal_discount_total

Returns the total discount from deal discounting for opportunity items that are groups.

For items, returns 0. For subtotals, returns an error.

Input

Output

Deal pricing

depth

Returns the depth of an opportunity item in the tree. An item’s depth is determined by how it is nested under items.

In the example above, we can see opportunity items with depths 1 to 4.

Input

Output

depth_padding

Returns the depth padding for an opportunity item. Generally used to apply an inline style to a table cell in HTML so that items appear nested.

Increments in multiples of 16.

Input

Output

description

Returns an opportunity item’s description.

Input

Output

discount_amount

Returns the amount of discount applied to an opportunity item.

Returns 0 for groups and subtotals.

Use discount_total for groups.

Input

Output

discount_percent

Returns the percentage discount applied to an opportunity item.

Returns 0 for groups and subtotals.

Input

Output

discount_total

Returns the amount of discount for items inside of an opportunity group.

Returns 0 for items and subtotals.

Use discount_amount for items.

Input

Output

discounted_price

Returns an opportunity item’s price after discount.

Input

Output

ends_at

Returns the charging end date for an opportunity item. Generally used for service items.

  • For service items, returns the end date and time for the opportunity item.

  • For rental and sale items, returns the end date and time for the opportunity.

  • For groups, returns blank.

  • For subtotals, returns the date and time that the document was generated in UTC.

Input

Output

group_has_deal?

Returns true where an opportunity item is a group that has been deal priced; false otherwise.

Deal priced groups have a red ”Deal Price” label in the list.

Input

Output

Deal pricing

has_child_items?

Returns true if an opportunity item has children items; false otherwise. Generally used for detecting if an opportunity item has accessories.

Input

Output

has_discount?

Returns true if an opportunity item has a discount applied; false otherwise.

Where an opportunity item has a negative discount applied, has_discount will return false. For example, -50% would increment the charge total by 50% so has_discount will return false.

Input

Output

has_shortage?

Returns true where an opportunity item has a shortage; false otherwise.

Shortages are highlighted in red and have an ⚠️ exclamation icon next to them in the list.

Input

Output

id

Returns an opportunity item ID.

The ID is an internal reference for a record. It's not exposed in our web interface.

Input

Output

is_accessory?

Returns true if an opportunity item is an accessory; false otherwise.

Input

Output

is_group?

Returns true if an opportunity item is a group; false otherwise.

Input

Output

is_in_deal?

Returns true if an opportunity item is inside a deal, i.e. if it is part of a deal priced group or opportunity; false otherwise.

Input

Output

Deal pricing

is_item?

Returns true if an opportunity item is an item; false otherwise.

Input

Output

is_principal?

Returns true if an opportunity item has accessory items nested underneath it; false otherwise.

Input

Output

is_product?

Returns true if an opportunity item is linked to a product record; false otherwise.

Input

Output

is_rental?

Returns true if an opportunity item is a rental charge, i.e. its transaction type is "Rental"; false otherwise.

Input

Output

is_sale?

Returns true if an opportunity item is for a sale charge, i.e. its transaction type is "Sale"; false otherwise.

Input

Output

is_service?

Returns true if an 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?

Returns true if an opportunity item is linked to a service record; false otherwise.

Input

Output

is_subtotal?

Returns true if an opportunity item is a group item's subtotal; false otherwise.

Subtotal rows are informational only and many opportunity item item objects will print "Liquid error: internal" rather than return blank or false.

Input

Output

is_text_item?

Returns true if an opportunity item is a text item; false otherwise.

Input

Output

name

Returns an opportunity item's name.

Input

Output

opportunity

Returns 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

Opportunity

price

Returns an opportunity item's price without discount.

Input

Output

price_unit

Returns an opportunity item's price unit name.

The price unit name output depends on the rental charge used. Some common examples:

  • Daily

  • Weekly

  • Per period

  • Each

Input

Output

product_stock_levels

Returns 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)

Input

Output

Stock level

quantity

Returns the quantity of an opportunity item.

Input

Output

rate_definition_name

Returns the rate definition name for an opportunity item where the item is a rental.

Returns blank for sales, services, and group items.

Input

Output

replacement_charge_total

Returns the replacement charge total for an opportunity item.

This is calculated by multiplying the quantity by the product replacement charge.

Current uses the product replacement charge at the time the opportunity item was added to the opportunity. Recalculate to get the latest product replacement charges.

Input

Output

replacement_charge_total_including_children

Returns the replacement charge total for an opportunity item, including the charge total of any accessory items.

Generally used where you’d like to roll up the replacement charge of accessories into their parent item, like when working with packages or kits.

Input

Output

revenue_group

Returns the revenue group name for an opportunity item.

Input

Output

service_unit_name

Returns the service unit name for an opportunity item.

  • Day

  • Days

  • Hour

  • Hours

  • miles

  • km

Input

Output

starts_at

Returns the charging start date for an opportunity item. Generally used for service items.

  • For service items, returns the start date and time for the opportunity item.

  • For rental and sale items, returns the start date and time for the opportunity.

  • For groups, returns blank.

  • For subtotals, returns the date and time that the document was generated in UTC.

Input

Output

sub_contract?

Returns true if an opportunity item is for a sub-contract service or sub-rent product.

Input

Output

sub_rent?

Returns true if an opportunity item is for a sub-contract service or sub-rent product.

Input

Output

subtotal

Returns the subtotal amount for an opportunity group.

Subtotal rows are informational only. This will only return a value for subtotal rows. This will match the charge_total of the corresponding opportunity item group.

Input

Output

subtotal_including_tax

Returns the subtotal amount for an opportunity group including tax.

Subtotal rows are informational only. This will only return a value for subtotal rows. This will match the charge_total of the corresponding opportunity item group.

Input

Output

subtotal_name

Returns the subtotal name for an opportunity item group.

Subtotal rows are informational only. This will only return a value for subtotal rows. This will match the name of the corresponding opportunity item group.

Input

Output

surcharge_amount

Returns 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

surcharges

Returns opportunity item surcharge objects for surcharges applied to the opportunity item.

Input

Output

Opportunity item surcharges

tax_total

Returns the tax total for an opportunity item. Works for items and groups.

Input

Output

transaction_type_name

Returns the transaction type name for an opportunity item.

  • Rental

  • Sale

  • Service

Input

Output

unit_charge

Returns the unit charge for an opportunity item.

The unit charge is the price for one unit of an opportunity item.

Input

Output

unit_charge_amount

Returns the unit charge for an opportunity item excluding discount.

The unit charge is the price for one unit of an opportunity item.

Input

Output

use_chargeable_days

Returns 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

warehouse_notes

Returns the warehouse notes for an opportunity item.

Input

Output

weight_total

Returns the weight total for an opportunity item.

This is calculated by multiplying the quantity by the product weight.

Current uses the product weight at the time the opportunity item was added to the opportunity. Recalculate to get the latest product weights.

Input

Output

Use the company object to return your company weight unit, e.g. lbs or kg.

weight_total_including_children

Returns the weight total for an opportunity item.

This is calculated by multiplying the quantity by the product weight.

Input

Output

Last updated

Was this helpful?