Override Base List Price

Set up Oracle Pricing so it uses the value from an extensible flexfield to override the base list price.

Caution:

The example in this topic describes one way to set up pricing. It is intended only as a general outline that you can use to learn about different ways to set up Pricing. You will need to use different procedures, different steps, different values, and different objects for your implementation, depending on your business requirements.

Use this procedure only with a standard item. You can't use it with a coverage item or subscription item.

In this example, you define an extensible flexfield that displays in the Order Management work area. You then use the value that the Order Entry Specialist enters in the flexfield to override the Sale Price charge.

Summary of the Set Up

  1. Set up the extensible flexfield.

  2. Modify the pricing algorithm.

  3. Test your set up.

Set Up the Extensible Flexfield

  1. Make sure you have the privileges that you need to administer Order Management.

    Don't sign in with pricing privileges. You can't use them to define an extensible flexfield.

  2. Go to the Setup and Maintenance work area, then go to the task:

    • Offering: Order Management

    • Functional Area: Orders

    • Task: Manage Order Extensible Flexfields

    This example assumes you're implementing the Order Management offering. If you're using a different offering, then click it instead of Order Management.

  3. Modify the extensible flexfield.

    • On the Manage Order Extensible Flexfields page, enter the values, then click Search.

      Attribute

      Value

      Name

      Fulfillment Line Information

      Flexfield Code

      DOO_FULFILL_LINES_ADD_INFO

    • Click Actions > Edit.

    • Click Manage Contexts.

    • On the Manage Contexts page, click Actions > Create.

    • On the Create Context page, set values.

      Attribute

      Value

      Display Name

      LinePrcOverride

      Code

      LinePrcOverride

      API Name

      Lineprcoverride

      Enabled

      Contains a check mark

      Behavior

      Single Row

    • In the Context Usages area, click Actions > Create, set the values, then click Save.

      Attribute

      Value

      Name

      Additional Fulfillment Line Information

      View Privileges

      None

      Edit Privileges

      None

    • In the Context Sensitive Segments area, click Actions > Create.

    • On the Create Segment page, set the values, then click Save and Close.

      Attribute

      Value

      Name

      SalePrcOverrideVal

      Code

      SalePrcOverrideVal

      API Name

      saleprcoverrideval

      Enabled

      Contains a check mark.

      Data Type

      Number

      Table Column

      Select any column that's available.

      Value Set

      15 Digit Number

      Prompt

      SalePrcOverrideVal

    • On the Edit Context page, click Save and Close.

    • On the Manage Contexts page, click Save and Close.

    • On the Edit Extensible Flexfield page, click Save and Close.

  4. Deploy the extensible flexfield.

    • On the Manage Order Extensible Flexfields page, click Actions > Deploy Flexfield.

    • Wait for the deployment dialog to indicate that deployment successfully finished, then click OK.

    • Click Actions > Download Flexfield Archive, wait for the dialog to indicate that the archive successfully finished, then click Download.

    • Save file 10008_DOO_FULFILL_LINES_ADD_INFO.zip to your local hard drive, extract it, then navigate to this folder.

      oracle\apps\scm\doo\processOrder\flex\fulfillLineContextsB\view\
    • Open FulfillLineEffBLinePrcOverrideprivateVO.xml.

Add Extensible Flexfield to Service Mapping

You define a service mapping that maps values from the extensible flexfield into Pricing.

Add the extensible flexfield to the service mapping.

  1. Sign out, then sign in with the privileges that you need to administer pricing.

  2. Go to the Pricing Administration work area, then click Tasks > Manage Service Mappings.

  3. On the Manage Service Mappings page, in the Name column, click Sales.

  4. Define the entities.

    • On the Edit Service Mappings page, on the Entities tab, click Action > Add Row, then set the values.

      Attribute

      Value

      Entity

      LinePrcOverrideEff_Custom

      Description

      Get the extensible flexfield values that we will use to override price.

    • In the Details area, add attributes, then click Save.

      Attribute

      Type

      Primary Key

      FulfillLineId_Custom

      Long

      Contains a check mark.

      EffLineId_Custom

      Long

      Does not contain a check mark.

      SalePrcOverrideVal_Custom

      Decimal

      Does not contain a check mark.

      For example:

      page Edit Service Mappings, on tab Entities
    • Click Services, then click the row that contains this value.

      Attribute

      Value

      Service

      PriceSalesTransaction

    • In the Details area, click Actions > Add Row, then set these values.

      Entity

      Read

      Write

      LinePrcOverrideEff_Custom

      Contains a check mark.

      Does not contain a check mark.

      This step creates a relationship between Pricing and the entity that you use to send values from the extensible flexfield.

    • In the LinePrcOverrideEff_Custom Entities area, add attributes, then click Save.

      Attribute

      Read

      Write

      EffLineId_Custom

      Contains a check mark.

      Does not contain a check mark.

      FulfillLineId_Custom

      Contains a check mark.

      Does not contain a check mark.

      SalePrcOverrideVal_Custom

      Contains a check mark.

      Does not contain a check mark.

  5. Set up the source for the order header.

    • Click Sources, then click the row that includes the value.

      Attribute

      Value

      Source

      OrderHeader

    • On the Entity Mapping tab, click View > Columns, then add a check mark to Joined Entity and Joined Entity Attribute.

    • Click Actions > Add Row, set the values, then click Save.

      Attribute

      Value

      Entity

      LinePrcOverrideEff_Custom

      Type

      View Object

      View Object

      FulfillLineEffBLinePrcOverrideprivateVO

      Make sure the value you enter matches exactly the value you noticed earlier in this topic when you examined the flexfield archive. Don't include the .xml extension.

      Query Type

      Join

      Query Attribute

      FulfillLineId

      Joined Entity

      Line

      It might be necessary to click another row, and then return to this row to get the joined entity attributes to populate values.

      Joined Entity Attribute

      LineId

    • In Details area LinePrcOverrideEff_Custom, add the attributes, then click Save.

      Attribute

      View Object Attribute

      EffLineId_Custom

      EffLineId

      FulfillLineId_Custom

      FulfillLineId

      SalePrcOverrideVal_Custom

      salePriceOverrideVal

      Make sure the value you enter matches exactly the value you noticed in tag ViewAttribute Name of the flexfield archive you examined earlier in this topic. For example, ViewAttribute Name="salePriceOverrideVal".

      This step sets up Pricing to read extensible flexfield values from the public view object that Order Management sends to Pricing when the Order Entry Specialist uses the Price Order action or saves the sales order.

      For example:

      step that configures Pricing to read extensible flexfield values from the public view object that Order Management sends to Pricing
  6. Set up the source for the order line.

    • In the Sources area, click the row that includes the value.

      Attribute

      Value

      Source

      OrderLine

    • On the Entity Mapping tab, click Actions > Add Row, set the values, then click Save.

      Attribute

      Value

      Entity

      LinePrcOverrideEff_Custom

      Type

      View Object

      View Object

      FulfillLineEffBLinePrcOverrideprivateVO

      Make sure the value you enter matches exactly the value you noticed earlier in this topic when you examined the flexfield archive.

      Query Type

      Join

      Query Attribute

      FulfillLineId

      Joined Entity

      Line

      Joined Entity Attribute

      LineId

      This step maps the extensible flexfield attributes in the public view object. It sets up Pricing to read extensible flexfield values from the public view object that Order Management sends to Pricing when Order Management updates the line quantity or shipping attributes on the order line.

    • In the Details area for HeaderPricingEff_Custom, add the attributes.

      Attribute

      View Object Attribute

      EffLineId_Custom

      EffLineId

      FulfillLineId_Custom

      FulfillLineId

      SalePrcOverrideVal_Custom

      salePriceOverrideVal

      Make sure the value you enter matches exactly the value you noticed in the ViewAttribute Name tag of the flexfield archive you examined earlier in this topic. For example, ViewAttribute Name="salePriceOverrideVal".

      This step sets up Pricing to read extensible flexfield values from the public view object that Order Management sends to Pricing when Order Management updates the quantity attribute or a shipping attribute on the order line.

      For example:

      step that configures Pricing to read extensible flexfield values from the public view object that Order Management sends to Pricing when Order Management updates the quantity attribute or a shipping attribute on the order line
  7. Click Save and Close > Done.

Modify Pricing Algorithm

  1. Click Tasks > Manage Algorithms.

  2. On the Manage Algorithms page, select a published version of this pricing algorithm, such as Version 1.

    Attribute

    Value

    Name

    Get Base List Price For Goods And Services

  3. Click Actions > Create Version, then wait for the page to display your In Progress version, such as Version 2

  4. Open your In Progress version for editing.

  5. On the Edit Algorithm page, on the Algorithm tab, expand step Create Charges, then click step Create Native Charges.

    You will modify this step so it references the extensible flexfield that contains the override value.

  6. In the Data Sets area, add this data set.

    Attribute

    Value

    Name

    LinePrcOverrideEff

    Variable Path

    PriceRequest.LinePrcOverrideEff_Custom

    Cardinality

    Zero or one

    Data Set Join

    [FulfillLineId_Custom: {Line.LineId}]

    For example:

    step that references the extensible flexfield that contains the override value
  7. In the Default Action area, in the Actions window, replace the code.

    Old Code

    New Code

    Ch.CurrencyCode = Line.AppliedCurrencyCode
    //Ch.CurrencyCode = Line.AppliedCurrencyCode
    //Base List Price Override
    if (null != LinePrcOverrideEff?.SalePrcOverrideVal_Custom) {
      Ch.CurrencyCode = Header.AppliedCurrencyCode
      Line.AppliedCurrencyCode = Header.AppliedCurrencyCode
      Ch.NeedsCostPlus = false
      //clear out the tier and matrix adjustments
      Candidate.unset('TieredPricingHeaderId')
      Candidate.unset('AttributePricingMatrixId')
    }
    else {
      Ch.CurrencyCode = Line.AppliedCurrencyCode
      Ch.NeedsCostPlus = ('COST'==CalculationMethod)
    }
    
  8. Comment this code.

    Old Code

    New Code

    Ch.NeedsCostPlus = ('COST'==CalculationMethod)
    //Ch.NeedsCostPlus = ('COST'==CalculationMethod)

    Here's the complete, revised code.

    Ch = Charge.insert([ChargeId:++ServiceParam.ChargeIdCntr, LineId:Line.LineId, ParentEntityId:Candidate.ParentEntityId, ParentEntityCode:'LINE'])
    if ( CanAdjustFlag!=null ) Ch.CanAdjustFlag = ('Y'==CanAdjustFlag)
      Ch.ChargeAppliesTo = Candidate.ChargeAppliesTo
      Ch.ChargeDefinitionCode = Candidate.ChargeDefinitionCode
      Ch.ChargeDefinitionId = ChargeDefinitionId
      Ch.ChargeSubtypeCode = ChargeSubtypeCode
      Ch.ChargeTypeCode = ChargeTypeCode
    // Set the CompSeqCntr as Long instead of Integer
    Ch.CompSeqCntr = 1000L
    //Ch.CurrencyCode = Line.AppliedCurrencyCode
    //Base List Price Override
    if (null != LinePrcOverrideEff?.SalePrcOverrideVal_Custom) {
      Ch.CurrencyCode = Header.AppliedCurrencyCode
      Line.AppliedCurrencyCode = Header.AppliedCurrencyCode
      Ch.NeedsCostPlus = false
      //clear out the tier and matrix adjustments
      Candidate.unset('TieredPricingHeaderId')
      Candidate.unset('AttributePricingMatrixId')
    }
    else {
      Ch.CurrencyCode = Line.AppliedCurrencyCode
      Ch.NeedsCostPlus = ('COST'==CalculationMethod)
    }
    Ch.EstimatedPricedQuantityFlag = ('USAGE'==PriceTypeCode || 'RECURRING_USAGE'==PriceTypeCode)
    Ch.EstimatedUnitPriceFlag = Ch.EstimatedPricedQuantityFlag
    Ch.PrimaryFlag = false
    Ch.RollupFlag = false
    //Ch.NeedsCostPlus = ('COST'==CalculationMethod)
    Ch.NeedsMargin = ('Y'==CalculateMarginFlag)
    if (PricePeriodicityCode!=null) Ch.PricePeriodicityCode = PricePeriodicityCode
      Ch.PriceTypeCode = PriceTypeCode
    if ( 'USAGE'==PriceTypeCode || 'RECURRING_USAGE'==PriceTypeCode ) {
      // PricedQty should be null if estimated usage quantity is not passed in
      PricedQty = (Ci?.EstimatedUsageQuantity!=null ? (Ci.PerUnitUsageFlag ? (Line.ExtendedQuantity?.Value ?: Line.LineQuantity.Value) : 1)*Ci?.EstimatedUsageQuantity?.Value : null)
    }
    else {
      PricedQty = Line.ExtendedQuantity?.Value ?: Line.LineQuantity.Value
    }
    if ( PricedQty != null ) {
      Ch.createDataObject('PricedQuantity')
      Ch.PricedQuantity.Value = PricedQty
      Ch.PricedQuantity.UnitCode = PricingUomCode
      Ch.PricedQuantityUOMCode = PricingUomCode
    }
    Ch.RunningUnitPrice = 0
    if (Ci?.UsagePeriodCode!=null) Ch.UsagePeriodCode = Ci.UsagePeriodCode
    if (Ch.UsagePeriodCode!=null && Candidate.UsagePeriodCode!=null) Ch.UsagePeriodCode = Candidate.UsagePeriodCode
    if (UsageUomCode!=null) Ch.UsageUOMCode = UsageUomCode
    
      Ch.TaxIncludedFlag = false
      finer(AlgmName+': created native charge '+Ch.ChargeId+' ('+Ch.PriceTypeCode+', '+Ch.ChargeTypeCode+', '+Ch.ChargeSubtypeCode+') for line '+Line.LineId)
    
    // Needed to write charge component
    Candidate.ChargeId = Ch.ChargeId
    
    // Initialize for tiered pricing
    if (Candidate.TieredPricingHeaderId != null) {
      TierQ.insert([TieredPricingHeaderId:Candidate.TieredPricingHeaderId, ChargeId:Ch.ChargeId, OriginId:Line.LineId, OriginType:'LINE'])
    }
    
    // Initialize for attribute-based pricing
    if (Candidate.AttributePricingMatrixId != null) {
      MatrixQ.insert([DynamicMatrixId:Candidate.AttributePricingMatrixId, ParentEntityId:Ch.ChargeId, FromCurrencyCode:Ch.CurrencyCode, ParentEntityCode:'CHARGE'])
    }
    
    // Coverage Duration being calculated if its a Phantom Line 
    if ('COVERED_STANDARD' == Line.ItemType && Line.PhantomFlag)
    {
      if (CoverageAssociation != null)
      {
      Ch.createDataObject('CoverageDuration')
      Ch.CoverageDuration.Value = CoverageAssociation.CoverageDuration.Value
      Ch.CoverageDuration.UnitCode = CoverageAssociation.CoverageDuration.UnitCode
      Ch.CoverageDurationUOMCode = CoverageAssociation.CoverageDurationUOMCode   
      }
      Ch.LineId = CoverageLine.LineId
    }
    
  9. Click the Create Charge Components step.

    You will modify this step so it references the extensible flexfield that contains the override value, then use this value to calculate the unit price.

  10. In the Data Sets area, add this data set.

    Attribute

    Value

    Name

    LinePrcOverrideEff

    Variable Path

    PriceRequest.LinePrcOverrideEff_Custom

    Cardinality

    Zero or one

    Data Set Join

    [FulfillLineId_Custom: {Line.LineId}]

  11. In the Default Action area, locate this code.

    Comp.createDataObject('UnitPrice')
  12. Add this code immediately under the code you just located.

    //Base List Price Override
    if(Candidate.CalculationMethod == 'COVERED_ITEM_PRICE_PERCENT') {
      fine({'UnitPrice Calc - Cand.CalculationAmount: '+Candidate.CalculationAmount+' CoverageBasis: '+Candidate.CoverageBasisValue})
      Comp.UnitPrice.Value = Candidate.CalculationAmount * Candidate.CoverageBasisValue/ 100
      Ch.HasPercentPriceFlag = true
    }
    else {
     //Base List Price Override
      if (LinePrcOverrideEff?.SalePrcOverrideVal_Custom != null)
        Comp.UnitPrice.Value = LinePrcOverrideEff.SalePrcOverrideVal_Custom
      else 
        Comp.UnitPrice.Value = Candidate.BasePrice
    }
    Comp.UnitPrice.CurrencyCode = Line.AppliedCurrencyCode
    Comp.CurrencyCode = Line.AppliedCurrencyCode
    
    // convert currency if needed
    if ( Line.FromCurrencyCode!=null && Line.FromCurrencyCode!=Line.AppliedCurrencyCode ) {
      if (ConvRate?.MessageTypeCode == 'ERROR') {
        finest('creating line message')
        Line.MessageTypeCode = 'ERROR'
        Ch.MessageTypeCode = 'ERROR'
        def messageMap = [ParentEntityCode:'LINE', ParentEntityId:Line.LineId, HeaderId:Header.HeaderId, MessageText:ConvRate.PrcErrorMessage]
        msg = Message.locate(messageMap)
        if ( msg==null ) {
          // create new error message for Line
          msg = Message.insert(messageMap)
          msg.PricingMessageId = getNextId()
          msg.MessageName = ConvRate.PrcMessageName
          msg.MessageTypeCode = Line.MessageTypeCode
        }
      }
      else {
          Ch.CurrencyCode = Line.AppliedCurrencyCode
          Comp.UnitPrice.Value *= ConvRate.ConversionRate?:1
      }
    }
    //end base price override
    

    Here's the complete, revised code.

    Comp = ChargeComponent.insert([ChargeComponentId:++ServiceParam.ChargeComponentIdCntr, ChargeId: Ch.ChargeId])
    
    Comp.PriceElementCode = ElementParam
    Comp.PriceValidFrom = Line.PricingDate
    if ( EndDate!=null ) Comp.PriceValidUntil = EndDate
    Comp.SequenceNumber = (Long) Ch.CompSeqCntr++
    Comp.SourceId = Candidate.PriceListChargeId
    Comp.SourceTypeCode = 'PRICE_LIST_CHARGE'
    
    fine({'Before UnitPrice Calc - CalcMethod: '+Candidate.CalculationMethod})
    Comp.createDataObject('UnitPrice')
    //Base List Price Override
    if(Candidate.CalculationMethod == 'COVERED_ITEM_PRICE_PERCENT') {
      fine({'UnitPrice Calc - Cand.CalculationAmount: '+Candidate.CalculationAmount+' CoverageBasis: '+Candidate.CoverageBasisValue})
      Comp.UnitPrice.Value = Candidate.CalculationAmount * Candidate.CoverageBasisValue/ 100
      Ch.HasPercentPriceFlag = true
    }
    else {
     //Base List Price Override
      if (LinePrcOverrideEff?.SalePrcOverrideVal_Custom != null)
        Comp.UnitPrice.Value = LinePrcOverrideEff.SalePrcOverrideVal_Custom
      else 
        Comp.UnitPrice.Value = Candidate.BasePrice
    }
    Comp.UnitPrice.CurrencyCode = Line.AppliedCurrencyCode
    Comp.CurrencyCode = Line.AppliedCurrencyCode
    
    // convert currency if needed
    if ( Line.FromCurrencyCode!=null && Line.FromCurrencyCode!=Line.AppliedCurrencyCode ) {
      if (ConvRate?.MessageTypeCode == 'ERROR') {
        finest('creating line message')
        Line.MessageTypeCode = 'ERROR'
        Ch.MessageTypeCode = 'ERROR'
        def messageMap = [ParentEntityCode:'LINE', ParentEntityId:Line.LineId, HeaderId:Header.HeaderId, MessageText:ConvRate.PrcErrorMessage]
        msg = Message.locate(messageMap)
        if ( msg==null ) {
          // create new error message for Line
          msg = Message.insert(messageMap)
          msg.PricingMessageId = getNextId()
          msg.MessageName = ConvRate.PrcMessageName
          msg.MessageTypeCode = Line.MessageTypeCode
          }
      }
      else {
        Ch.CurrencyCode = Line.AppliedCurrencyCode
        Comp.UnitPrice.Value *= ConvRate.ConversionRate?:1
      }
    }
    //end base price override
    
    Ch.RunningUnitPrice+=Comp.UnitPrice.Value
    if ( Ch.PricedQuantity!=null ) {
      Comp.createDataObject('ExtendedAmount')
      Comp.ExtendedAmount.Value = Comp.UnitPrice.Value*Ch.PricedQuantity.Value
      Comp.ExtendedAmount.CurrencyCode = Comp.UnitPrice.CurrencyCode
      def fromUomCode = null
      def fromUomValue = null
      if ( 'COVERED_STANDARD' == Line.ItemType && Line.PhantomFlag ){
        fromUomCode = Ch.CoverageDurationUOMCode
        fromUomValue = Ch.CoverageDuration.Value
      }else if ( Line.ItemType in ['STANDARD', 'COMPONENT', 'ROOT'] && null != Line.ServiceDuration?.Value  && null != Line.ServiceDurationPeriodCode ) {
        fromUomCode = Line.ServiceDurationPeriodCode
        fromUomValue = Line.ServiceDuration?.Value
      }
      if (null != fromUomCode &&  null != fromUomValue)  {
        Comp.createDataObject('CoverageExtendedAmount')
        if ('ONE_TIME' == Ch.PriceTypeCode) {            
          Comp.CoverageExtendedAmount.Value =  Comp.ExtendedAmount.Value
        }else if ('RECURRING' == Ch.PriceTypeCode) {
          if (Ch.PricePeriodicityCode != fromUomCode) {
            def   fromUom = getOKCUomMappings(fromUomCode)
            def   toUom = getOKCUomMappings(Ch.PricePeriodicityCode)
                    
            if(null == fromUom || null == toUom){
              Line.MessageTypeCode = 'ERROR'
                Ch.MessageTypeCode = Line.MessageTypeCode
                def uomMsg = Message.insert([
                MessageName:'QP_PDP_PARTIAL_PERIOD_UOM_NA',
                MessageTypeCode: 'ERROR',
                ErrorType:(Ch.HasPercentPriceFlag?'PERCENTAGE':'AMOUNT'),
                PricingMessageId: getNextId(),
                ParentEntityCode: 'LINE', 
                ParentEntityId: Line.LineId, 
                HeaderId: Header.HeaderId])
              def chargeName = getChargeDefinitionName(Ch.ChargeDefinitionId)
              if(null == fromUom){
                def fromUomTranslation = getUomTranslation(fromUomCode)
                uomMsg.MessageText = getFndMessage('QP', 'QP_PDP_PARTIAL_PERIOD_UOM_NA', ['CHARGE_DEF_NAME':chargeName?.Name , 'UOM_CODE':fromUomTranslation?.UnitOfMeasure])
                }
                    
              if(null == toUom){
                def toUomTranslation = getUomTranslation(Ch.PricePeriodicityCode)
                uomMsg.MessageText = getFndMessage('QP', 'QP_PDP_PARTIAL_PERIOD_UOM_NA', ['CHARGE_DEF_NAME':chargeName?.Name , 'UOM_CODE':toUomTranslation?.UnitOfMeasure])
                }
              }
                       
              if(null != fromUom && null != toUom){
                durationConvRate = getDurationConversionRate(fromUom, toUom, CoverageAssociation, Line)
                if(null == durationConvRate){
                def fromUomTranslation = getUomTranslation(fromUomCode)
                def toUomTranslation = getUomTranslation(Ch.PricePeriodicityCode)
                Line.MessageTypeCode = 'ERROR'
                Ch.MessageTypeCode = 'ERROR'
                Message.insert([
                  MessageName:'QP_PDP_PARTIAL_PERIOD_CONVERS',
                  MessageText: getFndMessage('QP', 'QP_PDP_PARTIAL_PERIOD_CONVERS',
                    ['UOM': toUomTranslation?.UnitOfMeasure, 'COV_UOM': fromUomTranslation?.UnitOfMeasure]),
                  MessageTypeCode: Line.MessageTypeCode,
                  ErrorType:(Ch.HasPercentPriceFlag?'PERCENTAGE':'AMOUNT'),
                  PricingMessageId: getNextId(),
                  ParentEntityCode: 'LINE', 
                  ParentEntityId: Line.LineId, 
                  HeaderId: Header.HeaderId])
              } else {
                if( RollupCh != null )
                  RollupCh.PartialPeriodDurationConversionRate = durationConvRate
                  Ch.PartialPeriodDurationConversionRate = durationConvRate
                  Comp.CoverageExtendedAmount.Value =  Comp.ExtendedAmount?.Value * durationConvRate                    
                  }
                }
              } else            
                Comp.CoverageExtendedAmount.Value =  Comp.ExtendedAmount.Value * fromUomValue            
             }
        Comp.CoverageExtendedAmount.CurrencyCode =  Comp.ExtendedAmount.CurrencyCode
      } 
    }
    
    finer(AlgmName+': created '+Comp.PriceElementCode+' charge component '+Comp.ChargeComponentId+' with unit price '+Comp.UnitPrice.Value+' '+Comp.UnitPrice.CurrencyCode+', extended amount '+(Comp.ExtendedAmount!=null ? Comp.ExtendedAmount.Value+' '+Comp.ExtendedAmount.CurrencyCode : null))
    
  13. Click Save and Close.

  14. On the Manage Algorithms page, click Actions > Publish.

Test Your Set Up

  1. On the Manage Algorithms page, open Price Sales Transaction for editing.

  2. On the Edit Algorithm page, click Test.

  3. Click Actions > Add Row, then set the value.

    Attribute

    Value

    Test Case Name

    Test Base Price Override

  4. In the Test Input area, in the row that contains PriceRequest in column Variable Name, click the pencil in the Variable Value column.

  5. In the Edit Variable dialog, delete all the code, then add this code:

    <?xml version="1.0" encoding="UTF-8"?>
    <PriceRequestInternal:PriceRequestInternalType xmlns:ns0="http://xmlns.oracle.com/adf/svc/types/"xmlns:PriceRequestInternal="http://xmlns.oracle.com/apps/scm/pricing/priceExecution/pricingProcesses/pricingInternal/PricingInternal"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PriceRequestInternal:PriceRequestInternalType">
    <PriceRequestInternal:Header>
      <PriceRequestInternal:CustomerId>1028144</PriceRequestInternal:CustomerId>
      <PriceRequestInternal:HeaderId>101</PriceRequestInternal:HeaderId>
      <PriceRequestInternal:CalculatePricingChargesFlag>true</PriceRequestInternal:CalculatePricingChargesFlag>   <PriceRequestInternal:CalculateShippingChargesFlag>false</PriceRequestInternal:CalculateShippingChargesFlag>
    <PriceRequestInternal:CalculateTaxFlag>false</PriceRequestInternal:CalculateTaxFlag>  <PriceRequestInternal:SellingBusinessUnitId>103</PriceRequestInternal:SellingBusinessUnitId>
      <PriceRequestInternal:SellingLegalEntityId>204</PriceRequestInternal:SellingLegalEntityId>
      <PriceRequestInternal:TransactionTypeCode>ORDER</PriceRequestInternal:TransactionTypeCode>
    </PriceRequestInternal:Header>
    <PriceRequestInternal:PricingServiceParameter>
      <PriceRequestInternal:PricingContext>SALES</PriceRequestInternal:PricingContext>
    </PriceRequestInternal:PricingServiceParameter>
    <PriceRequestInternal:Line>
      <PriceRequestInternal:HeaderId>101</PriceRequestInternal:HeaderId>
      <PriceRequestInternal:InventoryItemId>100000017351102</PriceRequestInternal:InventoryItemId>
      <PriceRequestInternal:InventoryOrganizationId>204</PriceRequestInternal:InventoryOrganizationId>
      <PriceRequestInternal:LineId>1001</PriceRequestInternal:LineId>
      <PriceRequestInternal:LineCategoryCode>ORDER</PriceRequestInternal:LineCategoryCode>
      <PriceRequestInternal:LineQuantity unitCode="Ea" xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/">2</PriceRequestInternal:LineQuantity>
      <PriceRequestInternal:LineQuantityUOMCode>Ea</PriceRequestInternal:LineQuantityUOMCode>
      <PriceRequestInternal:LineTypeCode>ORA_BUY</PriceRequestInternal:LineTypeCode>
    </PriceRequestInternal:Line>
    <PriceRequestInternal:LinePrcOverrideEff_Custom>
      <PriceRequestInternal:SalePrcOverrideVal_Custom>1000</PriceRequestInternal:SalePrcOverrideVal_Custom>
      <PriceRequestInternal:FulfillLineId_Custom>1001</PriceRequestInternal:FulfillLineId_Custom>
      <PriceRequestInternal:EffLineId_Custom>123</PriceRequestInternal:EffLineId_Custom>
    </PriceRequestInternal:LinePrcOverrideEff_Custom>
    
    <PriceRequestInternal:ChangeSummary logging="false" xmlns:sdo="commonj.sdo"/>
    </PriceRequestInternal:PriceRequestInternalType>
    

    where

    Value

    Is An Example For

    1028144

    CustomerId

    103

    SellingBusinessUnitId

    204

    SellingLegalEntityId

    100000017351102

    InventoryItemId

    204

    InventoryOrganizationId

    Ea

    unitCode

    Ea

    LineQuantityUOMCode

    <PriceRequestInternal:SalePrcOverrideVal_Custom>1000</PriceRequestInternal:SalePrcOverrideVal_Custom>

    Specifies to override the net price to $1000. Modify this value for your test, as necessary.

    To get the values that you must use in your environment, see section Getting Identifiers for Test Payloads, below in this topic.

  6. Click Run Test > Test Output, then make sure the output payload includes the details you expect.

  7. Verify that Last Execution Status displays Succeeded, or a similar success indication.

    If it displays Failure, then click Show Exception Details to examine and troubleshoot.

    If you receive this error, then use an XML editor to validate that your code uses the correct XML format.

    Error: Unable to parse the variable[PriceRequest] using the service 
    definition [Sales.PriceRequestInternal]. Please check the variable value or service schema
    
  8. Click Save and Close.

  9. On the Manage Algorithms page, click Actions > Publish.

Create a Test Sales Order

  1. Sign out, then sign in with the privileges that you need to manage sales orders.

  2. Click Create Order, enter values for the order header, add an order line, then add a value in your extensible flexfield, such as 199.

  3. Save the sales order, or click Actions > Reprice Order.

  4. Verify that the price of the item includes the price you entered in the extensible flexfield and SalePrcOverrideVal.

Get Identifiers for Test Payloads

  1. Make sure you have the privileges that you need to manage sales orders.

    Go to the Order Management work area, then create a sales order.

    • Set attributes to values you must test.

      Attribute

      Example Value

      Customer

      Fantastic Laptops

      Business Unit

      Vision Operations

    • Add an order line that includes the item you're testing. For this example, add AS54888.

    • Click Submit, then notice the sales order number that Order Management creates, such as 12345.

  2. Get values for the sales order header. Run a SQL query on the database you use to store the sales order that you created in step 1.

    select header_id, sold_to_party_id as CustomerId, org_id as SellingBusinessUnitId, legal_entity_id as SellingLegalEntityId 
    from doo_headers_all where Order_Number = $12345;
    

    where

    • 12345 is the order number you noted in step 1.

    • The query returns values that you can use in your payload for these header attributes.

      Value in SQL

      Provides Value for Attribute in Test Payload

      Example Values

      sold_to_party_id

      Header.CustomerId

      Header_id equals 100413 and CustomerId equals 1006.

      org_id

      Header.SellingBusinessUnitId

      SellingBusinessUnitId equals 204.

      legal_entity_id

      Header.SellingLegalEntityId

      SellinglegalEntityId equals 204.

  3. Get values for the order line. Run this SQL query.

    select inventory_item_id as InventoryItemId, inventory_organization_id as InventoryOrganizationId, ordered_uom as LineQuantityUOMCode from doo_fulfill_lines_all where header_id = $56789;

    where

    • 56789 is the header Id in the query result from step 2.

    • The query returns values that you can use in your payload for these order line attributes.

      Value in SQL

      Provides Value for Attribute in Test Payload

      Example Values

      inventory_item_id

      Line.InventoryItemId

      Header_id equals 100413 and InventoryItemId equals 149.

      inventory_organization_id

      Line.InventoryOrganizationId

      InventoryOrganizationId equals 204.

      ordered_uom

      Line.LineQuantity.UOMCode

      Note that you must replace UOMCode in two different locations in the payload. In this example, the value is Ea.

      LineQuantityUOMCode equals USD.