テーブル情報
システム名 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 
物理テーブル名 c_order_header_v     
備考


カラム情報
No 論理名 物理名 データ型 Not Null デフォルト 備考
1 ad_client_id numeric(10)  
2 ad_org_id numeric(10)  
3 isactive character(1)  
4 created timestamp without time zone  
5 createdby numeric(10)  
6 updated timestamp without time zone  
7 updatedby numeric(10)  
8 ad_language character varying  
9 c_order_id numeric(10)  
10 issotrx character(1)  
11 documentno character varying(30)  
12 docstatus character(2)  
13 c_doctype_id numeric(10)  
14 c_bpartner_id numeric(10)  
15 bpvalue character varying(40)  
16 bptaxid character varying(20)  
17 naics character(6)  
18 duns character(11)  
19 org_location_id numeric(10)  
20 taxid character varying(20)  
21 m_warehouse_id numeric(10)  
22 warehouse_location_id numeric(10)  
23 documenttype character varying(60)  
24 documenttypenote character varying(2000)  
25 salesrep_id numeric(10)  
26 salesrep_name character varying  
27 dateordered timestamp without time zone  
28 datepromised timestamp without time zone  
29 bpgreeting character varying(60)  
30 name character varying(120)  
31 name2 character varying(60)  
32 bpcontactgreeting character varying(60)  
33 title character varying(40)  
34 phone character varying(40)  
35 contactname text  
36 c_location_id numeric(10)  
37 postal text  
38 referenceno character varying(40)  
39 bill_bpartner_id numeric(10)  
40 bill_location_id numeric(10)  
41 bill_user_id numeric(10)  
42 bill_bpvalue character varying(40)  
43 bill_bptaxid character varying(20)  
44 bill_name character varying(120)  
45 bill_name2 character varying(60)  
46 bill_title character varying(40)  
47 bill_phone character varying(40)  
48 bill_contactname text  
49 bill_c_location_id numeric(10)  
50 description character varying(255)  
51 poreference character varying(20)  
52 c_currency_id numeric(10)  
53 paymentterm character varying(60)  
54 paymenttermnote character varying(2000)  
55 c_charge_id numeric(10)  
56 chargeamt numeric  
57 totallines numeric  
58 grandtotal numeric  
59 amtinwords numeric  
60 m_pricelist_id numeric(10)  
61 istaxincluded character(1)  
62 volume numeric  
63 weight numeric  
64 c_campaign_id numeric(10)  
65 c_project_id numeric(10)  
66 c_activity_id numeric(10)  
67 m_shipper_id numeric(10)  
68 deliveryrule character(1)  
69 deliveryviarule character(1)  
70 priorityrule character(1)  
71 invoicerule character(1)  
72 logo_id numeric(10)  
73 ad_orgtrx_id numeric(10)  
74 ad_user_id numeric(10)  
75 amountrefunded numeric(22, 2)  
76 amounttendered numeric(22, 2)  
77 c_bpartner_location_id numeric(10)  
78 c_cashline_id numeric(10)  
79 c_cashplanline_id numeric(10)  
80 c_conversiontype_id numeric(10)  
81 c_doctypetarget_id numeric(10)  
82 copyfrom character(1)  
83 c_payment_id numeric(10)  
84 c_paymentterm_id numeric(10)  
85 c_pos_id numeric(10)  
86 dateacct timestamp without time zone  
87 dateprinted timestamp without time zone  
88 docaction character(2)  
89 dropship_bpartner_id numeric(10)  
90 dropship_location_id numeric(10)  
91 dropship_user_id numeric(10)  
92 freightamt numeric  
93 freightcostrule character(1)  
94 isapproved character(1)  
95 iscreditapproved character(1)  
96 isdelivered character(1)  
97 isdiscountprinted character(1)  
98 isdropship character(1)  
99 isinvoiced character(1)  
100 ispayschedulevalid character(1)  
101 isprinted character(1)  
102 isselected character(1)  
103 isselfservice character(1)  
104 istransferred character(1)  
105 link_order_id numeric(10)  
106 m_freightcategory_id numeric(10)  
107 ordertype character varying(510)  
108 pay_bpartner_id numeric(10)  
109 pay_location_id numeric(10)  
110 paymentrule character(1)  
111 posted character(1)  
112 processed character(1)  
113 processedon numeric  
114 promotioncode character varying(30)  
115 ref_order_id numeric(10)  
116 sendemail character(1)  
117 user1_id numeric(10)  
118 user2_id numeric(10)  
119 m_warehouse_ad_org_id numeric(10)  
120 m_warehouse_description character varying(255)  
121 m_warehouse_isactive character(1)  
122 isdisallownegativeinv character(1)  
123 isintransit character(1)  
124 m_warehousesource_id numeric(10)  
125 m_warehouse_name character varying(60)  
126 replenishmentclass character varying(60)  
127 separator character(1)  
128 m_warehouse_value character varying(40)  
129 c_paymentterm_ad_org_id numeric(10)  
130 afterdelivery character(1)  
131 c_paymentterm_description character varying(255)  
132 discount numeric  
133 discount2 numeric  
134 discountdays numeric(10)  
135 discountdays2 numeric(10)  
136 fixmonthcutoff numeric(10)  
137 fixmonthday numeric(10)  
138 fixmonthoffset numeric(10)  
139 gracedays numeric(10)  
140 c_paymentterm_isactive character(1)  
141 isdefault character(1)  
142 isduefixed character(1)  
143 isnextbusinessday character(1)  
144 isvalid character(1)  
145 netday character(1)  
146 netdays numeric(10)  
147 paymenttermusage character(1)  
148 m_paymentterm_value character varying(40)  
149 bp_acqusitioncost numeric  
150 bp_actuallifetimevalue numeric  
151 bp_ad_language character varying(6)  
152 bp_ad_orgbp_id numeric(10)  
153 bp_ad_org_id numeric(10)  
154 bp_bpartner_parent_id numeric(10)  
155 bp_c_bp_group_id numeric(10)  
156 bp_c_dunning_id numeric(10)  
157 bp_c_greeting_id numeric(10)  
158 bp_c_invoiceschedule_id numeric(10)  
159 bp_c_paymentterm_id numeric(10)  
160 bp_created timestamp without time zone  
161 bp_createdby numeric(10)  
162 bp_c_taxgroup_id numeric(10)  
163 bp_deliveryrule character(1)  
164 bp_deliveryviarule character(1)  
165 bp_description character varying(255)  
166 bp_dunninggrace date  
167 bp_firstsale timestamp without time zone  
168 bp_flatdiscount numeric  
169 bp_freightcostrule character(1)  
170 bp_invoicerule character(1)  
171 bp_isactive character(1)  
172 bp_iscustomer character(1)  
173 bp_isdiscountprinted character(1)  
174 bp_isemployee character(1)  
175 bp_ismanufacturer character(1)  
176 bp_isonetime character(1)  
177 bp_ispotaxexempt character(1)  
178 bp_isprospect character(1)  
179 bp_issalesrep character(1)  
180 bp_issummary character(1)  
181 bp_istaxexempt character(1)  
182 bp_isvendor character(1)  
183 bp_logo_id numeric(10)  
184 bp_m_discountschema_id numeric(10)  
185 bp_m_pricelist_id numeric(10)  
186 bp_numberemployees numeric(10)  
187 bp_paymentrule character(1)  
188 bp_paymentrulepo character(1)  
189 bp_po_discountschema_id numeric(10)  
190 bp_po_paymentterm_id numeric(10)  
191 bp_po_pricelist_id numeric(10)  
192 bp_poreference character varying(20)  
193 bp_potentiallifetimevalue numeric  
194 bp_rating character(1)  
195 bp_salesrep_id numeric(10)  
196 bp_salesvolume numeric(10)  
197 bp_sendemail character(1)  
198 bp_shareofcustomer numeric(10)  
199 bp_shelflifeminpct numeric(10)  
200 bp_so_creditlimit numeric  
201 bp_socreditstatus character(1)  
202 bp_so_creditused numeric  
203 bp_so_description character varying(255)  
204 bp_totalopenbalance numeric  
205 bp_updated timestamp without time zone  
206 bp_updatedby numeric(10)  
207 bp_url character varying(120)  
208 c_greeting_ad_org_id numeric(10)  
209 c_greeting_isactive character(1)  
210 isfirstnameonly character(1)  
211 c_greeting_name character varying(60)  
212 bp_location_ad_org_id numeric(10)  
213 bp_location_c_bpartner_id numeric(10)  
214 bp_location_created timestamp without time zone  
215 bp_location_createdby numeric(10)  
216 bp_location_c_salesregion_id numeric(10)  
217 bp_location_fax character varying(40)  
218 bp_location_isactive character(1)  
219 bp_location_isbillto character(1)  
220 bp_location_isdn character varying(40)  
221 bp_location_ispayfrom character(1)  
222 bp_location_isremitto character(1)  
223 bp_location_isshipto character(1)  
224 bp_location_name character varying(60)  
225 bp_location_phone character varying(40)  
226 bp_location_phone2 character varying(40)  
227 bp_location_updated timestamp without time zone  
228 bp_location_updatedby numeric(10)  
229 address1 character varying(60)  
230 address2 character varying(60)  
231 address3 character varying(60)  
232 address4 character varying(60)  
233 c_location_ad_org_id numeric(10)  
234 c_city_id numeric(10)  
235 c_country_id numeric(10)  
236 city character varying(60)  
237 c_location_created timestamp without time zone  
238 c_location_createdby numeric(10)  
239 c_region_id numeric(10)  
240 c_location_isactive character(1)  
241 regionname character varying(40)  
242 c_location_updated timestamp without time zone  
243 c_location_updatedby numeric(10)  
244 ad_user_ad_org_id numeric(10)  
245 ad_user_ad_orgtrx_id numeric(10)  
246 ad_user_ad_birthday timestamp without time zone  
247 ad_user_c_bpartner_id numeric(10)  
248 ad_user_c_bpartner_location_id numeric(10)  
249 ad_user_c_greeting_id numeric(10)  
250 ad_user_comments character varying(2000)  
251 ad_user_created timestamp without time zone  
252 ad_user_createdby numeric(10)  
253 ad_user_description character varying(255)  
254 ad_user_email character varying(60)  
255 ad_user_fax character varying(40)  
256 ad_user_isactive character(1)  
257 ad_user_lastcontact timestamp without time zone  
258 ad_user_lastresult character varying(255)  
259 ad_user_phone2 character varying(40)  
260 ad_user_supervisor_id numeric(10)  
261 ad_user_updated timestamp without time zone  
262 ad_user_updatedby numeric(10)  
263 ad_user_value character varying(40)  
264 c_user_greeting_ad_org_id numeric(10)  
265 c_user_greeting_isactive character(1)  
266 c_user_greeting_isfnameonly character(1)  
267 c_user_greeting_name character varying(60)  
268 ad_orginfo_ad_org_id numeric(10)  
269 ad_orgtype_id numeric(10)  
270 c_calendar_id numeric(10)  
271 ad_orginfo_created timestamp without time zone  
272 ad_orginfo_createdby numeric(10)  
273 dropship_warehouse_id numeric(10)  
274 ad_orginfo_duns character(11)  
275 ad_orginfo_email character varying(60)  
276 ad_orginfo_fax character varying(40)  
277 ad_orginfo_isactive character(1)  
278 ad_orginfo_m_warehouse_id numeric(10)  
279 parent_org_id numeric(10)  
280 ad_orginfo_phone character varying(40)  
281 ad_orginfo_phone2 character varying(40)  
282 receiptfootermsg character varying(1023)  
283 supervisor_id numeric(10)  
284 ad_orginfo_updated timestamp without time zone  
285 ad_orginfo_updatedby numeric(10)  
286 salesrep_ad_org_id numeric(10)  
287 salesrep_ad_orgtrx_id numeric(10)  
288 salesrep_ad_birthday timestamp without time zone  
289 salesrep_c_bpartner_id numeric(10)  
290 salesrep_c_bp_location_id numeric(10)  
291 salesrep_c_greeting_id numeric(10)  
292 salesrep_comments character varying(2000)  
293 salesrep_created timestamp without time zone  
294 salesrep_createdby numeric(10)  
295 salesrep_description character varying(255)  
296 salesrep_email character varying(60)  
297 salesrep_fax character varying(40)  
298 salesrep_isactive character(1)  
299 salesrep_lastcontact timestamp without time zone  
300 salesrep_lastresult character varying(255)  
301 salesrep_phone character varying(40)  
302 salesrep_phone2 character varying(40)  
303 salesrep_supervisor_id numeric(10)  
304 salesrep_title character varying(40)  
305 salesrep_updated timestamp without time zone  
306 salesrep_updatedby numeric(10)  
307 salesrep_value character varying(40)  
308 salesrep_bp_acqusitioncost numeric  
309 salesrep_bp_actuallifetimeval numeric  
310 salesrep_bp_ad_language character varying(6)  
311 salesrep_bp_ad_orgbp_id numeric(10)  
312 salesrep_bp_ad_org_id numeric(10)  
313 salesrep_bp_bpartner_parent_id numeric(10)  
314 salesrep_bp_c_bp_group_id numeric(10)  
315 salesrep_bp_c_dunning_id numeric(10)  
316 salesrep_bp_c_greeting_id numeric(10)  
317 salesrep_bp_c_invoicesched_id numeric(10)  
318 salesrep_bp_c_paymentterm_id numeric(10)  
319 salesrep_bp_created timestamp without time zone  
320 salesrep_bp_createdby numeric(10)  
321 salesrep_bp_c_taxgroup_id numeric(10)  
322 salesrep_bp_deliveryrule character(1)  
323 salesrep_bp_deliveryviarule character(1)  
324 salesrep_bp_description character varying(255)  
325 salesrep_bp_dunninggrace date  
326 salesrep_bp_duns character(11)  
327 salesrep_bp_firstsale timestamp without time zone  
328 salesrep_bp_flatdiscount numeric  
329 salesrep_bp_freightcostrule character(1)  
330 salesrep_bp_invoicerule character(1)  
331 salesrep_bp_isactive character(1)  
332 salesrep_bp_iscustomer character(1)  
333 salesrep_bp_isdiscountprinted character(1)  
334 salesrep_bp_isemployee character(1)  
335 salesrep_bp_ismanufacturer character(1)  
336 salesrep_bp_isonetime character(1)  
337 salesrep_bp_ispotaxexempt character(1)  
338 salesrep_bp_isprospect character(1)  
339 salesrep_bp_issalesrep character(1)  
340 salesrep_bp_issummary character(1)  
341 salesrep_bp_istaxexempt character(1)  
342 salesrep_bp_isvendor character(1)  
343 salesrep_bp_logo_id numeric(10)  
344 salesrep_bp_m_discountschm_id numeric(10)  
345 salesrep_bp_m_pricelist_id numeric(10)  
346 salesrep_bp_naics character(6)  
347 salesrep_bp_name2 character varying(60)  
348 salesrep_bp_numberemployees numeric(10)  
349 salesrep_bp_paymentrule character(1)  
350 salesrep_bp_paymentrulepo character(1)  
351 salesrep_bp_po_discountschm_id numeric(10)  
352 salesrep_bp_po_paymentterm_id numeric(10)  
353 salesrep_bp_po_pricelist_id numeric(10)  
354 salesrep_bp_poreference character varying(20)  
355 salesrep_bp_potentiallifetime numeric  
356 salesrep_bp_rating character(1)  
357 salesrep_bp_referenceno character varying(40)  
358 salesrep_bp_salesrep_id numeric(10)  
359 salesrep_bp_salesvolume numeric(10)  
360 salesrep_bp_sendemail character(1)  
361 salesrep_bp_shareofcustomer numeric(10)  
362 salesrep_bp_shelflifeminpct numeric(10)  
363 salesrep_bp_so_creditlimit numeric  
364 salesrep_bp_socreditstatus character(1)  
365 salesrep_bp_so_creditused numeric  
366 salesrep_bp_so_description character varying(255)  
367 salesrep_bp_taxid character varying(20)  
368 salesrep_bp_totalopenbalance numeric  
369 salesrep_bp_updated timestamp without time zone  
370 salesrep_bp_updatedby numeric(10)  
371 salesrep_bp_url character varying(120)  
372 salesrep_bp_value character varying(40)  
373 bill_bp_acqusitioncost numeric  
374 bill_bp_actuallifetimevalue numeric  
375 bill_bp_ad_language character varying(6)  
376 bill_bp_ad_orgbp_id numeric(10)  
377 bill_bp_ad_org_id numeric(10)  
378 bill_bp_bpartner_parent_id numeric(10)  
379 bill_bp_c_bp_group_id numeric(10)  
380 bill_bp_c_dunning_id numeric(10)  
381 bill_bp_c_greeting_id numeric(10)  
382 bill_bp_c_invoiceschedule_id numeric(10)  
383 bill_bp_c_paymentterm_id numeric(10)  
384 bill_bp_created timestamp without time zone  
385 bill_bp_createdby numeric(10)  
386 bill_bp_c_taxgroup_id numeric(10)  
387 bill_bp_deliveryrule character(1)  
388 bill_bp_deliveryviarule character(1)  
389 bill_bp_description character varying(255)  
390 bill_bp_dunninggrace date  
391 bill_bp_duns character(11)  
392 bill_bp_firstsale timestamp without time zone  
393 bill_bp_flatdiscount numeric  
394 bill_bp_freightcostrule character(1)  
395 bill_bp_invoicerule character(1)  
396 bill_bp_isactive character(1)  
397 bill_bp_iscustomer character(1)  
398 bill_bp_isdiscountprinted character(1)  
399 bill_bp_isemployee character(1)  
400 bill_bp_ismanufacturer character(1)  
401 bill_bp_isonetime character(1)  
402 bill_bp_ispotaxexempt character(1)  
403 bill_bp_isprospect character(1)  
404 bill_bp_issalesrep character(1)  
405 bill_bp_issummary character(1)  
406 bill_bp_istaxexempt character(1)  
407 bill_bp_isvendor character(1)  
408 bill_bp_logo_id numeric(10)  
409 bill_bp_m_discountschema_id numeric(10)  
410 bill_bp_m_pricelist_id numeric(10)  
411 bill_bp_naics character(6)  
412 bill_bp_numberemployees numeric(10)  
413 bill_bp_paymentrule character(1)  
414 bill_bp_paymentrulepo character(1)  
415 bill_bp_po_discountschema_id numeric(10)  
416 bill_bp_po_paymentterm_id numeric(10)  
417 bill_bp_po_pricelist_id numeric(10)  
418 bill_bp_poreference character varying(20)  
419 bill_bp_potentiallifetimevalue numeric  
420 bill_bp_rating character(1)  
421 bill_bp_referenceno character varying(40)  
422 bill_bp_salesrep_id numeric(10)  
423 bill_bp_salesvolume numeric(10)  
424 bill_bp_sendemail character(1)  
425 bill_bp_shareofcustomer numeric(10)  
426 bill_bp_shelflifeminpct numeric(10)  
427 bill_bp_so_creditlimit numeric  
428 bill_bp_socreditstatus character(1)  
429 bill_bp_so_creditused numeric  
430 bill_bp_so_description character varying(255)  
431 bill_bp_totalopenbalance numeric  
432 bill_bp_updated timestamp without time zone  
433 bill_bp_updatedby numeric(10)  
434 bill_bp_url character varying(120)  
435 bill_bp_location_ad_org_id numeric(10)  
436 bill_bp_location_c_bpartner_id numeric(10)  
437 bill_bp_location_created timestamp without time zone  
438 bill_bp_location_createdby numeric(10)  
439 bill_bp_location_c_salesreg_id numeric(10)  
440 bill_bp_location_fax character varying(40)  
441 bill_bp_location_isactive character(1)  
442 bill_bp_location_isbillto character(1)  
443 bill_bp_location_isdn character varying(40)  
444 bill_bp_location_ispayfrom character(1)  
445 bill_bp_location_isremitto character(1)  
446 bill_bp_location_isshipto character(1)  
447 bill_bp_location_name character varying(60)  
448 bill_bp_location_phone character varying(40)  
449 bill_bp_location_phone2 character varying(40)  
450 bill_bp_location_updated timestamp without time zone  
451 bill_bp_location_updatedby numeric(10)  
452 bill_user_ad_org_id numeric(10)  
453 bill_user_ad_orgtrx_id numeric(10)  
454 bill_user_ad_birthday timestamp without time zone  
455 bill_user_c_bpartner_id numeric(10)  
456 bill_user_c_bp_location_id numeric(10)  
457 bill_user_c_greeting_id numeric(10)  
458 bill_user_comments character varying(2000)  
459 bill_user_created timestamp without time zone  
460 bill_user_createdby numeric(10)  
461 bill_user_description character varying(255)  
462 bill_user_email character varying(60)  
463 bill_user_fax character varying(40)  
464 bill_user_isactive character(1)  
465 bill_user_lastcontact timestamp without time zone  
466 bill_user_lastresult character varying(255)  
467 bill_user_phone2 character varying(40)  
468 bill_user_supervisor_id numeric(10)  
469 bill_user_updated timestamp without time zone  
470 bill_user_updatedby numeric(10)  
471 bill_user_value character varying(40)  
472 cursymbol character varying(10)  
473 cur_description character varying(255)  


ソース
ソース
 SELECT o.ad_client_id,
o.ad_org_id,
o.isactive,
o.created,
o.createdby,
o.updated,
o.updatedby,
'en_US'::character varying AS ad_language,
o.c_order_id,
o.issotrx,
o.documentno,
o.docstatus,
o.c_doctype_id,
o.c_bpartner_id,
bp.value AS bpvalue,
bp.taxid AS bptaxid,
bp.naics,
bp.duns,
oi.c_location_id AS org_location_id,
oi.taxid,
o.m_warehouse_id,
wh.c_location_id AS warehouse_location_id,
dt.printname AS documenttype,
dt.documentnote AS documenttypenote,
o.salesrep_id,
COALESCE(ubp.name, u.name) AS salesrep_name,
o.dateordered,
o.datepromised,
bpg.greeting AS bpgreeting,
bp.name,
bp.name2,
bpcg.greeting AS bpcontactgreeting,
bpc.title,
bpc.phone,
NULLIF((bpc.name)::text, (bp.name)::text) AS contactname,
bpl.c_location_id,
((l.postal)::text || (l.postal_add)::text) AS postal,
bp.referenceno,
o.bill_bpartner_id,
o.bill_location_id,
o.bill_user_id,
bbp.value AS bill_bpvalue,
bbp.taxid AS bill_bptaxid,
bbp.name AS bill_name,
bbp.name2 AS bill_name2,
bbpc.title AS bill_title,
bbpc.phone AS bill_phone,
NULLIF((bbpc.name)::text, (bbp.name)::text) AS bill_contactname,
bbpl.c_location_id AS bill_c_location_id,
o.description,
o.poreference,
o.c_currency_id,
pt.name AS paymentterm,
pt.documentnote AS paymenttermnote,
o.c_charge_id,
o.chargeamt,
o.totallines,
o.grandtotal,
o.grandtotal AS amtinwords,
o.m_pricelist_id,
o.istaxincluded,
o.volume,
o.weight,
o.c_campaign_id,
o.c_project_id,
o.c_activity_id,
o.m_shipper_id,
o.deliveryrule,
o.deliveryviarule,
o.priorityrule,
o.invoicerule,
COALESCE(oi.logo_id, ci.logo_id) AS logo_id,
o.ad_orgtrx_id,
o.ad_user_id,
o.amountrefunded,
o.amounttendered,
o.c_bpartner_location_id,
o.c_cashline_id,
o.c_cashplanline_id,
o.c_conversiontype_id,
o.c_doctypetarget_id,
o.copyfrom,
o.c_payment_id,
o.c_paymentterm_id,
o.c_pos_id,
o.dateacct,
o.dateprinted,
o.docaction,
o.dropship_bpartner_id,
o.dropship_location_id,
o.dropship_user_id,
o.freightamt,
o.freightcostrule,
o.isapproved,
o.iscreditapproved,
o.isdelivered,
o.isdiscountprinted,
o.isdropship,
o.isinvoiced,
o.ispayschedulevalid,
o.isprinted,
o.isselected,
o.isselfservice,
o.istransferred,
o.link_order_id,
o.m_freightcategory_id,
o.ordertype,
o.pay_bpartner_id,
o.pay_location_id,
o.paymentrule,
o.posted,
o.processed,
o.processedon,
o.promotioncode,
o.ref_order_id,
o.sendemail,
o.user1_id,
o.user2_id,
wh.ad_org_id AS m_warehouse_ad_org_id,
wh.description AS m_warehouse_description,
wh.isactive AS m_warehouse_isactive,
wh.isdisallownegativeinv,
wh.isintransit,
wh.m_warehousesource_id,
wh.name AS m_warehouse_name,
wh.replenishmentclass,
wh.separator,
wh.value AS m_warehouse_value,
pt.ad_org_id AS c_paymentterm_ad_org_id,
pt.afterdelivery,
pt.description AS c_paymentterm_description,
pt.discount,
pt.discount2,
pt.discountdays,
pt.discountdays2,
pt.fixmonthcutoff,
pt.fixmonthday,
pt.fixmonthoffset,
pt.gracedays,
pt.isactive AS c_paymentterm_isactive,
pt.isdefault,
pt.isduefixed,
pt.isnextbusinessday,
pt.isvalid,
pt.netday,
pt.netdays,
pt.paymenttermusage,
pt.value AS m_paymentterm_value,
bp.acqusitioncost AS bp_acqusitioncost,
bp.actuallifetimevalue AS bp_actuallifetimevalue,
bp.ad_language AS bp_ad_language,
bp.ad_orgbp_id AS bp_ad_orgbp_id,
bp.ad_org_id AS bp_ad_org_id,
bp.bpartner_parent_id AS bp_bpartner_parent_id,
bp.c_bp_group_id AS bp_c_bp_group_id,
bp.c_dunning_id AS bp_c_dunning_id,
bp.c_greeting_id AS bp_c_greeting_id,
bp.c_invoiceschedule_id AS bp_c_invoiceschedule_id,
bp.c_paymentterm_id AS bp_c_paymentterm_id,
bp.created AS bp_created,
bp.createdby AS bp_createdby,
bp.c_taxgroup_id AS bp_c_taxgroup_id,
bp.deliveryrule AS bp_deliveryrule,
bp.deliveryviarule AS bp_deliveryviarule,
bp.description AS bp_description,
bp.dunninggrace AS bp_dunninggrace,
bp.firstsale AS bp_firstsale,
bp.flatdiscount AS bp_flatdiscount,
bp.freightcostrule AS bp_freightcostrule,
bp.invoicerule AS bp_invoicerule,
bp.isactive AS bp_isactive,
bp.iscustomer AS bp_iscustomer,
bp.isdiscountprinted AS bp_isdiscountprinted,
bp.isemployee AS bp_isemployee,
bp.ismanufacturer AS bp_ismanufacturer,
bp.isonetime AS bp_isonetime,
bp.ispotaxexempt AS bp_ispotaxexempt,
bp.isprospect AS bp_isprospect,
bp.issalesrep AS bp_issalesrep,
bp.issummary AS bp_issummary,
bp.istaxexempt AS bp_istaxexempt,
bp.isvendor AS bp_isvendor,
bp.logo_id AS bp_logo_id,
bp.m_discountschema_id AS bp_m_discountschema_id,
bp.m_pricelist_id AS bp_m_pricelist_id,
bp.numberemployees AS bp_numberemployees,
bp.paymentrule AS bp_paymentrule,
bp.paymentrulepo AS bp_paymentrulepo,
bp.po_discountschema_id AS bp_po_discountschema_id,
bp.po_paymentterm_id AS bp_po_paymentterm_id,
bp.po_pricelist_id AS bp_po_pricelist_id,
bp.poreference AS bp_poreference,
bp.potentiallifetimevalue AS bp_potentiallifetimevalue,
bp.rating AS bp_rating,
bp.salesrep_id AS bp_salesrep_id,
bp.salesvolume AS bp_salesvolume,
bp.sendemail AS bp_sendemail,
bp.shareofcustomer AS bp_shareofcustomer,
bp.shelflifeminpct AS bp_shelflifeminpct,
bp.so_creditlimit AS bp_so_creditlimit,
bp.socreditstatus AS bp_socreditstatus,
bp.so_creditused AS bp_so_creditused,
bp.so_description AS bp_so_description,
bp.totalopenbalance AS bp_totalopenbalance,
bp.updated AS bp_updated,
bp.updatedby AS bp_updatedby,
bp.url AS bp_url,
bpg.ad_org_id AS c_greeting_ad_org_id,
bpg.isactive AS c_greeting_isactive,
bpg.isfirstnameonly,
bpg.name AS c_greeting_name,
bpl.ad_org_id AS bp_location_ad_org_id,
bpl.c_bpartner_id AS bp_location_c_bpartner_id,
bpl.created AS bp_location_created,
bpl.createdby AS bp_location_createdby,
bpl.c_salesregion_id AS bp_location_c_salesregion_id,
bpl.fax AS bp_location_fax,
bpl.isactive AS bp_location_isactive,
bpl.isbillto AS bp_location_isbillto,
bpl.isdn AS bp_location_isdn,
bpl.ispayfrom AS bp_location_ispayfrom,
bpl.isremitto AS bp_location_isremitto,
bpl.isshipto AS bp_location_isshipto,
bpl.name AS bp_location_name,
bpl.phone AS bp_location_phone,
bpl.phone2 AS bp_location_phone2,
bpl.updated AS bp_location_updated,
bpl.updatedby AS bp_location_updatedby,
l.address1,
l.address2,
l.address3,
l.address4,
l.ad_org_id AS c_location_ad_org_id,
l.c_city_id,
l.c_country_id,
l.city,
l.created AS c_location_created,
l.createdby AS c_location_createdby,
l.c_region_id,
l.isactive AS c_location_isactive,
l.regionname,
l.updated AS c_location_updated,
l.updatedby AS c_location_updatedby,
bpc.ad_org_id AS ad_user_ad_org_id,
bpc.ad_orgtrx_id AS ad_user_ad_orgtrx_id,
bpc.birthday AS ad_user_ad_birthday,
bpc.c_bpartner_id AS ad_user_c_bpartner_id,
bpc.c_bpartner_location_id AS ad_user_c_bpartner_location_id,
bpc.c_greeting_id AS ad_user_c_greeting_id,
bpc.comments AS ad_user_comments,
bpc.created AS ad_user_created,
bpc.createdby AS ad_user_createdby,
bpc.description AS ad_user_description,
bpc.email AS ad_user_email,
bpc.fax AS ad_user_fax,
bpc.isactive AS ad_user_isactive,
bpc.lastcontact AS ad_user_lastcontact,
bpc.lastresult AS ad_user_lastresult,
bpc.phone2 AS ad_user_phone2,
bpc.supervisor_id AS ad_user_supervisor_id,
bpc.updated AS ad_user_updated,
bpc.updatedby AS ad_user_updatedby,
bpc.value AS ad_user_value,
bpcg.ad_org_id AS c_user_greeting_ad_org_id,
bpcg.isactive AS c_user_greeting_isactive,
bpcg.isfirstnameonly AS c_user_greeting_isfnameonly,
bpcg.name AS c_user_greeting_name,
oi.ad_org_id AS ad_orginfo_ad_org_id,
oi.ad_orgtype_id,
oi.c_calendar_id,
oi.created AS ad_orginfo_created,
oi.createdby AS ad_orginfo_createdby,
oi.dropship_warehouse_id,
oi.duns AS ad_orginfo_duns,
oi.email AS ad_orginfo_email,
oi.fax AS ad_orginfo_fax,
oi.isactive AS ad_orginfo_isactive,
oi.m_warehouse_id AS ad_orginfo_m_warehouse_id,
oi.parent_org_id,
oi.phone AS ad_orginfo_phone,
oi.phone2 AS ad_orginfo_phone2,
oi.receiptfootermsg,
oi.supervisor_id,
oi.updated AS ad_orginfo_updated,
oi.updatedby AS ad_orginfo_updatedby,
u.ad_org_id AS salesrep_ad_org_id,
u.ad_orgtrx_id AS salesrep_ad_orgtrx_id,
u.birthday AS salesrep_ad_birthday,
u.c_bpartner_id AS salesrep_c_bpartner_id,
u.c_bpartner_location_id AS salesrep_c_bp_location_id,
u.c_greeting_id AS salesrep_c_greeting_id,
u.comments AS salesrep_comments,
u.created AS salesrep_created,
u.createdby AS salesrep_createdby,
u.description AS salesrep_description,
u.email AS salesrep_email,
u.fax AS salesrep_fax,
u.isactive AS salesrep_isactive,
u.lastcontact AS salesrep_lastcontact,
u.lastresult AS salesrep_lastresult,
u.phone AS salesrep_phone,
u.phone2 AS salesrep_phone2,
u.supervisor_id AS salesrep_supervisor_id,
u.title AS salesrep_title,
u.updated AS salesrep_updated,
u.updatedby AS salesrep_updatedby,
u.value AS salesrep_value,
ubp.acqusitioncost AS salesrep_bp_acqusitioncost,
ubp.actuallifetimevalue AS salesrep_bp_actuallifetimeval,
ubp.ad_language AS salesrep_bp_ad_language,
ubp.ad_orgbp_id AS salesrep_bp_ad_orgbp_id,
ubp.ad_org_id AS salesrep_bp_ad_org_id,
ubp.bpartner_parent_id AS salesrep_bp_bpartner_parent_id,
ubp.c_bp_group_id AS salesrep_bp_c_bp_group_id,
ubp.c_dunning_id AS salesrep_bp_c_dunning_id,
ubp.c_greeting_id AS salesrep_bp_c_greeting_id,
ubp.c_invoiceschedule_id AS salesrep_bp_c_invoicesched_id,
ubp.c_paymentterm_id AS salesrep_bp_c_paymentterm_id,
ubp.created AS salesrep_bp_created,
ubp.createdby AS salesrep_bp_createdby,
ubp.c_taxgroup_id AS salesrep_bp_c_taxgroup_id,
ubp.deliveryrule AS salesrep_bp_deliveryrule,
ubp.deliveryviarule AS salesrep_bp_deliveryviarule,
ubp.description AS salesrep_bp_description,
ubp.dunninggrace AS salesrep_bp_dunninggrace,
ubp.duns AS salesrep_bp_duns,
ubp.firstsale AS salesrep_bp_firstsale,
ubp.flatdiscount AS salesrep_bp_flatdiscount,
ubp.freightcostrule AS salesrep_bp_freightcostrule,
ubp.invoicerule AS salesrep_bp_invoicerule,
ubp.isactive AS salesrep_bp_isactive,
ubp.iscustomer AS salesrep_bp_iscustomer,
ubp.isdiscountprinted AS salesrep_bp_isdiscountprinted,
ubp.isemployee AS salesrep_bp_isemployee,
ubp.ismanufacturer AS salesrep_bp_ismanufacturer,
ubp.isonetime AS salesrep_bp_isonetime,
ubp.ispotaxexempt AS salesrep_bp_ispotaxexempt,
ubp.isprospect AS salesrep_bp_isprospect,
ubp.issalesrep AS salesrep_bp_issalesrep,
ubp.issummary AS salesrep_bp_issummary,
ubp.istaxexempt AS salesrep_bp_istaxexempt,
ubp.isvendor AS salesrep_bp_isvendor,
ubp.logo_id AS salesrep_bp_logo_id,
ubp.m_discountschema_id AS salesrep_bp_m_discountschm_id,
ubp.m_pricelist_id AS salesrep_bp_m_pricelist_id,
ubp.naics AS salesrep_bp_naics,
ubp.name2 AS salesrep_bp_name2,
ubp.numberemployees AS salesrep_bp_numberemployees,
ubp.paymentrule AS salesrep_bp_paymentrule,
ubp.paymentrulepo AS salesrep_bp_paymentrulepo,
ubp.po_discountschema_id AS salesrep_bp_po_discountschm_id,
ubp.po_paymentterm_id AS salesrep_bp_po_paymentterm_id,
ubp.po_pricelist_id AS salesrep_bp_po_pricelist_id,
ubp.poreference AS salesrep_bp_poreference,
ubp.potentiallifetimevalue AS salesrep_bp_potentiallifetime,
ubp.rating AS salesrep_bp_rating,
ubp.referenceno AS salesrep_bp_referenceno,
ubp.salesrep_id AS salesrep_bp_salesrep_id,
ubp.salesvolume AS salesrep_bp_salesvolume,
ubp.sendemail AS salesrep_bp_sendemail,
ubp.shareofcustomer AS salesrep_bp_shareofcustomer,
ubp.shelflifeminpct AS salesrep_bp_shelflifeminpct,
ubp.so_creditlimit AS salesrep_bp_so_creditlimit,
ubp.socreditstatus AS salesrep_bp_socreditstatus,
ubp.so_creditused AS salesrep_bp_so_creditused,
ubp.so_description AS salesrep_bp_so_description,
ubp.taxid AS salesrep_bp_taxid,
ubp.totalopenbalance AS salesrep_bp_totalopenbalance,
ubp.updated AS salesrep_bp_updated,
ubp.updatedby AS salesrep_bp_updatedby,
ubp.url AS salesrep_bp_url,
ubp.value AS salesrep_bp_value,
bbp.acqusitioncost AS bill_bp_acqusitioncost,
bbp.actuallifetimevalue AS bill_bp_actuallifetimevalue,
bbp.ad_language AS bill_bp_ad_language,
bbp.ad_orgbp_id AS bill_bp_ad_orgbp_id,
bbp.ad_org_id AS bill_bp_ad_org_id,
bbp.bpartner_parent_id AS bill_bp_bpartner_parent_id,
bbp.c_bp_group_id AS bill_bp_c_bp_group_id,
bbp.c_dunning_id AS bill_bp_c_dunning_id,
bbp.c_greeting_id AS bill_bp_c_greeting_id,
bbp.c_invoiceschedule_id AS bill_bp_c_invoiceschedule_id,
bbp.c_paymentterm_id AS bill_bp_c_paymentterm_id,
bbp.created AS bill_bp_created,
bbp.createdby AS bill_bp_createdby,
bbp.c_taxgroup_id AS bill_bp_c_taxgroup_id,
bbp.deliveryrule AS bill_bp_deliveryrule,
bbp.deliveryviarule AS bill_bp_deliveryviarule,
bbp.description AS bill_bp_description,
bbp.dunninggrace AS bill_bp_dunninggrace,
bbp.duns AS bill_bp_duns,
bbp.firstsale AS bill_bp_firstsale,
bbp.flatdiscount AS bill_bp_flatdiscount,
bbp.freightcostrule AS bill_bp_freightcostrule,
bbp.invoicerule AS bill_bp_invoicerule,
bbp.isactive AS bill_bp_isactive,
bbp.iscustomer AS bill_bp_iscustomer,
bbp.isdiscountprinted AS bill_bp_isdiscountprinted,
bbp.isemployee AS bill_bp_isemployee,
bbp.ismanufacturer AS bill_bp_ismanufacturer,
bbp.isonetime AS bill_bp_isonetime,
bbp.ispotaxexempt AS bill_bp_ispotaxexempt,
bbp.isprospect AS bill_bp_isprospect,
bbp.issalesrep AS bill_bp_issalesrep,
bbp.issummary AS bill_bp_issummary,
bbp.istaxexempt AS bill_bp_istaxexempt,
bbp.isvendor AS bill_bp_isvendor,
bbp.logo_id AS bill_bp_logo_id,
bbp.m_discountschema_id AS bill_bp_m_discountschema_id,
bbp.m_pricelist_id AS bill_bp_m_pricelist_id,
bbp.naics AS bill_bp_naics,
bbp.numberemployees AS bill_bp_numberemployees,
bbp.paymentrule AS bill_bp_paymentrule,
bbp.paymentrulepo AS bill_bp_paymentrulepo,
bbp.po_discountschema_id AS bill_bp_po_discountschema_id,
bbp.po_paymentterm_id AS bill_bp_po_paymentterm_id,
bbp.po_pricelist_id AS bill_bp_po_pricelist_id,
bbp.poreference AS bill_bp_poreference,
bbp.potentiallifetimevalue AS bill_bp_potentiallifetimevalue,
bbp.rating AS bill_bp_rating,
bbp.referenceno AS bill_bp_referenceno,
bbp.salesrep_id AS bill_bp_salesrep_id,
bbp.salesvolume AS bill_bp_salesvolume,
bbp.sendemail AS bill_bp_sendemail,
bbp.shareofcustomer AS bill_bp_shareofcustomer,
bbp.shelflifeminpct AS bill_bp_shelflifeminpct,
bbp.so_creditlimit AS bill_bp_so_creditlimit,
bbp.socreditstatus AS bill_bp_socreditstatus,
bbp.so_creditused AS bill_bp_so_creditused,
bbp.so_description AS bill_bp_so_description,
bbp.totalopenbalance AS bill_bp_totalopenbalance,
bbp.updated AS bill_bp_updated,
bbp.updatedby AS bill_bp_updatedby,
bbp.url AS bill_bp_url,
bbpl.ad_org_id AS bill_bp_location_ad_org_id,
bbpl.c_bpartner_id AS bill_bp_location_c_bpartner_id,
bbpl.created AS bill_bp_location_created,
bbpl.createdby AS bill_bp_location_createdby,
bbpl.c_salesregion_id AS bill_bp_location_c_salesreg_id,
bbpl.fax AS bill_bp_location_fax,
bbpl.isactive AS bill_bp_location_isactive,
bbpl.isbillto AS bill_bp_location_isbillto,
bbpl.isdn AS bill_bp_location_isdn,
bbpl.ispayfrom AS bill_bp_location_ispayfrom,
bbpl.isremitto AS bill_bp_location_isremitto,
bbpl.isshipto AS bill_bp_location_isshipto,
bbpl.name AS bill_bp_location_name,
bbpl.phone AS bill_bp_location_phone,
bbpl.phone2 AS bill_bp_location_phone2,
bbpl.updated AS bill_bp_location_updated,
bbpl.updatedby AS bill_bp_location_updatedby,
bbpc.ad_org_id AS bill_user_ad_org_id,
bbpc.ad_orgtrx_id AS bill_user_ad_orgtrx_id,
bbpc.birthday AS bill_user_ad_birthday,
bbpc.c_bpartner_id AS bill_user_c_bpartner_id,
bbpc.c_bpartner_location_id AS bill_user_c_bp_location_id,
bbpc.c_greeting_id AS bill_user_c_greeting_id,
bbpc.comments AS bill_user_comments,
bbpc.created AS bill_user_created,
bbpc.createdby AS bill_user_createdby,
bbpc.description AS bill_user_description,
bbpc.email AS bill_user_email,
bbpc.fax AS bill_user_fax,
bbpc.isactive AS bill_user_isactive,
bbpc.lastcontact AS bill_user_lastcontact,
bbpc.lastresult AS bill_user_lastresult,
bbpc.phone2 AS bill_user_phone2,
bbpc.supervisor_id AS bill_user_supervisor_id,
bbpc.updated AS bill_user_updated,
bbpc.updatedby AS bill_user_updatedby,
bbpc.value AS bill_user_value,
cur.cursymbol,
cur.description AS cur_description
FROM (((((((((((((((((c_order o
JOIN c_doctype dt ON ((o.c_doctype_id = dt.c_doctype_id)))
JOIN m_warehouse wh ON ((o.m_warehouse_id = wh.m_warehouse_id)))
JOIN c_paymentterm pt ON ((o.c_paymentterm_id = pt.c_paymentterm_id)))
JOIN c_bpartner bp ON ((o.c_bpartner_id = bp.c_bpartner_id)))
LEFT JOIN c_greeting bpg ON ((bp.c_greeting_id = bpg.c_greeting_id)))
JOIN c_bpartner_location bpl ON ((o.c_bpartner_location_id = bpl.c_bpartner_location_id)))
JOIN c_location l ON ((bpl.c_location_id = l.c_location_id)))
LEFT JOIN ad_user bpc ON ((o.ad_user_id = bpc.ad_user_id)))
LEFT JOIN c_greeting bpcg ON ((bpc.c_greeting_id = bpcg.c_greeting_id)))
JOIN ad_orginfo oi ON ((o.ad_org_id = oi.ad_org_id)))
JOIN ad_clientinfo ci ON ((o.ad_client_id = ci.ad_client_id)))
LEFT JOIN ad_user u ON ((o.salesrep_id = u.ad_user_id)))
LEFT JOIN c_bpartner ubp ON ((u.c_bpartner_id = ubp.c_bpartner_id)))
JOIN c_bpartner bbp ON ((o.bill_bpartner_id = bbp.c_bpartner_id)))
JOIN c_bpartner_location bbpl ON ((o.bill_location_id = bbpl.c_bpartner_location_id)))
LEFT JOIN ad_user bbpc ON ((o.bill_user_id = bbpc.ad_user_id)))
LEFT JOIN c_currency cur ON ((o.c_currency_id = cur.c_currency_id)));


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


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


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


RDBMS固有の情報
No プロパティ名 プロパティ値
1 schemaname adempiere
2 viewname c_order_header_v
3 viewowner adempiere
4 definition SELECT o.ad_client_id,
o.ad_org_id,
o.isactive,
o.created,
o.createdby,
o.updated,
o.updatedby,
'en_US'::character varying AS ad_language,
o.c_order_id,
o.issotrx,
o.documentno,
o.docstatus,
o.c_doctype_id,
o.c_bpartner_id,
bp.value AS bpvalue,
bp.taxid AS bptaxid,
bp.naics,
bp.duns,
oi.c_location_id AS org_location_id,
oi.taxid,
o.m_warehouse_id,
wh.c_location_id AS warehouse_location_id,
dt.printname AS documenttype,
dt.documentnote AS documenttypenote,
o.salesrep_id,
COALESCE(ubp.name, u.name) AS salesrep_name,
o.dateordered,
o.datepromised,
bpg.greeting AS bpgreeting,
bp.name,
bp.name2,
bpcg.greeting AS bpcontactgreeting,
bpc.title,
bpc.phone,
NULLIF((bpc.name)::text, (bp.name)::text) AS contactname,
bpl.c_location_id,
((l.postal)::text || (l.postal_add)::text) AS postal,
bp.referenceno,
o.bill_bpartner_id,
o.bill_location_id,
o.bill_user_id,
bbp.value AS bill_bpvalue,
bbp.taxid AS bill_bptaxid,
bbp.name AS bill_name,
bbp.name2 AS bill_name2,
bbpc.title AS bill_title,
bbpc.phone AS bill_phone,
NULLIF((bbpc.name)::text, (bbp.name)::text) AS bill_contactname,
bbpl.c_location_id AS bill_c_location_id,
o.description,
o.poreference,
o.c_currency_id,
pt.name AS paymentterm,
pt.documentnote AS paymenttermnote,
o.c_charge_id,
o.chargeamt,
o.totallines,
o.grandtotal,
o.grandtotal AS amtinwords,
o.m_pricelist_id,
o.istaxincluded,
o.volume,
o.weight,
o.c_campaign_id,
o.c_project_id,
o.c_activity_id,
o.m_shipper_id,
o.deliveryrule,
o.deliveryviarule,
o.priorityrule,
o.invoicerule,
COALESCE(oi.logo_id, ci.logo_id) AS logo_id,
o.ad_orgtrx_id,
o.ad_user_id,
o.amountrefunded,
o.amounttendered,
o.c_bpartner_location_id,
o.c_cashline_id,
o.c_cashplanline_id,
o.c_conversiontype_id,
o.c_doctypetarget_id,
o.copyfrom,
o.c_payment_id,
o.c_paymentterm_id,
o.c_pos_id,
o.dateacct,
o.dateprinted,
o.docaction,
o.dropship_bpartner_id,
o.dropship_location_id,
o.dropship_user_id,
o.freightamt,
o.freightcostrule,
o.isapproved,
o.iscreditapproved,
o.isdelivered,
o.isdiscountprinted,
o.isdropship,
o.isinvoiced,
o.ispayschedulevalid,
o.isprinted,
o.isselected,
o.isselfservice,
o.istransferred,
o.link_order_id,
o.m_freightcategory_id,
o.ordertype,
o.pay_bpartner_id,
o.pay_location_id,
o.paymentrule,
o.posted,
o.processed,
o.processedon,
o.promotioncode,
o.ref_order_id,
o.sendemail,
o.user1_id,
o.user2_id,
wh.ad_org_id AS m_warehouse_ad_org_id,
wh.description AS m_warehouse_description,
wh.isactive AS m_warehouse_isactive,
wh.isdisallownegativeinv,
wh.isintransit,
wh.m_warehousesource_id,
wh.name AS m_warehouse_name,
wh.replenishmentclass,
wh.separator,
wh.value AS m_warehouse_value,
pt.ad_org_id AS c_paymentterm_ad_org_id,
pt.afterdelivery,
pt.description AS c_paymentterm_description,
pt.discount,
pt.discount2,
pt.discountdays,
pt.discountdays2,
pt.fixmonthcutoff,
pt.fixmonthday,
pt.fixmonthoffset,
pt.gracedays,
pt.isactive AS c_paymentterm_isactive,
pt.isdefault,
pt.isduefixed,
pt.isnextbusinessday,
pt.isvalid,
pt.netday,
pt.netdays,
pt.paymenttermusage,
pt.value AS m_paymentterm_value,
bp.acqusitioncost AS bp_acqusitioncost,
bp.actuallifetimevalue AS bp_actuallifetimevalue,
bp.ad_language AS bp_ad_language,
bp.ad_orgbp_id AS bp_ad_orgbp_id,
bp.ad_org_id AS bp_ad_org_id,
bp.bpartner_parent_id AS bp_bpartner_parent_id,
bp.c_bp_group_id AS bp_c_bp_group_id,
bp.c_dunning_id AS bp_c_dunning_id,
bp.c_greeting_id AS bp_c_greeting_id,
bp.c_invoiceschedule_id AS bp_c_invoiceschedule_id,
bp.c_paymentterm_id AS bp_c_paymentterm_id,
bp.created AS bp_created,
bp.createdby AS bp_createdby,
bp.c_taxgroup_id AS bp_c_taxgroup_id,
bp.deliveryrule AS bp_deliveryrule,
bp.deliveryviarule AS bp_deliveryviarule,
bp.description AS bp_description,
bp.dunninggrace AS bp_dunninggrace,
bp.firstsale AS bp_firstsale,
bp.flatdiscount AS bp_flatdiscount,
bp.freightcostrule AS bp_freightcostrule,
bp.invoicerule AS bp_invoicerule,
bp.isactive AS bp_isactive,
bp.iscustomer AS bp_iscustomer,
bp.isdiscountprinted AS bp_isdiscountprinted,
bp.isemployee AS bp_isemployee,
bp.ismanufacturer AS bp_ismanufacturer,
bp.isonetime AS bp_isonetime,
bp.ispotaxexempt AS bp_ispotaxexempt,
bp.isprospect AS bp_isprospect,
bp.issalesrep AS bp_issalesrep,
bp.issummary AS bp_issummary,
bp.istaxexempt AS bp_istaxexempt,
bp.isvendor AS bp_isvendor,
bp.logo_id AS bp_logo_id,
bp.m_discountschema_id AS bp_m_discountschema_id,
bp.m_pricelist_id AS bp_m_pricelist_id,
bp.numberemployees AS bp_numberemployees,
bp.paymentrule AS bp_paymentrule,
bp.paymentrulepo AS bp_paymentrulepo,
bp.po_discountschema_id AS bp_po_discountschema_id,
bp.po_paymentterm_id AS bp_po_paymentterm_id,
bp.po_pricelist_id AS bp_po_pricelist_id,
bp.poreference AS bp_poreference,
bp.potentiallifetimevalue AS bp_potentiallifetimevalue,
bp.rating AS bp_rating,
bp.salesrep_id AS bp_salesrep_id,
bp.salesvolume AS bp_salesvolume,
bp.sendemail AS bp_sendemail,
bp.shareofcustomer AS bp_shareofcustomer,
bp.shelflifeminpct AS bp_shelflifeminpct,
bp.so_creditlimit AS bp_so_creditlimit,
bp.socreditstatus AS bp_socreditstatus,
bp.so_creditused AS bp_so_creditused,
bp.so_description AS bp_so_description,
bp.totalopenbalance AS bp_totalopenbalance,
bp.updated AS bp_updated,
bp.updatedby AS bp_updatedby,
bp.url AS bp_url,
bpg.ad_org_id AS c_greeting_ad_org_id,
bpg.isactive AS c_greeting_isactive,
bpg.isfirstnameonly,
bpg.name AS c_greeting_name,
bpl.ad_org_id AS bp_location_ad_org_id,
bpl.c_bpartner_id AS bp_location_c_bpartner_id,
bpl.created AS bp_location_created,
bpl.createdby AS bp_location_createdby,
bpl.c_salesregion_id AS bp_location_c_salesregion_id,
bpl.fax AS bp_location_fax,
bpl.isactive AS bp_location_isactive,
bpl.isbillto AS bp_location_isbillto,
bpl.isdn AS bp_location_isdn,
bpl.ispayfrom AS bp_location_ispayfrom,
bpl.isremitto AS bp_location_isremitto,
bpl.isshipto AS bp_location_isshipto,
bpl.name AS bp_location_name,
bpl.phone AS bp_location_phone,
bpl.phone2 AS bp_location_phone2,
bpl.updated AS bp_location_updated,
bpl.updatedby AS bp_location_updatedby,
l.address1,
l.address2,
l.address3,
l.address4,
l.ad_org_id AS c_location_ad_org_id,
l.c_city_id,
l.c_country_id,
l.city,
l.created AS c_location_created,
l.createdby AS c_location_createdby,
l.c_region_id,
l.isactive AS c_location_isactive,
l.regionname,
l.updated AS c_location_updated,
l.updatedby AS c_location_updatedby,
bpc.ad_org_id AS ad_user_ad_org_id,
bpc.ad_orgtrx_id AS ad_user_ad_orgtrx_id,
bpc.birthday AS ad_user_ad_birthday,
bpc.c_bpartner_id AS ad_user_c_bpartner_id,
bpc.c_bpartner_location_id AS ad_user_c_bpartner_location_id,
bpc.c_greeting_id AS ad_user_c_greeting_id,
bpc.comments AS ad_user_comments,
bpc.created AS ad_user_created,
bpc.createdby AS ad_user_createdby,
bpc.description AS ad_user_description,
bpc.email AS ad_user_email,
bpc.fax AS ad_user_fax,
bpc.isactive AS ad_user_isactive,
bpc.lastcontact AS ad_user_lastcontact,
bpc.lastresult AS ad_user_lastresult,
bpc.phone2 AS ad_user_phone2,
bpc.supervisor_id AS ad_user_supervisor_id,
bpc.updated AS ad_user_updated,
bpc.updatedby AS ad_user_updatedby,
bpc.value AS ad_user_value,
bpcg.ad_org_id AS c_user_greeting_ad_org_id,
bpcg.isactive AS c_user_greeting_isactive,
bpcg.isfirstnameonly AS c_user_greeting_isfnameonly,
bpcg.name AS c_user_greeting_name,
oi.ad_org_id AS ad_orginfo_ad_org_id,
oi.ad_orgtype_id,
oi.c_calendar_id,
oi.created AS ad_orginfo_created,
oi.createdby AS ad_orginfo_createdby,
oi.dropship_warehouse_id,
oi.duns AS ad_orginfo_duns,
oi.email AS ad_orginfo_email,
oi.fax AS ad_orginfo_fax,
oi.isactive AS ad_orginfo_isactive,
oi.m_warehouse_id AS ad_orginfo_m_warehouse_id,
oi.parent_org_id,
oi.phone AS ad_orginfo_phone,
oi.phone2 AS ad_orginfo_phone2,
oi.receiptfootermsg,
oi.supervisor_id,
oi.updated AS ad_orginfo_updated,
oi.updatedby AS ad_orginfo_updatedby,
u.ad_org_id AS salesrep_ad_org_id,
u.ad_orgtrx_id AS salesrep_ad_orgtrx_id,
u.birthday AS salesrep_ad_birthday,
u.c_bpartner_id AS salesrep_c_bpartner_id,
u.c_bpartner_location_id AS salesrep_c_bp_location_id,
u.c_greeting_id AS salesrep_c_greeting_id,
u.comments AS salesrep_comments,
u.created AS salesrep_created,
u.createdby AS salesrep_createdby,
u.description AS salesrep_description,
u.email AS salesrep_email,
u.fax AS salesrep_fax,
u.isactive AS salesrep_isactive,
u.lastcontact AS salesrep_lastcontact,
u.lastresult AS salesrep_lastresult,
u.phone AS salesrep_phone,
u.phone2 AS salesrep_phone2,
u.supervisor_id AS salesrep_supervisor_id,
u.title AS salesrep_title,
u.updated AS salesrep_updated,
u.updatedby AS salesrep_updatedby,
u.value AS salesrep_value,
ubp.acqusitioncost AS salesrep_bp_acqusitioncost,
ubp.actuallifetimevalue AS salesrep_bp_actuallifetimeval,
ubp.ad_language AS salesrep_bp_ad_language,
ubp.ad_orgbp_id AS salesrep_bp_ad_orgbp_id,
ubp.ad_org_id AS salesrep_bp_ad_org_id,
ubp.bpartner_parent_id AS salesrep_bp_bpartner_parent_id,
ubp.c_bp_group_id AS salesrep_bp_c_bp_group_id,
ubp.c_dunning_id AS salesrep_bp_c_dunning_id,
ubp.c_greeting_id AS salesrep_bp_c_greeting_id,
ubp.c_invoiceschedule_id AS salesrep_bp_c_invoicesched_id,
ubp.c_paymentterm_id AS salesrep_bp_c_paymentterm_id,
ubp.created AS salesrep_bp_created,
ubp.createdby AS salesrep_bp_createdby,
ubp.c_taxgroup_id AS salesrep_bp_c_taxgroup_id,
ubp.deliveryrule AS salesrep_bp_deliveryrule,
ubp.deliveryviarule AS salesrep_bp_deliveryviarule,
ubp.description AS salesrep_bp_description,
ubp.dunninggrace AS salesrep_bp_dunninggrace,
ubp.duns AS salesrep_bp_duns,
ubp.firstsale AS salesrep_bp_firstsale,
ubp.flatdiscount AS salesrep_bp_flatdiscount,
ubp.freightcostrule AS salesrep_bp_freightcostrule,
ubp.invoicerule AS salesrep_bp_invoicerule,
ubp.isactive AS salesrep_bp_isactive,
ubp.iscustomer AS salesrep_bp_iscustomer,
ubp.isdiscountprinted AS salesrep_bp_isdiscountprinted,
ubp.isemployee AS salesrep_bp_isemployee,
ubp.ismanufacturer AS salesrep_bp_ismanufacturer,
ubp.isonetime AS salesrep_bp_isonetime,
ubp.ispotaxexempt AS salesrep_bp_ispotaxexempt,
ubp.isprospect AS salesrep_bp_isprospect,
ubp.issalesrep AS salesrep_bp_issalesrep,
ubp.issummary AS salesrep_bp_issummary,
ubp.istaxexempt AS salesrep_bp_istaxexempt,
ubp.isvendor AS salesrep_bp_isvendor,
ubp.logo_id AS salesrep_bp_logo_id,
ubp.m_discountschema_id AS salesrep_bp_m_discountschm_id,
ubp.m_pricelist_id AS salesrep_bp_m_pricelist_id,
ubp.naics AS salesrep_bp_naics,
ubp.name2 AS salesrep_bp_name2,
ubp.numberemployees AS salesrep_bp_numberemployees,
ubp.paymentrule AS salesrep_bp_paymentrule,
ubp.paymentrulepo AS salesrep_bp_paymentrulepo,
ubp.po_discountschema_id AS salesrep_bp_po_discountschm_id,
ubp.po_paymentterm_id AS salesrep_bp_po_paymentterm_id,
ubp.po_pricelist_id AS salesrep_bp_po_pricelist_id,
ubp.poreference AS salesrep_bp_poreference,
ubp.potentiallifetimevalue AS salesrep_bp_potentiallifetime,
ubp.rating AS salesrep_bp_rating,
ubp.referenceno AS salesrep_bp_referenceno,
ubp.salesrep_id AS salesrep_bp_salesrep_id,
ubp.salesvolume AS salesrep_bp_salesvolume,
ubp.sendemail AS salesrep_bp_sendemail,
ubp.shareofcustomer AS salesrep_bp_shareofcustomer,
ubp.shelflifeminpct AS salesrep_bp_shelflifeminpct,
ubp.so_creditlimit AS salesrep_bp_so_creditlimit,
ubp.socreditstatus AS salesrep_bp_socreditstatus,
ubp.so_creditused AS salesrep_bp_so_creditused,
ubp.so_description AS salesrep_bp_so_description,
ubp.taxid AS salesrep_bp_taxid,
ubp.totalopenbalance AS salesrep_bp_totalopenbalance,
ubp.updated AS salesrep_bp_updated,
ubp.updatedby AS salesrep_bp_updatedby,
ubp.url AS salesrep_bp_url,
ubp.value AS salesrep_bp_value,
bbp.acqusitioncost AS bill_bp_acqusitioncost,
bbp.actuallifetimevalue AS bill_bp_actuallifetimevalue,
bbp.ad_language AS bill_bp_ad_language,
bbp.ad_orgbp_id AS bill_bp_ad_orgbp_id,
bbp.ad_org_id AS bill_bp_ad_org_id,
bbp.bpartner_parent_id AS bill_bp_bpartner_parent_id,
bbp.c_bp_group_id AS bill_bp_c_bp_group_id,
bbp.c_dunning_id AS bill_bp_c_dunning_id,
bbp.c_greeting_id AS bill_bp_c_greeting_id,
bbp.c_invoiceschedule_id AS bill_bp_c_invoiceschedule_id,
bbp.c_paymentterm_id AS bill_bp_c_paymentterm_id,
bbp.created AS bill_bp_created,
bbp.createdby AS bill_bp_createdby,
bbp.c_taxgroup_id AS bill_bp_c_taxgroup_id,
bbp.deliveryrule AS bill_bp_deliveryrule,
bbp.deliveryviarule AS bill_bp_deliveryviarule,
bbp.description AS bill_bp_description,
bbp.dunninggrace AS bill_bp_dunninggrace,
bbp.duns AS bill_bp_duns,
bbp.firstsale AS bill_bp_firstsale,
bbp.flatdiscount AS bill_bp_flatdiscount,
bbp.freightcostrule AS bill_bp_freightcostrule,
bbp.invoicerule AS bill_bp_invoicerule,
bbp.isactive AS bill_bp_isactive,
bbp.iscustomer AS bill_bp_iscustomer,
bbp.isdiscountprinted AS bill_bp_isdiscountprinted,
bbp.isemployee AS bill_bp_isemployee,
bbp.ismanufacturer AS bill_bp_ismanufacturer,
bbp.isonetime AS bill_bp_isonetime,
bbp.ispotaxexempt AS bill_bp_ispotaxexempt,
bbp.isprospect AS bill_bp_isprospect,
bbp.issalesrep AS bill_bp_issalesrep,
bbp.issummary AS bill_bp_issummary,
bbp.istaxexempt AS bill_bp_istaxexempt,
bbp.isvendor AS bill_bp_isvendor,
bbp.logo_id AS bill_bp_logo_id,
bbp.m_discountschema_id AS bill_bp_m_discountschema_id,
bbp.m_pricelist_id AS bill_bp_m_pricelist_id,
bbp.naics AS bill_bp_naics,
bbp.numberemployees AS bill_bp_numberemployees,
bbp.paymentrule AS bill_bp_paymentrule,
bbp.paymentrulepo AS bill_bp_paymentrulepo,
bbp.po_discountschema_id AS bill_bp_po_discountschema_id,
bbp.po_paymentterm_id AS bill_bp_po_paymentterm_id,
bbp.po_pricelist_id AS bill_bp_po_pricelist_id,
bbp.poreference AS bill_bp_poreference,
bbp.potentiallifetimevalue AS bill_bp_potentiallifetimevalue,
bbp.rating AS bill_bp_rating,
bbp.referenceno AS bill_bp_referenceno,
bbp.salesrep_id AS bill_bp_salesrep_id,
bbp.salesvolume AS bill_bp_salesvolume,
bbp.sendemail AS bill_bp_sendemail,
bbp.shareofcustomer AS bill_bp_shareofcustomer,
bbp.shelflifeminpct AS bill_bp_shelflifeminpct,
bbp.so_creditlimit AS bill_bp_so_creditlimit,
bbp.socreditstatus AS bill_bp_socreditstatus,
bbp.so_creditused AS bill_bp_so_creditused,
bbp.so_description AS bill_bp_so_description,
bbp.totalopenbalance AS bill_bp_totalopenbalance,
bbp.updated AS bill_bp_updated,
bbp.updatedby AS bill_bp_updatedby,
bbp.url AS bill_bp_url,
bbpl.ad_org_id AS bill_bp_location_ad_org_id,
bbpl.c_bpartner_id AS bill_bp_location_c_bpartner_id,
bbpl.created AS bill_bp_location_created,
bbpl.createdby AS bill_bp_location_createdby,
bbpl.c_salesregion_id AS bill_bp_location_c_salesreg_id,
bbpl.fax AS bill_bp_location_fax,
bbpl.isactive AS bill_bp_location_isactive,
bbpl.isbillto AS bill_bp_location_isbillto,
bbpl.isdn AS bill_bp_location_isdn,
bbpl.ispayfrom AS bill_bp_location_ispayfrom,
bbpl.isremitto AS bill_bp_location_isremitto,
bbpl.isshipto AS bill_bp_location_isshipto,
bbpl.name AS bill_bp_location_name,
bbpl.phone AS bill_bp_location_phone,
bbpl.phone2 AS bill_bp_location_phone2,
bbpl.updated AS bill_bp_location_updated,
bbpl.updatedby AS bill_bp_location_updatedby,
bbpc.ad_org_id AS bill_user_ad_org_id,
bbpc.ad_orgtrx_id AS bill_user_ad_orgtrx_id,
bbpc.birthday AS bill_user_ad_birthday,
bbpc.c_bpartner_id AS bill_user_c_bpartner_id,
bbpc.c_bpartner_location_id AS bill_user_c_bp_location_id,
bbpc.c_greeting_id AS bill_user_c_greeting_id,
bbpc.comments AS bill_user_comments,
bbpc.created AS bill_user_created,
bbpc.createdby AS bill_user_createdby,
bbpc.description AS bill_user_description,
bbpc.email AS bill_user_email,
bbpc.fax AS bill_user_fax,
bbpc.isactive AS bill_user_isactive,
bbpc.lastcontact AS bill_user_lastcontact,
bbpc.lastresult AS bill_user_lastresult,
bbpc.phone2 AS bill_user_phone2,
bbpc.supervisor_id AS bill_user_supervisor_id,
bbpc.updated AS bill_user_updated,
bbpc.updatedby AS bill_user_updatedby,
bbpc.value AS bill_user_value,
cur.cursymbol,
cur.description AS cur_description
FROM (((((((((((((((((c_order o
JOIN c_doctype dt ON ((o.c_doctype_id = dt.c_doctype_id)))
JOIN m_warehouse wh ON ((o.m_warehouse_id = wh.m_warehouse_id)))
JOIN c_paymentterm pt ON ((o.c_paymentterm_id = pt.c_paymentterm_id)))
JOIN c_bpartner bp ON ((o.c_bpartner_id = bp.c_bpartner_id)))
LEFT JOIN c_greeting bpg ON ((bp.c_greeting_id = bpg.c_greeting_id)))
JOIN c_bpartner_location bpl ON ((o.c_bpartner_location_id = bpl.c_bpartner_location_id)))
JOIN c_location l ON ((bpl.c_location_id = l.c_location_id)))
LEFT JOIN ad_user bpc ON ((o.ad_user_id = bpc.ad_user_id)))
LEFT JOIN c_greeting bpcg ON ((bpc.c_greeting_id = bpcg.c_greeting_id)))
JOIN ad_orginfo oi ON ((o.ad_org_id = oi.ad_org_id)))
JOIN ad_clientinfo ci ON ((o.ad_client_id = ci.ad_client_id)))
LEFT JOIN ad_user u ON ((o.salesrep_id = u.ad_user_id)))
LEFT JOIN c_bpartner ubp ON ((u.c_bpartner_id = ubp.c_bpartner_id)))
JOIN c_bpartner bbp ON ((o.bill_bpartner_id = bbp.c_bpartner_id)))
JOIN c_bpartner_location bbpl ON ((o.bill_location_id = bbpl.c_bpartner_location_id)))
LEFT JOIN ad_user bbpc ON ((o.bill_user_id = bbpc.ad_user_id)))
LEFT JOIN c_currency cur ON ((o.c_currency_id = cur.c_currency_id)));