Interface QapiPriceGridLineItem

All Superinterfaces:
ApprovableColumns, CalculableObjectLineItemColumns, Map<String,SelectableExpression>, PersistedObjectColumns, PriceCalculableObjectLineItemColumns, Tables.Columns, Tables.Table

Table of the items of one Live Price Grid. Each row is one item, identified by its Stock Keeping Unit (SKU) and, in a matrix grid, by key2().

An item has three prices: the result price of the last calculation, the active price that was last approved, and the previous price that was active before it. When an item is approved, the active values become the previous values and the current result becomes the active one.

Example, the prices of the items that have an approved price:


 def q = api.queryApi()
 def t = q.tables().priceGridLineItems(843)

 return q.source(t, [t.sku(), t.resultPrice(), t.activePrice(), t.activePriceDate(), t.previousPrice()],
         t.activePrice().isNotNull())
         .stream { it.collect { it } }
 
Since:
14.0 - Caribou Lou
See Also:
  • Method Details

    • key2

      Returns the value of the second dimension of the item, in addition to the product.

      Only available when the Live Price Grid is a matrix grid; on other grids, calling this method fails with an error.

      Returns:
      the key2 column as an expression (its type will be taken from the corresponding attribute meta configuration if it exists)
      See Also:
    • approvalState

      SelectableExpression approvalState()
      Returns the approval state of the item: NOT_APPROVED, APPROVED, AUTO_APPROVED or DENIED.
      Returns:
      the approvalState column as an Enum expression
      See Also:
    • approvalDate

      SelectableExpression approvalDate()
      Returns the date and time when the item was last approved.
      Returns:
      the approvalDate column as a DateTime expression
      See Also:
    • denialDate

      SelectableExpression denialDate()
      Returns the date and time when the item was denied.
      Returns:
      the denialDate column as a DateTime expression
      See Also:
    • denialReason

      SelectableExpression denialReason()
      Returns the reason given when the item was denied, combined with the denial comment.
      Returns:
      the denialReason column as a String expression
      See Also:
    • previousCalculationResult

      SelectableExpression previousCalculationResult(String elementName)
      Returns the result of the given logic element as it was before the last approval, read from previousCalculationResults(), or null if there is no such result.
      Parameters:
      elementName - the element name from which to get the previous calculation result
      Returns:
      the previous calculation result column as a String expression of the given element name (the value may be serialized as a json string)
      Since:
      14.1 - Caribou Lou
      See Also:
    • previousCalculationResults

      SelectableExpression previousCalculationResults()
      Returns all logic element results as they were before the last approval, that is the active results that the last approval replaced.
      Returns:
      all the previous calculation results as a String expression serialized as json
      See Also:
    • previousPriceDate

      SelectableExpression previousPriceDate()
      Returns the date and time when the previous price was approved, that is the active price date that the last approval replaced.
      Returns:
      the previousPriceDate column as a DateTime expression
      See Also:
    • activeCalculationResult

      SelectableExpression activeCalculationResult(String elementName)
      Returns the result of the given logic element at the last approval of the item, read from activeCalculationResults(), or null if there is no such result.

      Example:

      
       def q = api.queryApi()
       def t = q.tables().priceGridLineItems(843)
      
       return q.source(t, [t.id(), t.activeCalculationResult("Cost").as("Cost")])
               .stream { it.collect { it } }
       
      Parameters:
      elementName - the element name from which to get the active calculation result
      Returns:
      the active calculation result column as a String expression of the given element name (the value may be serialized as a json string)
      Since:
      14.1 - Caribou Lou
      See Also:
    • activeCalculationResults

      SelectableExpression activeCalculationResults()
      Returns all logic element results of the item at its last approval.
      Returns:
      all the active calculation results as a String expression serialized as json
      See Also:
    • activePrice

      SelectableExpression activePrice()
      Returns the approved price of the item, that is the result price at its last approval.
      Returns:
      the activePrice column as a Real expression
      See Also:
    • activePriceDate

      SelectableExpression activePriceDate()
      Returns the date and time when the active price was approved.
      Returns:
      the activePriceDate column as a DateTime expression
      See Also:
    • priceChange_ActivePrev

      SelectableExpression priceChange_ActivePrev()
      Returns the absolute change between the active price and the previous price, as recorded at the last approval.
      Returns:
      the priceChange_ActivePrev column as a Real expression
      See Also:
    • priceChangePct_ActivePrev

      SelectableExpression priceChangePct_ActivePrev()
      Returns the relative change between the active price and the previous price, as recorded at the last approval. The value is a fraction, not a percentage: 0.1 means a 10% increase.
      Returns:
      the priceChangePct_ActivePrev column as a Real expression
      See Also:
    • manualEditVersion

      SelectableExpression manualEditVersion()
      Returns the number of times a user edited the item manually.
      Returns:
      the manualEditVersion column as an Integer expression
      See Also:
    • manualEditUser

      SelectableExpression manualEditUser()
      Returns the ID of the user who last edited the item manually.
      Returns:
      the manualEditUser column as an Integer expression
      See Also:
    • manualPriceExpired

      SelectableExpression manualPriceExpired()
      Returns whether the manual price of the item is expired. The logic marks a manual price as expired through the manual result expiry element of the Live Price Grid; an expired manual price is removed at the next calculation.
      Returns:
      the manualPriceExpired column as a Boolean expression
      See Also:
    • manualPriceDate

      SelectableExpression manualPriceDate()
      Returns the date and time when the manual price of the item was set, or null when it has none.
      Returns:
      the manualPriceDate column as a DateTime expression
      See Also:
    • submitDate

      SelectableExpression submitDate()
      Returns the date and time when the item was submitted for approval.
      Returns:
      the submitDate column as a DateTime expression
      See Also: