CREATE OR REPLACE VIEW adempiere.JP_StorageOnHand_OrgWH AS
SELECT 
 s.AD_Client_ID AS AD_Client_ID
 ,s.AD_Org_ID AS AD_Org_ID
 ,loc.M_Warehouse_ID AS M_Warehouse_ID
 ,s.M_Product_ID AS M_Product_ID
 ,SUM(s.QtyOnHand) AS QtyOnHand
FROM adempiere.M_StorageOnHand s 
	INNER JOIN adempiere.M_Locator loc ON (s.M_Locator_ID = loc.M_Locator_ID)
GROUP BY s.AD_Client_ID,s.AD_Org_ID ,loc.M_Warehouse_ID ,s.M_Product_ID;