Version: eXtendPS-SE 1.4.3
Audience: Administrator

Use Case

  • In the response from eXtendPS-SE's Product Pricing and Configuration service, send the item's specified minimum quantity instead of the "quantity 0" price

Summary

There are use cases when you don't want to suppress the "0" quantity break for an item in the Product Pricing & Configuration service response, but you want to show the item's minimum quantity instead.
Image Placeholder

Configuration Details

  1. Confirm that the Exclude Quantity Head 0 Prices preference is not enabled in your eXtendPS-SE Product Pricing and Configuration Setup.Image Placeholder
  2. Open the script file suite_promoapi_invoice_transformers.js.
  3. Edit the script, add the snippet below, and save the script changes. The snippet is used to return the item's associated 'minimumquantity' field value instead of the quantity 0 price break.
    /**
     * @service Product Pricing & Configuration Service (1.0.0)
     * @desc Customizes individual part price objects (adjusting effective dates, price UOM, or tier flags).
     *
     * @param {Object} args
     * @param {Object} args.itemData - Metadata for the current item / part ({ priceType, PartPriceArray, partId })
     * @param {String} args.itemData.priceType - Price type enum (e.g. "List", "Net")
     * @param {Array} args.itemData.PartPriceArray - Array of part price tiers
     * @param {String} args.itemData.partId - Part SKU identifier
     * @param {Object} args.itemPriceObject - Default constructed part price object ({ price, discountCode, priceUom, priceEffectiveDate, priceExpiryDate })
     * @param {Number|String} args.itemPriceObject.price - Tier calculated unit price
     * @param {String} args.itemPriceObject.discountCode - Industry discount code (e.g. "A", "P", "G")
     * @param {String} args.itemPriceObject.priceUom - Price unit of measure (e.g. "EA")
     * @param {String|Object} args.itemPriceObject.priceEffectiveDate - Effective start date ISO string
     * @param {String|Object} args.itemPriceObject.priceExpiryDate - Expiry date ISO string
     * @param {Number|String} args.itemPriceObject.minQuantity - Tier minimum quantity threshold
     * @param {Object} args.itemSearchResult - NetSuite SearchResult for the current item
     * @param {Array<Object>} args.itemSearchResults - Full pricing search results array
     * @returns {Object} Final modified part price object
     */
     function pcGetItemPriceObject(args) {
      var itemPriceObject = args.itemPriceObject;
      var itemSearchResult = args.itemSearchResult;

      if (itemPriceObject.minQuantity == 0) {
        var minimumQuantity = itemSearchResult.getValue({ name: 'minimumquantity' });

        if (minimumQuantity) {
          itemPriceObject.minQuantity = minimumQuantity;
        }
      }

      return itemPriceObject;
    }
  4. Check the PromoStandards Product Pricing and Configuration response to confirm the expected output.