Version: eXtendOrders 2.1.1
Audience: Administrator

Use Case 
  • Set up eXtendOrders for embroidery and to auto-calculate charges when:
    • Pricing is based on the range of embroidery thread used.
    • Pricing is not based on the range of embroidery thread.

Overview

Embroidery is a unique imprinting method that differs from other methods because it includes an additional unit of measure: thread count. With eXtendOrders, you can configure embroidery as an imprint method with varying thread count quantity pricing.

Configuration Details

When using the Supplier Edition of eXtendOrders, you can use embroidery as an imprint method and have the pricing calculated by eXtendOrders. Below is a list of steps that need to be configured in your account to enable the proper functioning of the embroidery imprint method:

  1. Creation of charge items with embroidery information
    You will need to create or update your existing charge items (Setup, Repeat Setup, First Run, Additional Run Charge items) with embroidery-related fields:
    1. EXTENDORDERS Y-UOM
      Specify "Stitches" in this field. It will be used as the Y-UOM for the embroidery imprint method.
    2. EXTENDORDERS Y QTY
      Specify the Y UOM quantity on which this item will be used.

      Note: If you want to use different pricing for multiple Y-UOM quantity breaks (multiple thread count breaks), create child items against a main item and specify the quantity breaks under this field.
    3. EXTENDORDERS Y-QTY PER N UOM
      If you use the specified quantity of Y-UOM per N number of Y, you can specify that value in this field. The default value for this field is considered 1000 if you are using the hook function configured by eXtendTech in your account.
      Image Placeholder
  2. Adding function in suite_orders_custom_hook_functions.js fileIf the eXtendOrders bundle was installed in your account after August 2020, this snippet is already present in your account. If not, you will need to add the following function to create a custom calculation method that will be used for calculating the quantity of charge items for embroidery imprint method.
    /**
     * @param {Object} args
     * @property {Boolean} args.isSupplierEdition
     * @property {String} args.imcRefId
     * @property {Object} args.imcImprintMethodMap
     * @property {String} args.numberOfLocation
     * @property {String} args.mainItemQuantity
     * @property {String} args.numberOfColor
     * @property {Object} args.imcGroupIdImcMap
     * @property {String} args.imcGroupId
     * @property {Object} args.imcIdYuomMap
     * @property {String} args.noOfyUomCount
     */
    function hook_Embroidery_Calculation(args) {
      var toReturn = {
        noOfSetup: 0,
        setupItemId: '',
        setupItemName: '',
        noOfFirstRun: 0,
        firstRunItemId: '',
        firstRunItemName: '',
        noOfAdditionalRun: 0,
        additionalRunItemId: '',
        additionalRunItemName: '',
      };

      var isSupplierEdition = args.isSupplierEdition;
      var imcRefId = args.imcRefId;
      var imcImprintMethodMap = args.imcImprintMethodMap;
      var numberOfLocation = args.numberOfLocation;
      var mainItemQuantity = args.mainItemQuantity;
      var numberOfColor = args.numberOfColor;
      var imcGroupIdImcMap = args.imcGroupIdImcMap || {};
      var imcGroupId = args.imcGroupId || '';
      var imcIdYuomMap = args.imcIdYuomMap;
      var noOfyUomCount = args.noOfyUomCount || 0;
      var noOfSetup = 0;
      var noOfFirstRun = 0;
      var noOfAdditionalRun = 0;

      if (!isSupplierEdition || !imcIdYuomMap[imcRefId]) {
        return toReturn;
      }

      var chargeItemsObject = imcGroupIdImcMap[imcGroupId] || {};
      var setupRunItems = (chargeItemsObject.setup && Array.isArray(chargeItemsObject.setup) && chargeItemsObject.setup) || [];
      var firstRunItems = (chargeItemsObject.firstRun && Array.isArray(chargeItemsObject.firstRun) && chargeItemsObject.firstRun) || [];
      var additionalRunCahrgeItems = (chargeItemsObject.additionalRun && Array.isArray(chargeItemsObject.additionalRun) && chargeItemsObject.additionalRun) || [];

      var embSetupChargeItemObject = setupRunItems.find(function (setupRunItem) {
        if (noOfyUomCount >= setupRunItem.yQty) {
            return setupRunItem;
        }
      }) || {};

      var embFirstRunChargeItemObject = firstRunItems.find(function (firstRunItem) {
        if (noOfyUomCount >= firstRunItem.yQty) {
            return firstRunItem;
        }
      }) || {};

      var embAddRunChargeItemObject = additionalRunCahrgeItems.find(function (additionalRunCahrgeItem) {
        if (noOfyUomCount >= additionalRunCahrgeItem.yQty) {
            return additionalRunCahrgeItem;
        }
      }) || {};

      if (embAddRunChargeItemObject.yQtyNUom) {
        noOfAdditionalRun = (mainItemQuantity * noOfyUomCount) / parseFloat(embAddRunChargeItemObject.yQtyNUom);
      } else {
        noOfAdditionalRun = (mainItemQuantity * noOfyUomCount);
      }

      toReturn.noOfSetup = 1;
      toReturn.setupItemId = embSetupChargeItemObject.id || '';
      toReturn.setupItemName = embSetupChargeItemObject.itemName || '';

      toReturn.noOfFirstRun = 0; // Currently returing it 0
      toReturn.firstRunItemId = embFirstRunChargeItemObject.id || '';
      toReturn.firstRunItemName = embFirstRunChargeItemObject.itemName || '';

      toReturn.noOfAdditionalRun = noOfAdditionalRun || 0;
      toReturn.additionalRunItemId = embAddRunChargeItemObject.id || '';
      toReturn.additionalRunItemName = embAddRunChargeItemObject.itemName || '';

      return toReturn;
    }

    1. Details regarding charge items' calculation:
      1. Setup charge item quantity: This will always set as 1.
      2. First run charge: This will always set as 0.
      3. Additional run charge: This will be calculated based on the specified Y-UOM quantity, Main Item quantity (on the Configurator UI) and the EXTENDORDERS Y-QTY PER N UOM specified on the charge item. The calculation will be ((Y-UOM quantity / EXTENDORDERS Y-QTY PER N UOM) * MAIN ITEM QUANTITY).
  3. Creating IMC Setups and Run Config for Embroidery Imprint Method
    To create IMC Setups and Run Config records, see Ensure correct # of setups/runs are calculated as per imprint Methods. During creation of this record for embroidery use, you must add a new option against the Calculation Method field with the name: hook_Embroidery_CalculationImage Placeholder

    If you already have a calculation record against the embroidery imprint method, you can modify it with the new calculation method as specified previously instead of creating a new eXtendOrders IMC Setup & Runs Calc record.
  4. Creating/Updating Imprint Method Configuration for Embroidery Imprint Method
    Go to your existing Imprint Method Configuration record for the embroidery imprint method and swap the charge items with the new embroidery charge items.
     
    To create a new Imprint Method Configuration record, follow the steps below:
    1. Go to Customization  List, Records & Fields  Record Types.
    2. Search for eXtend IMC Imprint Method Configuration and click New Record.
    3. Specify values against the fields as per your requirements and use the charge items created for embroidery in the prior steps.
      Image Placeholder
    4. Save the record.
Once the configurations are in place, the Y-UOM will now appear on eXtendOrders Configurator UI upon selection of the embroidery Imprint Config(IMC) as shown in the screenshot below:
Image Placeholder 
Note: The fields displayed on your Configurator UI may differ based on the eXtendOrders configuration in your account.