View erp.COMPIERE.M_INOUT_CANDIDATE_V

Generated by
SchemaSpy
Implied relationships Related columns Constraint names Legend
Legend: SourceForge.net
Primary key columns
Columns with indexes
Implied relationships
Excluded column relationships
Dashed lines show
implied relationships
< n > number of related tables
Please support this project 
Column Type Size Nulls Auto Default Children Parents
AD_CLIENT_ID number 10
AD_CLIENTINFO AD_CLIENT_ID Implied Constraint
AD_ORG_ID number 10
AD_ORGINFO AD_ORG_ID Implied Constraint
C_BPARTNER_ID number 10
C_BPARTNER C_BPARTNER_ID Implied Constraint
C_ORDER_ID number 10
C_ORDER C_ORDER_ID Implied Constraint
DOCUMENTNO nvarchar2 60
DATEORDERED date 7
C_DOCTYPE_ID number 10
C_DOCTYPE C_DOCTYPE_ID Implied Constraint
POREFERENCE nvarchar2 40  √  null
DESCRIPTION nvarchar2 510  √  null
SALESREP_ID number 10  √  null
M_WAREHOUSE_ID number 10
M_WAREHOUSE M_WAREHOUSE_ID Implied Constraint
TOTALLINES number 22  √  null
View SQL:
SELECT
o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID,
o.DocumentNo, o.DateOrdered, o.C_DocType_ID, 
    o.POReference, o.Description, o.SalesRep_ID,
    l.M_Warehouse_ID,
SUM((l.QtyOrdered-l.QtyDelivered)*l.PriceActual) AS TotalLines
FROM C_Order o
  INNER JOIN C_OrderLine l ON (o.C_Order_ID=l.C_Order_ID)
WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N')  --  Status must be CO - not CL/RE
-- not Offers and open Walkin-Receipts
AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType
WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR'))
    --  Delivery Rule - not manual
    AND o.DeliveryRule<>'M'
    AND (l.M_Product_ID IS NULL OR EXISTS 
        (SELECT * FROM M_Product p 
        WHERE l.M_Product_ID=p.M_Product_ID AND p.IsExcludeAutoDelivery='N'))
-- we need to ship
AND l.QtyOrdered <> l.QtyDelivered
AND o.IsDropShip='N'
    AND (l.M_Product_ID IS NOT NULL OR l.C_Charge_ID IS NOT NULL)
    --  Not confirmed shipment
    AND NOT EXISTS (SELECT * FROM M_InOutLine iol 
        INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID)
        WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('IP','WC'))
--
GROUP BY o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID,
o.DocumentNo, o.DateOrdered, o.C_DocType_ID,
    o.POReference, o.Description, o.SalesRep_ID, l.M_Warehouse_ID


SchemaSpy was unable to generate a graphical representation of table relationships.
An appropriate version of dot must be in your path when generating these pages.
Requires dot version 2.2.1 or versions greater than 2.4 from www.graphviz.org.