com.ibm.commerce.orderquotation.commands

Class OrderQuotationCreateCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderQuotationCreateCmd, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class OrderQuotationCreateCmdImpl
    extends ControllerCommandImpl
    implements OrderQuotationCreateCmd
    This is the default implementation of the OrderQuotationCreateCmd controller command.

    Parameter values

    quotationData
    The valid value of this parameter is defined by calling the messaging subsystem method. This single valued parameter denotes the information representing a received quotation.

    Behavior

    • Parse the specified quotationData to discover the following information, which will be included in the created quotation Order:
      1. Check whether the required OrderQuotationRelId does not refer to an existing OrderQuotationRel object, try rechecking it for up to 20 seconds. If the OrderQuotationRel object still does not exist, ignore the request (return).
      2. The currency of the quotation is required.
      3. For each quotation item (identified by an original OrderItemId and no original OrderItemComponentListId), following are required:
        1. The original OrderItemId (required). If the original OrderItem no longer exists, ignore the request (return).
        2. The supplierPartNumber and supplierData (optional).
        3. The quoted price (required).
        4. The external UOMCode for quantity amounts in this quotation item (optional).
        5. The quantity for the price quotation (required).
        6. The quantity that was requested (optional).
        7. The quantity available for purchase (optional).
        8. The estimated availability time (optional).
      4. If the OrderQuotationRelId refers to an OrderQuotationRel that already has a quotationOrder, set the quotationOrder to null, and delete the quotationOrder.
      5. Create an order with status attribute I, and set the quotationOrder attribute of the OrderQuotationRel object to its OrderId. If the quotationSource FulfillmentCenter has a quotationStore, create the order in the quotationStore. If childStoreId attribute is not null, create the order in the store it specifies. Otherwise, create the order in the store of the shopping cart. When creating the quotation Order:
        1. Copy the Order level information from the shopping cart Order.
      6. To convert from quoted quantities to BaseItem quantities used in the OrderItem neededQuantity attribute, use externalUOMStandard and QTYUNITMAP table to determine the quoted QuantityUnit. Then convert from that QuantityUnit to the BaseItem quantityMeasure, and then divide by the BaseItem quantityMultiple. To convert from these neededQuantity units to the normalized quantity used in the OrderItem quantity attribute, multiply by the BaseItem quantityMultiple attribute. Convert from BaseItem quantityMeasure units to CatalogEntryShipping quantityMeasure units, round up to the nearest multiple of the CatalogEntryShipping quantityMultiple attribute. And divide by the CatalogEntryShipping nominalQuantity.
      7. Convert the quantity for the price quotation to a normalized quantity, as described above. And then set the unit price (the OrderItem price attribute) to the quoted price divided by the normalized quantity for the price quotation.
      8. Set unit price to the quoted price multiplied by the CatalogEntryShipping nominalQuantity and divided by the quantity for the price (converted to the CatalogEntryShipping quantityMeasure). The unit price is the OrderItem price attribute. It is rounded appropriately using the CurrencyManager.
      9. Set the OrderItem prepareFlags attributes to indicate "quotation".
      10. Convert the quantity that was requested, or, if no quantity was supplied, convert the quantity for the price quotation, and set it to neededQuantity units. Round up to the nearest integer to arrive at the NeededQuantity. Then convert from NeededQuantity units to set the normalized quantity attribute. Then convert the normalized quantity to the NeededQuantity. The normalized multiply by the CatalogEntryShipping nominalQuantity, convert to BaseItem quantityMeasure, divide by the BaseItem quantityMultiple and round to the nearest integer. And set the NeededQuantity attribute.
        If supplied, convert the quantity available for purchase to a BaseItem quantity, and store it in the availableQuantity attribute. Otherwise, copy the neededQuantity to the availableQuantity. If the quantity available for purchase is not supplied, set the quantity available to the quantity used to calculate the neededQuantity. Convert the quantity available for purchase to a BaseItem quantity and set the availableQuantity attribute. Round down to the nearest integer to arrive at the availableQuantity attribute value.
      11. Set the shippingAddress and shippingMode to be the same as the value in the OrderItem indicated by the original OrderItemId.
      12. Set the correlationGroup attribute to be the same as the correlationGroup attribute of the original OrderItemId.
      13. Set the supplierPartNumber and supplierData attributes.
      14. Set the OrderItem tradingAgreementId attribute to the tradingAgreementId attribute of the OrderQuotationRel object.
      15. If the item is a substitution item, set the OrderItems.LineItemType to "ALT".
      16. When creating a quotation OrderItem representing a DynamicKit, then for each quotation component item, create a new component item in the OICOMPLIST table:
        1. Set the OrderItemId to indicate the new quotation OrderItem.
        2. Set the inventoryQuantity attribute to the returned quantity, converted to BaseItem units.
        3. Set the catalogQuantity to the inventoryQuantity, converted from BaseItem units to CatalogEntryShipping nominalQuantity units, divided by the nominalQuantity.
        4. Set the unit price and currency to null (only the quoted price of the whole DynamicKit is available).
        5. Set the configurationId to null. Note: The configurationId is normally supplied by an external configurator. Since the quotation can change the components of a configuration, it would be incorrect to keep the same configurationId. Leaving it null indicates that this configuration arrived as part of a quotation, not from an external configurator.
        6. Set the required catalogEntryId and specifiedItemId attributes to be the same as in the OrderItemComponentList item specified by the original OrderItemConponentListId.
        7. Set the supplierPartNumber and supplierData attributes.
    See Also:
    Serialized Form