Monday, June 13, 2011

Commerce Server Inventory System Part 4

Inventory Site Resources

In addition to metadata stored about the Inventory System, Commerce Server also has inventory settings stored as site resources. Site resources are entities that provide functionality to a specific Commerce Server site. These settings can be viewed and modified through the Commerce Server Manager (see Figure 4-3). Inventory site resources override properties defined within the Inventory System metadata.
The inventory site resources include the following:
· Display Backordered Items. This resource is used to indicate whether or not backordered SKUs are displayed on the Web site. If the value is -1 (True), then backordered SKUs are displayed on the Web site, whereas a value of 0 (False) indicates that backordered SKUs are not displayed on the Web site.
· Display Out of Stock Items. This resource is used to indicate whether or not out-of-stock SKUs are displayed on the Web site. If the value is -1 (True), then out-of-stock SKUs are displayed on the Web site, whereas a value of 0 (False) indicates that out-of-stock SKUs are not displayed on the Web site.
· Display Preordered Items. This resource is used to indicate whether or not pre-ordered SKUs are displayed on the Web site. If the value is -1 (True), then pre-ordered SKUs are displayed on the Web site, whereas a value of 0 (False) indicates that pre-ordered SKUs are not displayed on the Web site.
· Ignore missing Skus. This resource is used to indicate whether products that are missing SKUs are treated as in stock or out-of-stock. A product or product variant may be missing a SKU if the inventory metadata has not yet been defined for the product or product variant. If the value is -1 (True), then products or product variants missing SKUs are treated as in stock, whereas a value of 0 (False) indicates that products or product variants missing SKUs are treated as out-of-stock.
· Inventory Database. This resource is used to store the inventory database connection string. This connection string must be unique across all Commerce Server sites.
· Record Inventory Deltas. This resource is used to indicate whether or not to record quantity decrements and increments when buyers purchase items or return items on the Web site. If the value is -1 (True), then increments and decrements are recorded, whereas a value of 0 (False) indicates increments and decrements are not recorded.
· Stock Handling. This resource is used to indicate whether or not there is special handling associated to SKUs. Special handling includes back-orders and pre-orders. A value of 0 (False) indicates that there is no special handling, and that SKUs cannot be back-ordered or pre-ordered. A value of 1 (True) indicates that there is special handling, and that SKUs can be back-ordered and pre-ordered. This setting overrides the Backorderable and Preorderable metadata settings associated with the Inventory System.
· Use stockout threshold for floor. This resource is used to indicate whether to use a global value for the stockout threshold or to identify the stockout threshold individually for each SKU. A value of 0 (False) indicates that the stockout threshold for all SKUs is overridden to be 0. A value of -1 (True) indicates that the stockout threshold defined for the SKU (i.e. the floor value) is used.
Figure 4-3
Figure 4-3 shows the Inventory System site resources that are modified through the Commerce Server Manager.
Determining the condition of the SKU is an important concept to understand. The condition of a SKU could be out-of-stock, in stock, back-ordered, or pre-ordered. Settings from both the Inventory System metadata, as well as Inventory Site Resources, are used in determining the condition of a SKU. This model is depicted in Figure 4-4.

Figure 4-4
The first aspect that is evaluated is whether or not the product catalog is mapped to an inventory catalog. If not, then the site resource setting for “Ignore missing Skus” is evaluated to see how the lack of an inventory catalog should be handled. If the value is false, then the SKU is considered to be in stock. If the value is true, then the SKU is considered to be out-of-stock. If the product catalog is mapped to an inventory catalog, then the “Stock Handling” resource setting is evaluated to see if special handling rules are applied.
If the “Stock Handling” value is false, then the SKU “Status” property is evaluated. If the status is disabled, then the SKU is considered out-of-stock. If the status is ignored, then the SKU is considered in stock. If the status is enabled, then the onhand quantity is compared to the effective stockout threshold. If the onhand quantity is greater than the effective stockout threshold, the SKU is considered in stock. If the onhand quantity is less than or equal to the effective stockout threshold, the SKU is considered out-of-stock.
If the “Stock Handling” resource setting is true, then the process is the same for the disabled and ignored statuses. If the status is enabled, then the special handling rules are evaluated. If the onhand quantity is greater than the effective stockout threshold, then the SKU is considered in stock. If the SKU is pre-orderable and the onhand quantity is greater than the effective stockout threshold and the pre-order limit, then the SKU is considered pre-orderable. If the SKU is back-ordered and the onhand quantity is greater than the effective stockout threshold, the pre-order limit, and the back-order limit, then the SKU is considered back-order. Otherwise, the SKU is considered out-of-stock.
This example serves as an excellent example of how the Inventory System metadata and site resources work together to manage inventory in Commerce Server. The various settings and configurations allow for a great deal of flexibility and control over how the Commerce Server inventory processes operate.
Based on my book on Commerce Server. Part 5 is here. Part 1.