テーブル情報
システム名 http://www.as-link.com/  作成者 秦 松甫 
サブシステム名 ERPlus@iDempiere3.1_daily  作成日 2016/3/7 
スキーマ名 adempiere  更新日  
論理テーブル名   RDBMS  PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9), 64-bit 9.4.5 
物理テーブル名 rv_openitemtodate     
備考


カラム情報
No 論理名 物理名 データ型 Not Null デフォルト 備考
1 ad_org_id numeric(10)  
2 ad_client_id numeric(10)  
3 documentno character varying(30)  
4 c_invoice_id numeric(10)  
5 c_order_id numeric(10)  
6 c_bpartner_id numeric(10)  
7 issotrx character(1)  
8 dateinvoiced timestamp without time zone  
9 dateacct timestamp without time zone  
10 netdays numeric  
11 duedate timestamp with time zone  
12 daysdue integer  
13 discountdate timestamp without time zone  
14 discountamt numeric  
15 grandtotal numeric  
16 c_currency_id numeric(10)  
17 c_conversiontype_id numeric(10)  
18 c_paymentterm_id numeric(10)  
19 ispayschedulevalid character(1)  
20 c_invoicepayschedule_id numeric  
21 invoicecollectiontype character(1)  
22 c_campaign_id numeric(10)  
23 c_project_id numeric(10)  
24 c_activity_id numeric(10)  


ソース
ソース
 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,
i.dateacct,
p.netdays,
paymenttermduedate(i.c_paymentterm_id, (i.dateinvoiced)::timestamp with time zone) AS duedate,
paymenttermduedays(i.c_paymentterm_id, (i.dateinvoiced)::timestamp with time zone, getdate()) AS daysdue,
adddays((i.dateinvoiced)::timestamp with time zone, p.discountdays) AS discountdate,
currencyround(((i.grandtotal * p.discount) / (100)::numeric), i.c_currency_id, 'N'::character varying) AS discountamt,
i.grandtotal,
i.c_currency_id,
i.c_conversiontype_id,
i.c_paymentterm_id,
i.ispayschedulevalid,
NULL::numeric AS c_invoicepayschedule_id,
i.invoicecollectiontype,
i.c_campaign_id,
i.c_project_id,
i.c_activity_id
FROM (rv_c_invoice i
JOIN c_paymentterm p ON ((i.c_paymentterm_id = p.c_paymentterm_id)))
WHERE ((i.ispayschedulevalid <> 'Y'::bpchar) AND (i.docstatus = ANY (ARRAY['CO'::bpchar, 'CL'::bpchar])))
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,
i.dateacct,
daysbetween((ips.duedate)::timestamp with time zone, (i.dateinvoiced)::timestamp with time zone) AS netdays,
ips.duedate,
daysbetween(getdate(), (ips.duedate)::timestamp with time zone) AS daysdue,
ips.discountdate,
ips.discountamt,
ips.dueamt AS grandtotal,
i.c_currency_id,
i.c_conversiontype_id,
i.c_paymentterm_id,
i.ispayschedulevalid,
ips.c_invoicepayschedule_id,
i.invoicecollectiontype,
i.c_campaign_id,
i.c_project_id,
i.c_activity_id
FROM (rv_c_invoice i
JOIN c_invoicepayschedule ips ON ((i.c_invoice_id = ips.c_invoice_id)))
WHERE (((i.ispayschedulevalid = 'Y'::bpchar) AND (i.docstatus = ANY (ARRAY['CO'::bpchar, 'CL'::bpchar]))) AND (ips.isvalid = 'Y'::bpchar));


インデックス情報
No インデックス名 カラムリスト ユニーク 備考


外部キー情報
No 外部キー名 カラムリスト 参照先 参照先カラムリスト


外部キー情報(PK側)
No 外部キー名 カラムリスト 参照元 参照元カラムリスト


RDBMS固有の情報
No プロパティ名 プロパティ値
1 schemaname adempiere
2 viewname rv_openitemtodate
3 viewowner adempiere
4 definition 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,
i.dateacct,
p.netdays,
paymenttermduedate(i.c_paymentterm_id, (i.dateinvoiced)::timestamp with time zone) AS duedate,
paymenttermduedays(i.c_paymentterm_id, (i.dateinvoiced)::timestamp with time zone, getdate()) AS daysdue,
adddays((i.dateinvoiced)::timestamp with time zone, p.discountdays) AS discountdate,
currencyround(((i.grandtotal * p.discount) / (100)::numeric), i.c_currency_id, 'N'::character varying) AS discountamt,
i.grandtotal,
i.c_currency_id,
i.c_conversiontype_id,
i.c_paymentterm_id,
i.ispayschedulevalid,
NULL::numeric AS c_invoicepayschedule_id,
i.invoicecollectiontype,
i.c_campaign_id,
i.c_project_id,
i.c_activity_id
FROM (rv_c_invoice i
JOIN c_paymentterm p ON ((i.c_paymentterm_id = p.c_paymentterm_id)))
WHERE ((i.ispayschedulevalid <> 'Y'::bpchar) AND (i.docstatus = ANY (ARRAY['CO'::bpchar, 'CL'::bpchar])))
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,
i.dateacct,
daysbetween((ips.duedate)::timestamp with time zone, (i.dateinvoiced)::timestamp with time zone) AS netdays,
ips.duedate,
daysbetween(getdate(), (ips.duedate)::timestamp with time zone) AS daysdue,
ips.discountdate,
ips.discountamt,
ips.dueamt AS grandtotal,
i.c_currency_id,
i.c_conversiontype_id,
i.c_paymentterm_id,
i.ispayschedulevalid,
ips.c_invoicepayschedule_id,
i.invoicecollectiontype,
i.c_campaign_id,
i.c_project_id,
i.c_activity_id
FROM (rv_c_invoice i
JOIN c_invoicepayschedule ips ON ((i.c_invoice_id = ips.c_invoice_id)))
WHERE (((i.ispayschedulevalid = 'Y'::bpchar) AND (i.docstatus = ANY (ARRAY['CO'::bpchar, 'CL'::bpchar]))) AND (ips.isvalid = 'Y'::bpchar));