Inventory SOHCollection class properties  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Inventory SOHCollection class properties

Postby Mark Shipman » Wed Jul 22, 2020 1:45 pm

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!
Mark Shipman
Software Developer
Mark Shipman
Occasional Contributor
Occasional Contributor
 
Posts: 21
Joined: Mon Mar 02, 2020 1:44 pm
Location: Auckland, New Zealand

Re: Inventory SOHCollection class properties

Postby SBarnes » Wed Jul 22, 2020 2:32 pm

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
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Inventory SOHCollection class properties  Topic is solved

Postby Scott.Pearce » Wed Jul 22, 2020 3:51 pm

TotalSOH - Backorders
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests