Breakdown of the factors that make up a product line's final price: list price, tax, quantity, and any promotional adjustment. The final cost is normally the adjusted ex-tax price plus tax, but where a promotional final cost has been set that overrides the sum, so tax plus adjustedPriceExTax will not equal the final cost in that case.
Properties
| Property | Returns | Description |
|---|---|---|
| adjustedPriceExTax | BigDecimal | Total ex-tax price for the line after pricing rule adjustments, but before any promotional override, for the full quantity. |
| adjustedUnitPriceExTax | BigDecimal | Adjusted ex-tax price per unit, calculated by dividing the adjusted ex-tax total by the quantity. |
| finalCost | BigDecimal | Final cost for this line, including tax. This is the promotional final cost if one has been set, otherwise the adjusted ex-tax price plus tax. |
| finalListPriceIncTax | BigDecimal | Total list price for the full quantity, including tax, calculated from the list unit price with no pricing rule adjustments applied. |
| finalPriceExTax | BigDecimal | Final price for this line, excluding tax. This is the adjusted ex-tax price, or where a promotional final cost has been set, that cost with tax subtracted back out. |
| listUnitPriceExTax | BigDecimal | List unit price for the product, excluding tax, before any pricing rule adjustments. |
| promotionalDiscount | BigDecimal | Amount by which the promotional final cost reduces the price below the non-promotional adjusted price plus tax. |
| promotionalFinalCost | BigDecimal | Tax-inclusive final cost where a promotion has reduced the price below the normal calculated cost. |
| quantity | BigDecimal | Quantity of the product this itemised price covers. |
| rulesNarrative | List<String> | Human-readable log of the pricing rules and adjustments that were applied to produce this itemised price. |
| tax | BigDecimal | Tax amount included in the final cost. |
| taxRate | BigDecimal | Tax rate multiplier used to calculate the tax amount from the ex-tax cost. |
Methods
withDiscount(BigDecimal disc) · withTaxRate(BigDecimal rate) · getListUnitPriceExTax() · getAdjustedPriceExTax() · getAdjustedUnitPriceExTax() · getQuantity() · getTax() · getTaxRate() · getFinalCost() · finalCost(Narrative narrative) · getFinalListPriceIncTax() · getFinalPriceExTax() · getPromotionalDiscount() · getPromotionalFinalCost() · getRulesNarrative()
withDiscount(BigDecimal disc)
Returns: ItemisedPrice
Returns a new itemised price with a discount multiplier applied to the ex-tax cost, for example 0.9 reduces the cost by 10 percent. The multiplier is applied to the ex-tax cost, then tax is recalculated from the discounted total to produce the new tax amount and promotional final cost, and a note is added to the rules narrative.
| Parameter | Description |
|---|---|
disc | the discount multiplier to apply to the ex-tax cost; if null the original itemised price is returned unchanged |
withTaxRate(BigDecimal rate)
Returns: ItemisedPrice
Returns a new itemised price with the given tax rate applied, recalculating the tax amount from the current final list price including tax, and adding a note to the rules narrative.
| Parameter | Description |
|---|---|
rate | the tax rate multiplier to apply; if null the original itemised price is returned unchanged |
getListUnitPriceExTax()
Returns: BigDecimal
List unit price for the product, excluding tax, before any pricing rule adjustments.
getAdjustedPriceExTax()
Returns: BigDecimal
Total ex-tax price for the line after pricing rule adjustments, but before any promotional override, for the full quantity.
getAdjustedUnitPriceExTax()
Returns: BigDecimal
Adjusted ex-tax price per unit, calculated by dividing the adjusted ex-tax total by the quantity.
getQuantity()
Returns: BigDecimal
Quantity of the product this itemised price covers.
getTax()
Returns: BigDecimal
Tax amount included in the final cost.
getTaxRate()
Returns: BigDecimal
Tax rate multiplier used to calculate the tax amount from the ex-tax cost.
getFinalCost()
Returns: BigDecimal
Final cost for this line, including tax. This is the promotional final cost if one has been set, otherwise the adjusted ex-tax price plus tax.
finalCost(Narrative narrative)
Returns: BigDecimal
Final cost for this line, including tax, optionally recording the reasoning behind the calculation into the given narrative. Uses the promotional final cost if one has been set, otherwise the adjusted ex-tax price plus tax.
| Parameter | Description |
|---|---|
narrative | narrative to append the calculation steps to, or null to skip narration |
getFinalListPriceIncTax()
Returns: BigDecimal
Total list price for the full quantity, including tax, calculated from the list unit price with no pricing rule adjustments applied.
getFinalPriceExTax()
Returns: BigDecimal
Final price for this line, excluding tax. This is the adjusted ex-tax price, or where a promotional final cost has been set, that cost with tax subtracted back out.
getPromotionalDiscount()
Returns: BigDecimal
Amount by which the promotional final cost reduces the price below the non-promotional adjusted price plus tax.
getPromotionalFinalCost()
Returns: BigDecimal
Tax-inclusive final cost where a promotion has reduced the price below the normal calculated cost.
getRulesNarrative()
Returns: List<String>
Human-readable log of the pricing rules and adjustments that were applied to produce this itemised price.