Feature - Sales Order Import Warehouse Location Based on Distance from Ship-To Location

Feature - Sales Order Import Warehouse Location Based on Distance from Ship-To Location

Release Date: 8/7/25
Version: 8.5 and Above

This feature is applicable for users with multiple warehouse locations who are using EDI sales order import. The trading partner chooses not to specify the warehouse location for the fulfillment of the order. Instead, the trading partner requests shipment from the closest location where the inventory is in stock. 

This feature allows the user to choose if Sales Order Import will determine which warehouse location is the shortest distance from the ship-to location. For example, a customer could have multiple warehouse locations such as CA, TX, and NJ. Some trading partners may consider it to be cost prohibitive to ship from the main warehouse when a secondary warehouse may be closer and have inventory available. On the other hand, some trading partners may prefer to specify the warehouse location when sending an order. Therefore, this feature can be enabled at a global level or on a trading partner by trading partner basis.

Global Setup

This feature is enabled through System Utilities-> Global Setup-> Add-Ons-> Sales Order Import-> fields 32 through 35.



 32. Determine Locations Based On Distance? - Default is N. Options are Y=Yes, No=N, and C=Customer EDI Profile. If set to C, this option is only applicable if the customer's EDI profile is set up to use the distance calculation.
 33. Fulfillment Locations - Enter up to 10 warehouse locations to be considered as warehouses to use for distance calculations. If no warehouse locations are entered, field 32 will be set to N.
 34. Only Use Location Qty Available > 0 - Default is N. Enter Y if a warehouse location should only be chosen when there is quantity available to ship at that location.  Users with a short turnaround would set this to Y.  Users with orders that normally require a longer production cycle would set this to N. Quantity available is calculated using the standard quantity available calculation:
       Quantity On Hand - Quantity Allocated.
 35. Use Qty Avail in QTYAVAILBYCOMP Attribute? Default is N. If 34. Only Use Location Qty Available is set to Y, this can be enabled for users who use the QTYAVAILBYCOMP attribute.  This will only consider locations where the Stock Qty Available is greater than zero in the QTYAVAILABYCOMP attribute. 
       

Customer EDI Profile

If option 32. Determine Locations Based On Distance is set to C, the option Determine Locations Based On Distance should be set to Y for trading partners who require this feature. This field is available on EDI Profile Data screen 7 field 15. Determine Locations Based On Distance.


                                        
15. Determine Locations Based On Distance - Default is N. If set to Y, warehouse locations for orders imported through Sales Order Import will be determined based on distance if a warehouse location is not provided in the import file.

Zip Code File

The distance calculation uses the latitude and longitude provided in the Zip Code File (SYZIPCDS) to determine the distance between the ship-to zip code and the warehouse location zip code. This is accessible from System Utilities-> Zip Code File. 



The latest SYZIPCDS.BTR file resides in the <ElliottRoot> folder and is updated when Elliott updates are installed. On the other hand, the maintenance of the SYZIPCDS table is done individually in the <ElliottRoot>\DATA* folder on a company-by-company basis. If this table in the DATA* folders is out of date, the data should be synchronized with the latest table provided. Click here for instructions on how to update the zip code table.

What If a Provided Zip Code Does Not Exist in our Zip Code File?

Our distance calculation is based on a 5-digit zip code. Various Elliott tables support a 10-digit zip code but this calculation only uses the first 5 digits.  It is possible a new 5-digit zip code does not exist in the Zip Code file.  In that case, the program will use the first 4 digits of the zip code to start and find the closest zip code.  For example, if zip code 91788 does not exist in the zip code table, then the application will read all of the zip codes starting with 9178 to find zip codes between 91780 and 91789.  The closest lower zip codes will be used. That is to say, if 91780, 91782, 91784, 91785, 91789 exist, the application will use 91789 for the distance calculation because it is the closest (off by 1, vs 91785 which is off by 3).  On the other hand, if both 91787 and 91789 are found, then we will use 91787 because it is off by 1, and it is the lower zip code instead of 91789 which is the higher zip code.  If no zip codes are found with the 4-digit zip code, then the application will try with the first 3 digits of the provided zip code (e.g. ,917 in this example). If there are no zip codes found for 917* in the zip codes database, then it is an error condition.  

Location File

Zip codes must be provided for each warehouse specified in System Utilities-> Global Setup-> Add-Ons-> Sales Order Import-> Field 33. Fulfillment Locations. Go to Inventory Management-> Maintenance-> Location File and verify that an address has been provided for each location specified.


Sales Order Import

Based on the flags in Global Setup and Customer EDI Profile, Sales Order Import can determine location warehouse location by distance:

  1. If the Sales Order import ASCII file already has a warehouse location specified, the application will use that value and skip the logic to determine location by distance.
  2. If Only Use Location Qty Available > 0 is “Y” and Use Location in QTYAVAILBYCOMP = “Y,” then the application will use the Stock Qty Available field in the QTYAVAILBYCOMP attribute to determine the available qty. This may be the QTYAVAILBYCOMP attribute for the item's primary (IMITMFIL) or secondary location (IMINVLOC). If the corresponding attribute is not found, the application will assume that there is no quantity available at that location.  Otherwise, the application will use the Stock Qty Available to determine the available qty at that location.
  3. If Only Use Location Qty Available > 0 is “Y” and Use Location in QTYAVAILBYCOMP = “N,” the application will only consider those locations with a quantity available greater than zero. Quantity available is calculated using the standard formula: Quantity On Hand - Quantity Allocated.
  4. If Only Use Location Qty Available > 0 is “Y” and no locations have quantity available, the order warehouse location will be determined using the default hierarchy:
    1. If the order has a ship-to provided and that ship-to has a default location specified, the ship-to default location will be used.
    2. Otherwise, if the customer has a default location specified in the customer file, the customer default location will be used.
    3. Otherwise, the default location specified in I/M Setup will be used.
  5. If Only Use Location Qty Available > 0 is set to “Y,” one potential issue is the sales order could contain multiple line items. Different line items may have different stocking availability at different locations.  However, only one location can be specified per order.  With this issue, the application will use the first line item on the order to determine the order's warehouse location.  The application will assume the first line item is the primary line item and if there are additional line items, they are considered as accessories line items.  This feature does not support splitting a single import order into multiple orders.
  6. If Only Use Location Qty Available > 0 is “N,” it means the determination of warehouse is strictly based on distance without considering qty availability.
  7. Regardless of the value in Only Use Location Qty Available > 0, if there’s only one valid location, the application will directly use that location without calculating distance. 
Note: While an imported sales order may contain multiple line items, only one ship-from location can be assigned per sales order. Therefore, inventory availability is determined based on the first line item of the order. If a sales order needs to be shipped from multiple locations based on the availability of individual line items, it is recommended that each imported sales order contains only one line item. Elliott can optionally consolidate the orders based on the PO number after import.

Programs Added: SYDSTCAL.WS, SYDSTCAL.CBL
Programs Modified: NSCTLFIL.FD, NSCTLFIL.W41, NSCTLINI, NSCTLMNV, ARCUSEXT.FD, ARCUSEDI.CBL, CPORDIMP.CBL
CLS

    • Related Articles

    • Feature - Project & Calculate Distance Between Two Zip Codes

      Release Date: 8/7/25 Version: 8.5 and Above The utility program SYDSTCAL.CBL is used to calculate the distance between two zip codes. To calculate the distance between two ZIP codes using latitude and longitude (from their geographic centers), the ...
    • Feature - Avalara Tax Code Support in Sales Order Import

      Release Date: 9/6/23 Version: 8.6 and Above Sales Order Import now determines the correct tax codes for an order based on the ship-to state and country for the order. First, the application will determine if the address is a foreign address (non-US ...
    • Feature - Sales Order Import Can Now Check History For Duplicate PO Numbers

      Release Date: 05/22/2025 Version: 8.5 & Up This feature is to address a problem when an order was processed, posted, and purged and Sales Order Import did not flag an order as a duplicate PO, so the order was shipped again. This typically happens ...
    • Feature - Check for Duplicate PO During Sales Order Import

      Release Date: 7/19/2016 A new feature has been added to COP Sales Order Import that will check imported orders for potential duplicates. Setup by entering "Y" in Global Setup - > Add-ons -> Sales order import, field 23. When running Sales Order ...
    • Feature - Drop Ship Enhancement

      The purpose of this feature is to add the ability to input, process and ship drop-ship orders to consumers for our customers while adhering to already existing business rules. This support is implemented through the use of the Customer Type File ...