View almasdd.COMPIERE.RV_C_INVOICELINE

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
ISACTIVE char 1
CREATED date 7
CREATEDBY number 10
UPDATED date 7
UPDATEDBY number 10
C_INVOICELINE_ID number 10
C_INVOICELINE C_INVOICELINE_ID Implied Constraint
C_INVOICE_ID number 10
C_INVOICE C_INVOICE_ID Implied Constraint
SALESREP_ID number 10  √  null
C_BPARTNER_ID number 10
C_BPARTNER C_BPARTNER_ID Implied Constraint
C_BP_GROUP_ID number 10
C_BP_GROUP C_BP_GROUP_ID Implied Constraint
M_PRODUCT_ID number 10  √  null
M_PRODUCT M_PRODUCT_ID Implied Constraint
M_PRODUCT_CATEGORY_ID number 10  √  null
M_PRODUCT_CATEGORY M_PRODUCT_CATEGORY_ID Implied Constraint
DATEINVOICED date 7
DATEACCT date 7
ISSOTRX char 1
C_DOCTYPE_ID number 10
C_DOCTYPE C_DOCTYPE_ID Implied Constraint
DOCSTATUS char 2
ISPAID char 1
QTYINVOICED number 22  √  null
QTYENTERED number 22  √  null
M_ATTRIBUTESETINSTANCE_ID number 10  √  null
M_ATTRIBUTESETINSTANCE M_ATTRIBUTESETINSTANCE_ID Implied Constraint
PRODUCTATTRIBUTE nvarchar2 4000  √  null
M_ATTRIBUTESET_ID number 10  √  null
M_ATTRIBUTESET M_ATTRIBUTESET_ID Implied Constraint
M_LOT_ID number 10  √  null
M_LOT M_LOT_ID Implied Constraint
GUARANTEEDATE date 7  √  null
LOT nvarchar2 80  √  null
SERNO nvarchar2 80  √  null
PRICELIST number 22
PRICEACTUAL number 22
PRICELIMIT number 22
PRICEENTERED number 22
DISCOUNT number 22  √  null
MARGIN number 22  √  null
MARGINAMT number 22  √  null
LINENETAMT number 22  √  null
LINELISTAMT number 22  √  null
LINELIMITAMT number 22  √  null
LINEDISCOUNTAMT number 22  √  null
LINEOVERLIMITAMT number 22  √  null
View SQL:
SELECT 
il.AD_Client_ID, il.AD_Org_ID, il.IsActive, il.Created, il.CreatedBy, il.Updated, il.UpdatedBy,
il.C_InvoiceLine_ID, i.C_Invoice_ID, i.SalesRep_ID,
i.C_BPartner_ID, i.C_BP_Group_ID,
il.M_Product_ID, p.M_Product_Category_ID,
i.DateInvoiced, i.DateAcct, i.IsSOTrx, i.C_DocType_ID, i.DocStatus, i.IsPaid,
-- Qty
il.QtyInvoiced*i.Multiplier AS QtyInvoiced,
il.QtyEntered*i.Multiplier AS QtyEntered,
    -- Attributes
    il.M_AttributeSetInstance_ID, productAttribute(il.M_AttributeSetInstance_ID) AS ProductAttribute,
    pasi.M_AttributeSet_ID, pasi.M_Lot_ID, pasi.GuaranteeDate, pasi.Lot, pasi.SerNo,
-- Item Amounts
il.PriceList, il.PriceActual, il.PriceLimit, il.PriceEntered,
CASE WHEN PriceList=0 THEN 0 ELSE
  ROUND((PriceList-PriceActual)/PriceList*100,2) END AS Discount,
CASE WHEN PriceLimit=0 THEN 0 ELSE
  ROUND((PriceActual-PriceLimit)/PriceLimit*100,2) END AS Margin,
CASE WHEN PriceLimit=0 THEN 0 ELSE
  (PriceActual-PriceLimit)*QtyInvoiced END AS MarginAmt,
-- Line Amounts
ROUND(i.Multiplier*LineNetAmt, 2) AS LineNetAmt,
ROUND(i.Multiplier*PriceList*QtyInvoiced, 2) AS LineListAmt,
CASE WHEN COALESCE(il.PriceLimit, 0)=0 THEN ROUND(i.Multiplier*LineNetAmt,2) ELSE
ROUND(i.Multiplier*PriceLimit*QtyInvoiced,2) END AS LineLimitAmt,
ROUND(i.Multiplier*PriceList*QtyInvoiced-LineNetAmt,2) AS LineDiscountAmt,
CASE WHEN COALESCE(il.PriceLimit,0)=0 THEN 0 ELSE
ROUND(i.Multiplier*LineNetAmt-PriceLimit*QtyInvoiced,2) END AS LineOverLimitAmt
FROM  RV_C_Invoice i
  INNER JOIN C_InvoiceLine il ON (i.C_Invoice_ID=il.C_Invoice_ID)
  LEFT OUTER JOIN M_Product p ON (il.M_Product_ID=p.M_Product_ID)
  LEFT OUTER JOIN M_AttributeSetInstance pasi ON (il.M_AttributeSetInstance_ID=pasi.M_AttributeSetInstance_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.