Quotes have quote items added to them in which pricing calculations are then updated.
Terminology
Quote Item (Line Items) Terms
- Quantity: Number of items.
- Quantity can be negative. We don't recommend negative quantities but don't restrict input in case a business has a use case for negative quantity such as purchase orders.
- Unit Price: Price for each unit in quantity.
- Unit price can be negative perhaps for discounts.
- Line Item Total:
Quantity * Unit Price = Line Item Total
. The line item total is rounded to the nearest penny (2 decimal places). - Note: Although the line item can be marked as taxable, the sales tax is not calculated per line item. In order for Sales Tax to be calculated, individual line items need to marked as taxable. Sales Tax is calculated based on the overall Taxable Total.
Quote Terms
- Taxable Total: Sum of all line items that are marked as taxable.
- Sales Tax Rate: The sales tax percentage (whole number - i.e.
5%
not, .05) - Total Tax:
Taxable Total * Sales Tax Rate = Total Tax
- Rounded to nearest two decimal places using "half rounds up"
- Subtotal: Sum of all line items.
- Total:
Subtotal + Total Tax = Total
Rounding
There are times when based on the precision of measurements, tax rates as well as working with non-whole numbers, the math results in fractions of a penny. Rounding off these fractions of penny can cause different totals to be calculated. When the rounding takes place and how the rounding works (rounding method) can result in different totals. The following is when and how rounding works:
- Rounding Method (How): Round using the "half rounds up" method. 5 rounds up to the nearest whole number
- When rounding happens:
- After the Line Item Total is calculated. Line items should always be to the nearest penny.
- After the Total Tax is calculated (
Taxable Total * Tax Rate
).
Since all Line Item Totals are rounded, there is no need to round the Subtotal since everything is already rounded to nearest penny. Since the Total Tax is already rounded and Subtotal is already rounded, there is no need to round the overall Total.
Calculation Example(s)
Quantity | Unit Price | Is Taxable | Line Item Total | Line Item Total (not rounded) |
|
Line Item 1 | 2.5 | $2.33 | No | $5.83 | $5.825 |
Line Item 2 | 2.5 | $2.33 | Yes | $5.83 | $5.825 |
Line Item 3 | 1 | $2.33 | Yes | $2.33 | $2.33 |
Taxable Total: | $8.16 | (Line Item 2 + Line Item 3) since marked as taxable | |||
Sales Tax Rate: | 5.83% | Tax rate chosen so resulting 3rd decimal place is a 5 | |||
Total Tax: | $0.48 | Taxable Total * Sales Tax Rate = 0.475728 prior to rounding | |||
Subtotal: | $13.99 | (Line Item 1 + Line Item 2 + Line Item 3) ** Note: if we were to add the non-rounded line item totals, the Subtotal would have been $13.98 and not $13.99 |
|||
Total: | $14.47 | (Total Tax + Subtotal) |
Sales Taxes
- The sales tax rate is applied to the quote and used with the sum of the total of lines items that are marked as taxable.
- Supported tax rates are up to 3 places of decimal precision.
Notes
- There can only be one sales tax rate per quote. Each line item cannot have its own sales tax rate. Although the mobile app could support a sale tax rate per line item, it is limited to the capabilities of the supporting backend(s).
- This approach is similar to i360 Professional object schema
- i360__Quote_Item__c
- i360__Calculated_Item_Total__c = (i360__Quantity__c * i360__Unit_Price__c)
- Formula field rounded to two decimal places
- i360__Calculated_Item_Total__c = (i360__Quantity__c * i360__Unit_Price__c)
- i360__Quote__c
- i360__Taxable_Total__c = Roll up of Quote Item Totals where items are taxable
- i360__Calculated_Tax__c = i360__Taxable_Total__c * i360__Sales_Tax_Rate__c (rounded to two decimal places)
- i360__Calculated_Sub_Total__c = Roll up of Quote Item Totals
- i360__Calculated_Total__c = i360__Calculated_Sub_Total__c + i360__Sales_Tax__c (rounded to two decimal places)
- i360__Quote_Item__c