View almasdd.COMPIERE.RV_BPARTNEROPEN

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  √  null
AD_CLIENTINFO AD_CLIENT_ID Implied Constraint
AD_ORG_ID number 10  √  null
AD_ORGINFO AD_ORG_ID Implied Constraint
ISACTIVE char 1  √  null
CREATED date 7  √  null
CREATEDBY number 10  √  null
UPDATED date 7  √  null
UPDATEDBY number 10  √  null
C_BPARTNER_ID number 10  √  null
C_BPARTNER C_BPARTNER_ID Implied Constraint
C_CURRENCY_ID number 10  √  null
C_CURRENCY C_CURRENCY_ID Implied Constraint
AMT number 22  √  null
OPENAMT number 22  √  null
DATEDOC date 7  √  null
DAYSDUE number 22  √  null
View SQL:
SELECT i.AD_Client_ID,i.AD_Org_ID, i.IsActive, i.Created,i.CreatedBy,i.Updated,i.UpdatedBy,
    i.C_BPartner_ID, i.C_Currency_ID,
    i.GrandTotal*i.MultiplierAP AS Amt,
    invoiceOpen (i.C_Invoice_ID, i.C_InvoicePaySchedule_ID)*MultiplierAP AS OpenAmt,
    i.DateInvoiced AS DateDoc, 
    COALESCE(daysBetween(getdate(),ips.DueDate), paymentTermDueDays(C_PaymentTerm_ID,DateInvoiced,getdate())) AS DaysDue
FROM C_Invoice_v i 
  LEFT OUTER JOIN C_InvoicePaySchedule ips ON (i.C_InvoicePaySchedule_ID=ips.C_InvoicePaySchedule_ID)
WHERE IsPaid='N'
 AND DocStatus IN ('CO','CL')
UNION
SELECT p.AD_Client_ID,p.AD_Org_ID, p.IsActive, p.Created,p.CreatedBy,p.Updated,p.UpdatedBy,
    p.C_BPartner_ID, p.C_Currency_ID,
    p.PayAmt*MultiplierAP*-1 AS Amt,
    paymentAvailable(p.C_Payment_ID)*p.MultiplierAP*-1 AS OpenAmt,
    p.DateTrx AS DateDoc,
    null
FROM C_Payment_v p 
WHERE p.IsAllocated='N' AND p.C_BPartner_ID IS NOT NULL
 AND p.DocStatus IN ('CO','CL')


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.