Overview
This command will list the storerooms of which a supply is part.
Related tables
TABLE
|
Description
|
Primary key (PK)
|
Connection tables
|
GNSTOREROOM
|
Storeroom record
|
CDSTOREROOM
|
ADDEPARTMENT
GNCUSTOMER
GNFAVORITE
GNREPOSITORYTYPE
GNSTORAGETYPE
GNSTOREROOMTYPE
GNSUPPLIER
GNTRANSSETTING
|
GNSTOREROOMOBJECT
|
Storeroom object record
|
CDSTOREROOMOBJECT
|
GNSTOREROOM
|
GNSTOREROOMCAPPHYSFILE
|
Storeroom capacity record
|
CDCAPPHYSFILE
|
GNSTOREROOM
GNSTOREROOMOBJECT
|
OBSTOREROOMITSUP
|
Association of a storeroom with a supply
|
CDSTOREROOMOBJECT
CDREVISION
|
ADMEASUNITY
GNSTOREROOMOBJECT
OBOBJECT
|
OBOBJECT
|
Item/Asset/Supply data based on revision
|
CDOBJECT
CDREVISION
|
ADTEAM
GNASSOC
GNREVISION
OBOBJECTGROUP
OBSUBREASON
|
GNSTOREROOMOBJECTCOST
|
Unit cost of the object
|
CDSTOREROOMOBJECTCOST
|
GNSTOREROOM
|
Oracle/Postgres/SQL Server
SELECT
STM.NMSTOREROOM,
STMR.NMSTOREROOM AS NMREPOSITORY,
GNOC.VLQUANTTOTAL AS QTSTOCK,
STMO.VLREPLACEMENT,
STMO.VLOPTIMUM
FROM GNSTOREROOM STM
INNER JOIN GNSTOREROOMOBJECT STMO ON (STM.CDSTOREROOM = STMO.CDSTOREROOM)
LEFT OUTER JOIN GNSTORECAPPHYSFILE CAP ON (CAP.CDSTOREROOMOBJECT = STMO.CDSTOREROOMOBJECT)
LEFT OUTER JOIN GNSTOREROOM STMR ON (CAP.CDSTOREROOM = STMR.CDSTOREROOM AND (CAP.CDSTOREROOM = STM.CDSTOREROOM OR STMR.CDSTOREROOMREF = STM.CDSTOREROOM))
INNER JOIN OBSTOREROOMITSUP SPTM ON (SPTM.CDSTOREROOMOBJECT = STMO.CDSTOREROOMOBJECT)
INNER JOIN OBOBJECT OBJ ON (OBJ.CDOBJECT = SPTM.CDOBJECT AND OBJ.CDREVISION = SPTM.CDREVISION)
LEFT OUTER JOIN GNSTOREROOMOBJECTCOST GNOC ON (GNOC.CDOBJECT = SPTM.CDOBJECT AND GNOC.CDSTMPLACE = STMR.CDSTOREROOM)
WHERE OBJ.IDOBJECT = 'SUPPLY_ID' /*NOTE 1*/
|
Notes
▪1: ID # of the supply to be filtered.
Fields used on the view screen
#
|
Field ID
|
Type
|
Description
|
1
|
NMSTOREROOM
|
VARCHAR(255)
|
Storeroom
|
2
|
NMREPOSITORY
|
VARCHAR(255)
|
Location
|
3
|
VLQUANTTOTAL
|
NUMERIC(28,12)
|
Stock amount
|
4
|
VLREPLACEMENT
|
NUMERIC(28,12)
|
Reorder point
|
5
|
VLOPTIMUM
|
NUMERIC(28,12)
|
Ideal quantity
|
|