Skip to content

Invoice Line Item Fields and Formulas

This document describes all price-related fields and formulas on the Invoice Line Item object and how they are related.

For an overview of all Invoice Line Item fields, see the Invoice Line Item object reference.

Terms

Term Description
Unit Price The base price of one unit of the invoice line item. Can be a net or a gross value.
Pos Price The total price of the invoice line item after applying all quantity-related and pos price-related values.

Base Fields

There are four groups of base fields:

  • Base values: Unit Price, Quantity
  • Quantity-related values: Factor, Billing Factor
  • Unit Price-related values: Commission
  • Pos Price-related values: Discount, Discount Amount, Order Discount Amount
API Name Data Type Is Rounded Affects Description
Quantity__c Number (13,5) no The quantity of the item.
The default value is 1.0.
UnitPrice__c Currency (13,5) no The net or gross price of one unit.
GrossInvoice__c Checkbox Determines how to interpret the unit price.
false = net
true = gross
The default value is false.
Factor__c Number (13,5) no Quantity The factor is provided by the quantity unit (custom setting). The actual quantity is divided by the factor.
BillingFactor__c Number (13,5) no Quantity Factor resulting from the billing period and the billing unit, used to adapt the quantity to the service period.
For example, the billing unit Month combined with the billing period 3 results in a billing factor of 3, that is, the item is invoiced every three months with the price multiplied by three.
Commission__c Percent (3,2) no Unit Price A percentage rate for calculating the line item total based on the unit price and the defined percentage
Discount__c Percent (3,2) no Pos Price A percentage rate used to reduce the pos price by the specified percentage.
DiscountAmount__c Currency (16,2) yes Pos Price A fixed amount, reduces the pos price by the specified amount. The discount amount is applied if the discount field is empty.
AEDiscountAmount__c Currency (16,2) yes Pos Price A fixed amount, reduces the pos price by the specified amount.
PrecalculatedTax__c Currency (16,2) yes The absolute tax amount calculated internally or by a third party system.

Base Formulas

Base formulas normalize values and support unit formulas and pos formulas.

CalculatedFactor

API Name Data Type Blank as Description
CalculatedFactor__c Number (13,5) blank Corrects the quantity unit factor to 1.0 to avoid division by zero.
BLANKVALUE(
    Factor__c,
    1.0
)

CalculatedQuantity

API Name Data Type Blank as Description
CalculatedQuantity__c Number (13,5) zero Corrects the quantity by the factor of the quantity unit.
Quantity__c / CalculatedFactor__c

CalculatedCommission

API Name Data Type Blank as Description
CalculatedCommission__c Percent (3,2) blank Corrects the commission to 1.0 to avoid multiplication with zero.
BLANKVALUE(
    Commission__c,
    1.0
)

CalculatedBillingFactor

API Name Data Type Blank as Description
CalculatedBillingFactor__c Number (13,5) blank Corrects the billing factor to 1.0 to avoid multiplication with zero.
BLANKVALUE(
    BillingFactor__c,
    1.0
)

IsDiscountEmpty

API Name Data Type Blank as Description
IsDiscountEmpty__c Checkbox blank Determines whether the discount percentage field is filled.
ISBLANK(Discount__c)

HasPrecalculatedTax

API Name Data Type Blank as Description
HasPrecalculatedTax__c Checkbox blank Determines whether the pre-calculated tax field is filled.
NOT(ISBLANK(PrecalculatedTax__c))

IsTaxDelta

API Name Data Type Blank as Description
IsTaxDelta__c Checkbox blank Determines whether this line item is a tax delta item used to clear tax rounding differences when calculating invoice line item totals.
ISPICKVAL(
    Type__c,
    'Tax Delta'
)

Unit Formulas

UnitPriceCalc

API Name Data Type Blank as Is Rounded Description
UnitPriceCalc__c Currency (13,5) zero no The net or gross unit price multiplied with the commission.
UnitPrice__c * CalculatedCommission__c

Pos Formulas

PosPriceCalc

API Name Data Type Blank as Is Rounded Description
PosPriceCalc__c Currency (13,5) zero no The net or gross invoice line item price multiplied with quantity, factor and billing factor.
UnitPriceCalc__c * CalculatedQuantity__c * CalculatedBillingFactor__c

PosPriceDiscounted

API Name Data Type Blank as Is Rounded Description
PosPriceDiscounted__c Currency (13,5) zero no The net or gross invoice line item price corrected by all discount values.
IF(
    IsDiscountEmpty__c,
    PosPriceCalc__c + DiscountAmount__c,
    PosPriceCalc__c * (1 - Discount__c)
) +
IF(
    GrossInvoice__c,
    0,
    AEDiscountAmount__c
)

CalculatedTax

API Name Data Type Blank as Is Rounded Description
CalculatedTax__c Currency (16,2) zero yes The tax calculated based on the discounted pos price and the tax rate.
ROUND(
    PosPriceDiscounted__c *
    IF(
        GrossInvoice__c,
        1 - 1 / (1 + TaxRate__c),
        TaxRate__c
    ),
    2
)

PosTotalNet

API Name Data Type Blank as Is Rounded Description
PosTotalNet__c Currency (16,2) zero yes The invoice line item total net value including all discounts.
IF(
    IsTaxDelta__c,
    0,
    ROUND(
        PosPriceDiscounted__c,
        2
    ) -
    IF(
        GrossInvoice__c,
        PosTotalTax__c,
        0
    )
)

PosTotalTax

API Name Data Type Blank as Is Rounded Description
PosTotalTax__c Currency (16,2) zero yes The final tax amount.
IF(
    IsTaxDelta__c,
    UnitPrice__c,
    IF(
        HasPrecalculatedTax__c,
        PrecalculatedTax__c,
        CalculatedTax__c
    )
)

PosTotalGross

API Name Data Type Blank as Is Rounded Description
PosTotalGross__c Currency (16,2) zero yes The invoice line item total gross value including all discounts.
IF(
    IsTaxDelta__c,
    UnitPrice__c,
    ROUND(
        PosPriceDiscounted__c,
        2
    ) +
    IF(
        GrossInvoice__c,
        0,
        PosTotalTax__c
    )
)

Pos Formulas for Order Discount Handling

PosPriceDiscountedNoAE

API Name Data Type Blank as Is Rounded Description
PosPriceDiscountedNoAE__c Currency (13,5) zero no The net or gross invoice line item price corrected by all discount values, except for the order discount.
IF(
    IsDiscountEmpty__c,
    PosPriceCalc__c + DiscountAmount__c,
    PosPriceCalc__c * (1 - Discount__c)
)

PosTotalNetNoAE

API Name Data Type Blank as Is Rounded Description
PosTotalNetNoAE__c Currency (16,2) zero yes The invoice line item total net value without the order discount.
IF(
    IsTaxDelta__c,
    0,
    ROUND(
        PosPriceDiscountedNoAE__c,
        2
    ) -
    IF(
        GrossInvoice__c,
        PosTotalTax__c,
        0
    )
)