View almasdd.COMPIERE.RV_OPENITEM

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_ORG_ID number 10  √  null
AD_ORGINFO AD_ORG_ID Implied Constraint
AD_CLIENT_ID number 10  √  null
AD_CLIENTINFO AD_CLIENT_ID Implied Constraint
DOCUMENTNO nvarchar2 60  √  null
C_INVOICE_ID number 10  √  null
C_INVOICE C_INVOICE_ID Implied Constraint
C_ORDER_ID number 10  √  null
C_ORDER C_ORDER_ID Implied Constraint
C_BPARTNER_ID number 10  √  null
C_BPARTNER C_BPARTNER_ID Implied Constraint
ISSOTRX char 1  √  null
DATEINVOICED date 7  √  null
NETDAYS number 22  √  null
DUEDATE date 7  √  null
DAYSDUE number 22  √  null
DISCOUNTDATE date 7  √  null
DISCOUNTAMT number 22  √  null
GRANDTOTAL number 22  √  null
PAIDAMT number 22  √  null
OPENAMT number 22  √  null
C_CURRENCY_ID number 10  √  null
C_CURRENCY C_CURRENCY_ID Implied Constraint
C_CONVERSIONTYPE_ID number 10  √  null
C_CONVERSIONTYPE C_CONVERSIONTYPE_ID Implied Constraint
C_PAYMENTTERM_ID number 10  √  null
C_PAYMENTTERM C_PAYMENTTERM_ID Implied Constraint
ISPAYSCHEDULEVALID char 1  √  null
C_INVOICEPAYSCHEDULE_ID number 22  √  null
View SQL:
SELECT i.AD_Org_ID, i.AD_Client_ID, 
i.DocumentNo, i.C_Invoice_ID, i.C_Order_ID, i.C_BPartner_ID, i.IsSOTrx,
i.DateInvoiced, 
    p.NetDays, 
paymentTermDueDate(i.C_PaymentTerm_ID, i.DateInvoiced) AS DueDate,
paymentTermDueDays(i.C_PaymentTerm_ID, i.DateInvoiced, getdate()) AS DaysDue,
    addDays(i.DateInvoiced,p.DiscountDays) AS DiscountDate, 
    ROUND(i.GrandTotal*p.Discount/100,2) AS DiscountAmt,
i.GrandTotal, 
invoicePaid(i.C_Invoice_ID, i.C_Currency_ID, 1) AS PaidAmt,
invoiceOpen(i.C_Invoice_ID,0) AS OpenAmt,
    i.C_Currency_ID, i.C_ConversionType_ID, 
    i.C_PaymentTerm_ID,
    i.IsPayScheduleValid, null AS C_InvoicePaySchedule_ID
FROM RV_C_Invoice i
    INNER JOIN C_PaymentTerm p ON (i.C_PaymentTerm_ID=p.C_PaymentTerm_ID)
WHERE --    i.IsPaid='N'
    invoiceOpen(i.C_Invoice_ID,0) <> 0
    AND i.IsPayScheduleValid<>'Y'
    AND i.DocStatus<>'DR'
UNION
SELECT i.AD_Org_ID, i.AD_Client_ID, 
    i.DocumentNo, i.C_Invoice_ID, i.C_Order_ID, i.C_BPartner_ID, i.IsSOTrx,
i.DateInvoiced,
    daysBetween(ips.DueDate,i.DateInvoiced) AS NetDays,
    ips.DueDate,
    daysBetween(getdate(),ips.DueDate) AS DaysDue,
    ips.DiscountDate, 
    ips.DiscountAmt,
ips.DueAmt AS GrandTotal, 
invoicePaid(i.C_Invoice_ID, i.C_Currency_ID, 1) AS PaidAmt,
invoiceOpen(i.C_Invoice_ID, ips.C_InvoicePaySchedule_ID) AS OpenAmt,
    i.C_Currency_ID, i.C_ConversionType_ID, 
    i.C_PaymentTerm_ID,
    i.IsPayScheduleValid, ips.C_InvoicePaySchedule_ID
FROM RV_C_Invoice i
    INNER JOIN C_InvoicePaySchedule ips ON (i.C_Invoice_ID=ips.C_Invoice_ID)
WHERE  --   i.IsPaid='N'
    invoiceOpen(i.C_Invoice_ID,ips.C_InvoicePaySchedule_ID) <> 0
    AND i.IsPayScheduleValid='Y'
    AND i.DocStatus<>'DR'
    AND ips.IsValid='Y'


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.