Page 1 of 1

Inventory SOHCollection class properties

PostPosted: Wed Jul 22, 2020 1:45 pm
by Mark Shipman
Hi,

We need to determine "Available stock on hand" and (with prior assistance from these forums) now have a JiwaInventory.Inventory object for an item.

This object exposes a SOHCollection class, which supports a Read(bool, logical-warehouse) method. Our testing shows this method populates the TotalSOH and Backorders properties of the SOHCollection.

How do we determine "available" from this?

Is available:
    * TotalSOH
    * TotalSOH - Backorders
    * Something else

Many thanks!

Re: Inventory SOHCollection class properties

PostPosted: Wed Jul 22, 2020 2:32 pm
by SBarnes
SOH- BO

The following SQL will also do it, if the object is too slow.


Code: Select all
         SET @CurrentSOH = 0

         SELECT  @CurrentSOH = coalesce( SUM(QuantityLeft),0)
         FROM     dbo.IN_SOH
         WHERE   (InventoryID = @CurrentInventoryID) AND (IN_LogicalID =  @WarehouseID)
         GROUP BY InventoryID, IN_LogicalID

         set @CurrentBO  = 0

         SELECT  @CurrentBO = coalesce( SUM(Quantity) ,0)
         FROM     dbo.IN_OnBackOrder
         WHERE   (InventoryID = @CurrentInventoryID) AND (IN_LogicalID =  @WarehouseID)
         GROUP BY IN_LogicalID, InventoryID

Re: Inventory SOHCollection class properties  Topic is solved

PostPosted: Wed Jul 22, 2020 3:51 pm
by Scott.Pearce
TotalSOH - Backorders