1
SELECT il.ad_client_id,
2
il.ad_org_id,
3
il.isactive,
4
il.created,
5
il.createdby,
6
il.updated,
7
il.updatedby,
8
'en_US'::text AS ad_language,
9
il.c_invoice_id,
10
il.c_invoiceline_id,
11
il.c_tax_id,
12
il.taxamt,
13
il.linetotalamt,
14
t.taxindicator,
15
il.line,
16
p.m_product_id,
17
CASE
18
WHEN ((il.qtyinvoiced <> (0)::numeric) OR (il.m_product_id IS NOT NULL)) THEN il.qtyinvoiced
19
ELSE NULL::numeric
20
END AS qtyinvoiced,
21
CASE
22
WHEN ((il.qtyentered <> (0)::numeric) OR (il.m_product_id IS NOT NULL)) THEN il.qtyentered
23
ELSE NULL::numeric
24
END AS qtyentered,
25
CASE
26
WHEN ((il.qtyentered <> (0)::numeric) OR (il.m_product_id IS NOT NULL)) THEN uom.uomsymbol
27
ELSE NULL::character varying
28
END AS uomsymbol,
29
COALESCE(c.name, (((p.name)::text || (COALESCE(productattribute(il.m_attributesetinstance_id), ''::character varying))::text))::character varying, il.description) AS name,
30
CASE
31
WHEN (COALESCE(c.name, p.name) IS NOT NULL) THEN il.description
32
ELSE NULL::character varying
33
END AS description,
34
p.documentnote,
35
p.upc,
36
p.sku,
37
COALESCE(pp.vendorproductno, p.value) AS productvalue,
38
ra.description AS resourcedescription,
39
CASE
40
WHEN ((i.isdiscountprinted = 'Y'::bpchar) AND (il.pricelist <> (0)::numeric)) THEN il.pricelist
41
ELSE NULL::numeric
42
END AS pricelist,
43
CASE
44
WHEN ((i.isdiscountprinted = 'Y'::bpchar) AND (il.pricelist <> (0)::numeric) AND (il.qtyentered <> (0)::numeric)) THEN ((il.pricelist * il.qtyinvoiced) / il.qtyentered)
45
ELSE NULL::numeric
46
END AS priceenteredlist,
47
CASE
48
WHEN ((i.isdiscountprinted = 'Y'::bpchar) AND (il.pricelist > il.priceactual) AND (il.pricelist <> (0)::numeric)) THEN (((il.pricelist - il.priceactual) / il.pricelist) * (100)::numeric)
49
ELSE NULL::numeric
50
END AS discount,
51
CASE
52
WHEN ((il.priceactual <> (0)::numeric) OR (il.m_product_id IS NOT NULL)) THEN il.priceactual
53
ELSE NULL::numeric
54
END AS priceactual,
55
CASE
56
WHEN ((il.priceentered <> (0)::numeric) OR (il.m_product_id IS NOT NULL)) THEN il.priceentered
57
ELSE NULL::numeric
58
END AS priceentered,
59
CASE
60
WHEN ((il.linenetamt <> (0)::numeric) OR (il.m_product_id IS NOT NULL)) THEN il.linenetamt
61
ELSE NULL::numeric
62
END AS linenetamt,
63
il.m_attributesetinstance_id,
64
asi.m_attributeset_id,
65
asi.serno,
66
asi.lot,
67
asi.m_lot_id,
68
asi.guaranteedate,
69
p.description AS productdescription,
70
p.imageurl,
71
il.c_campaign_id,
72
il.c_project_id,
73
il.c_activity_id,
74
il.c_projectphase_id,
75
il.c_projecttask_id,
76
il.ad_orgtrx_id AS c_invoiceline_ad_orgtrx_id,
77
il.a_processed,
78
il.c_charge_id,
79
il.c_orderline_id,
80
il.c_uom_id,
81
il.isdescription,
82
il.isprinted AS c_invoiceline_isprinted,
83
il.m_inoutline_id,
84
il.m_rmaline_id,
85
il.pricelimit,
86
il.processed AS c_invoiceline_processed,
87
il.ref_invoiceline_id,
88
il.rramt,
89
il.rrstartdate,
90
il.s_resourceassignment_id,
91
il.user1_id AS c_invoiceline_user1_id,
92
il.user2_id AS c_invoiceline_user2_id,
93
uom.ad_org_id AS c_uom_ad_org_id,
94
uom.costingprecision,
95
uom.description AS c_uom_description,
96
uom.isactive AS c_uom_isactive,
97
uom.isdefault AS c_uom_isdefault,
98
uom.name AS c_uom_name,
99
uom.stdprecision,
100
uom.uomtype,
101
uom.x12de355,
102
i.ad_org_id AS c_invoice_ad_org_id,
103
i.ad_orgtrx_id AS c_invoice_ad_orgtrx_id,
104
i.ad_user_id AS c_invoice_ad_user_id,
105
i.c_activity_id AS c_invoice_c_activity_id,
106
i.c_bpartner_id AS c_invoice_c_bpartner_id,
107
i.c_bpartner_location_id,
108
i.c_campaign_id AS c_invoice_c_campaign_id,
109
i.c_charge_id AS c_invoice_c_charge_id,
110
i.c_conversiontype_id,
111
i.c_currency_id,
112
i.c_doctype_id,
113
i.c_doctypetarget_id,
114
i.c_dunninglevel_id,
115
i.chargeamt AS c_invoice_chargeamt,
116
i.c_order_id,
117
i.c_payment_id,
118
i.c_paymentterm_id,
119
i.c_project_id AS c_invoice_c_project_id,
120
i.created AS c_invoice_created,
121
i.createdby AS c_invoice_createdby,
122
i.dateacct,
123
i.dateinvoiced,
124
i.dateordered,
125
i.dateprinted,
126
i.description AS c_invoice_description,
127
i.docaction,
128
i.docstatus,
129
i.documentno,
130
i.dunninggrace,
131
i.generateto,
132
i.grandtotal,
133
i.invoicecollectiontype,
134
i.isactive AS c_invoice_isactive,
135
i.isapproved,
136
i.isdiscountprinted,
137
i.isindispute,
138
i.ispaid,
139
i.ispayschedulevalid,
140
i.isprinted AS c_invoice_isprinted,
141
i.isselfservice AS c_invoice_isselfservice,
142
i.issotrx,
143
i.istaxincluded AS c_invoice_istaxincluded,
144
i.istransferred,
145
i.m_pricelist_id,
146
i.m_rma_id,
147
i.paymentrule,
148
i.poreference,
149
i.posted,
150
i.processedon,
151
i.processing,
152
i.ref_invoice_id,
153
i.reversal_id,
154
i.salesrep_id,
155
i.sendemail,
156
i.totallines,
157
i.updated AS c_invoice_updated,
158
i.updatedby AS c_invoice_updatedby,
159
i.user1_id AS c_invoice_user1_id,
160
i.user2_id AS c_invoice_user2_id,
161
t.ad_org_id AS c_tax_ad_org_id,
162
t.ad_rule_id,
163
t.c_country_id,
164
t.c_region_id,
165
t.c_taxcategory_id AS c_tax_c_taxcategory_id,
166
t.description AS c_tax_description,
167
t.isactive AS c_tax_isactive,
168
t.isdefault AS c_tax_isdefault,
169
t.isdocumentlevel,
170
t.issalestax,
171
t.issummary AS c_tax_issummary,
172
t.istaxexempt,
173
t.name AS c_tax_name,
174
t.parent_tax_id,
175
t.rate,
176
t.requirestaxcertificate,
177
t.sopotype,
178
t.to_country_id,
179
t.to_region_id,
180
t.validfrom,
181
p.ad_org_id AS m_product_ad_org_id,
182
p.classification,
183
p.copyfrom AS m_product_copyfrom,
184
p.created AS m_product_created,
185
p.createdby AS m_product_createdby,
186
p.c_revenuerecognition_id,
187
p.c_subscriptiontype_id,
188
p.c_taxcategory_id AS m_product_c_taxcategory_id,
189
p.descriptionurl,
190
p.discontinued,
191
p.discontinuedat,
192
p.group1,
193
p.group2,
194
p.guaranteedays,
195
p.guaranteedaysmin,
196
p.help,
197
p.isactive AS m_product_isactive,
198
p.isbom,
199
p.isdropship,
200
p.isexcludeautodelivery,
201
p.isinvoiceprintdetails,
202
p.ispicklistprintdetails,
203
p.ispurchased,
204
p.isselfservice AS m_product_isselfservice,
205
p.issold,
206
p.isstocked,
207
p.issummary AS m_product_issummary,
208
p.isverified,
209
p.iswebstorefeatured,
210
p.lowlevel,
211
p.m_attributeset_id AS m_product_m_attributeset_id,
212
p.m_attributesetinstance_id AS m_product_m_asi_id,
213
p.m_freightcategory_id,
214
p.m_locator_id,
215
p.m_product_category_id AS m_product_m_prod_category_id,
216
p.processing AS m_product_processing,
217
p.producttype,
218
p.r_mailtext_id,
219
p.salesrep_id AS m_product_salesrep_id,
220
p.s_expensetype_id,
221
p.shelfdepth,
222
p.shelfheight,
223
p.shelfwidth,
224
p.s_resource_id AS m_product_s_resource_id,
225
p.unitsperpack,
226
p.unitsperpallet,
227
p.updated AS m_product_updated,
228
p.updatedby AS m_product_updatedby,
229
p.versionno,
230
p.volume,
231
p.weight,
232
c.ad_org_id AS c_charge_ad_org_id,
233
c.c_bpartner_id AS c_charge_c_bpartner_id,
234
c.c_chargetype_id,
235
c.chargeamt AS c_charge_chargeamt,
236
c.c_taxcategory_id AS c_charge_c_taxcategory_id,
237
c.description AS c_charge_description,
238
c.isactive AS c_charge_isactive,
239
c.issamecurrency,
240
c.issametax,
241
c.istaxincluded AS c_charge_istaxincluded,
242
pp.ad_org_id AS c_bp_product_ad_org_id,
243
pp.c_bpartner_id AS c_bp_product_c_bpartner_id,
244
pp.created AS c_bp_product_created,
245
pp.createdby AS c_bp_product_createdby,
246
pp.description AS c_bp_product_description,
247
pp.isactive AS c_bp_product_isactive,
248
pp.ismanufacturer,
249
pp.manufacturer,
250
pp.qualityrating,
251
pp.shelflifemindays,
252
pp.shelflifeminpct,
253
pp.updated AS c_bp_product_updated,
254
pp.updatedby AS c_bp_product_updatedby,
255
pp.vendorcategory,
256
ra.ad_org_id AS s_rassignment_ad_org_id,
257
ra.assigndatefrom,
258
ra.assigndateto,
259
ra.created AS s_rassignment_created,
260
ra.createdby AS s_rassignment_createby,
261
ra.isactive AS s_rassignment_isactive,
262
ra.isconfirmed,
263
ra.name AS s_rassignment_name,
264
ra.qty AS s_rassignment_qty,
265
ra.s_resource_id AS s_rassignment_s_resource_id,
266
ra.updated AS s_rassignment_updated,
267
ra.updatedby AS s_rassignment_updatedby,
268
asi.ad_org_id AS m_asi_ad_org_id,
269
asi.created AS m_asi_created,
270
asi.createdby AS m_asi_createdby,
271
asi.description AS m_asi_description,
272
asi.isactive AS m_asi_isactive,
273
asi.updated AS m_asi_updated,
274
asi.updatedby AS m_asi_updatedby
275
FROM ((((((((c_invoiceline il
276
JOIN c_uom uom ON ((il.c_uom_id = uom.c_uom_id)))
277
JOIN c_invoice i ON ((il.c_invoice_id = i.c_invoice_id)))
278
LEFT JOIN c_tax t ON ((il.c_tax_id = t.c_tax_id)))
279
LEFT JOIN m_product p ON ((il.m_product_id = p.m_product_id)))
280
LEFT JOIN c_charge c ON ((il.c_charge_id = c.c_charge_id)))
281
LEFT JOIN c_bpartner_product pp ON (((il.m_product_id = pp.m_product_id) AND (i.c_bpartner_id = pp.c_bpartner_id))))
282
LEFT JOIN s_resourceassignment ra ON ((il.s_resourceassignment_id = ra.s_resourceassignment_id)))
283
LEFT JOIN m_attributesetinstance asi ON ((il.m_attributesetinstance_id = asi.m_attributesetinstance_id)))
284
UNION
285
SELECT il.ad_client_id,
286
il.ad_org_id,
287
il.isactive,
288
il.created,
289
il.createdby,
290
il.updated,
291
il.updatedby,
292
'en_US'::text AS ad_language,
293
il.c_invoice_id,
294
il.c_invoiceline_id,
295
il.c_tax_id,
296
il.taxamt,
297
il.linetotalamt,
298
t.taxindicator,
299
(il.line + (bl.line / (100)::numeric)) AS line,
300
p.m_product_id,
301
CASE
302
WHEN (bl.isqtypercentage = 'N'::bpchar) THEN (il.qtyinvoiced * bl.qtybom)
303
ELSE (il.qtyinvoiced * (bl.qtybatch / (100)::numeric))
304
END AS qtyinvoiced,
305
CASE
306
WHEN (bl.isqtypercentage = 'N'::bpchar) THEN (il.qtyentered * bl.qtybom)
307
ELSE (il.qtyentered * (bl.qtybatch / (100)::numeric))
308
END AS qtyentered,
309
uom.uomsymbol,
310
p.name,
311
b.description,
312
p.documentnote,
313
p.upc,
314
p.sku,
315
p.value AS productvalue,
316
NULL::character varying AS resourcedescription,
317
NULL::numeric AS pricelist,
318
NULL::numeric AS priceenteredlist,
319
NULL::numeric AS discount,
320
NULL::numeric AS priceactual,
321
NULL::numeric AS priceentered,
322
NULL::numeric AS linenetamt,
323
il.m_attributesetinstance_id,
324
asi.m_attributeset_id,
325
asi.serno,
326
asi.lot,
327
asi.m_lot_id,
328
asi.guaranteedate,
329
p.description AS productdescription,
330
p.imageurl,
331
il.c_campaign_id,
332
il.c_project_id,
333
il.c_activity_id,
334
il.c_projectphase_id,
335
il.c_projecttask_id,
336
il.ad_orgtrx_id AS c_invoiceline_ad_orgtrx_id,
337
il.a_processed,
338
il.c_charge_id,
339
il.c_orderline_id,
340
il.c_uom_id,
341
il.isdescription,
342
il.isprinted AS c_invoiceline_isprinted,
343
il.m_inoutline_id,
344
il.m_rmaline_id,
345
il.pricelimit,
346
il.processed AS c_invoiceline_processed,
347
il.ref_invoiceline_id,
348
il.rramt,
349
il.rrstartdate,
350
il.s_resourceassignment_id,
351
il.user1_id AS c_invoiceline_user1_id,
352
il.user2_id AS c_invoiceline_user2_id,
353
uom.ad_org_id AS c_uom_ad_org_id,
354
uom.costingprecision,
355
uom.description AS c_uom_description,
356
uom.isactive AS c_uom_isactive,
357
uom.isdefault AS c_uom_isdefault,
358
uom.name AS c_uom_name,
359
uom.stdprecision,
360
uom.uomtype,
361
uom.x12de355,
362
NULL::numeric AS c_invoice_ad_org_id,
363
NULL::numeric AS c_invoice_ad_orgtrx_id,
364
NULL::numeric AS c_invoice_ad_user_id,
365
NULL::numeric AS c_invoice_c_activity_id,
366
NULL::numeric AS c_invoice_c_bpartner_id,
367
NULL::numeric AS c_bpartner_location_id,
368
NULL::numeric AS c_invoice_c_campaign_id,
369
NULL::numeric AS c_invoice_c_charge_id,
370
NULL::numeric AS c_conversiontype_id,
371
NULL::numeric AS c_currency_id,
372
NULL::numeric AS c_doctype_id,
373
NULL::numeric AS c_doctypetarget_id,
374
NULL::numeric AS c_dunninglevel_id,
375
NULL::numeric AS c_invoice_chargeamt,
376
NULL::numeric AS c_order_id,
377
NULL::numeric AS c_payment_id,
378
NULL::numeric AS c_paymentterm_id,
379
NULL::numeric AS c_invoice_c_project_id,
380
NULL::timestamp without time zone AS c_invoice_created,
381
NULL::numeric AS c_invoice_createdby,
382
NULL::timestamp without time zone AS dateacct,
383
NULL::timestamp without time zone AS dateinvoiced,
384
NULL::timestamp without time zone AS dateordered,
385
NULL::timestamp without time zone AS dateprinted,
386
NULL::character varying AS c_invoice_description,
387
NULL::bpchar AS docaction,
388
NULL::bpchar AS docstatus,
389
NULL::character varying AS documentno,
390
NULL::date AS dunninggrace,
391
NULL::bpchar AS generateto,
392
NULL::numeric AS grandtotal,
393
NULL::bpchar AS invoicecollectiontype,
394
NULL::bpchar AS c_invoice_isactive,
395
NULL::bpchar AS isapproved,
396
NULL::bpchar AS isdiscountprinted,
397
NULL::bpchar AS isindispute,
398
NULL::bpchar AS ispaid,
399
NULL::bpchar AS ispayschedulevalid,
400
NULL::bpchar AS c_invoice_isprinted,
401
NULL::bpchar AS c_invoice_isselfservice,
402
NULL::bpchar AS issotrx,
403
NULL::bpchar AS c_invoice_istaxincluded,
404
NULL::bpchar AS istransferred,
405
NULL::numeric AS m_pricelist_id,
406
NULL::numeric AS m_rma_id,
407
NULL::bpchar AS paymentrule,
408
NULL::character varying AS poreference,
409
NULL::bpchar AS posted,
410
NULL::numeric AS processedon,
411
NULL::bpchar AS processing,
412
NULL::numeric AS ref_invoice_id,
413
NULL::numeric AS reversal_id,
414
NULL::numeric AS salesrep_id,
415
NULL::bpchar AS sendemail,
416
NULL::numeric AS totallines,
417
NULL::timestamp without time zone AS c_invoice_updated,
418
NULL::numeric AS c_invoice_updatedby,
419
NULL::numeric AS c_invoice_user1_id,
420
NULL::numeric AS c_invoice_user2_id,
421
t.ad_org_id AS c_tax_ad_org_id,
422
t.ad_rule_id,
423
t.c_country_id,
424
t.c_region_id,
425
t.c_taxcategory_id AS c_tax_c_taxcategory_id,
426
t.description AS c_tax_description,
427
t.isactive AS c_tax_isactive,
428
t.isdefault AS c_tax_isdefault,
429
t.isdocumentlevel,
430
t.issalestax,
431
t.issummary AS c_tax_issummary,
432
t.istaxexempt,
433
t.name AS c_tax_name,
434
t.parent_tax_id,
435
t.rate,
436
t.requirestaxcertificate,
437
t.sopotype,
438
t.to_country_id,
439
t.to_region_id,
440
t.validfrom,
441
p.ad_org_id AS m_product_ad_org_id,
442
p.classification,
443
p.copyfrom AS m_product_copyfrom,
444
p.created AS m_product_created,
445
p.createdby AS m_product_createdby,
446
p.c_revenuerecognition_id,
447
p.c_subscriptiontype_id,
448
p.c_taxcategory_id AS m_product_c_taxcategory_id,
449
p.descriptionurl,
450
p.discontinued,
451
p.discontinuedat,
452
p.group1,
453
p.group2,
454
p.guaranteedays,
455
p.guaranteedaysmin,
456
p.help,
457
p.isactive AS m_product_isactive,
458
p.isbom,
459
p.isdropship,
460
p.isexcludeautodelivery,
461
p.isinvoiceprintdetails,
462
p.ispicklistprintdetails,
463
p.ispurchased,
464
p.isselfservice AS m_product_isselfservice,
465
p.issold,
466
p.isstocked,
467
p.issummary AS m_product_issummary,
468
p.isverified,
469
p.iswebstorefeatured,
470
p.lowlevel,
471
p.m_attributeset_id AS m_product_m_attributeset_id,
472
p.m_attributesetinstance_id AS m_product_m_asi_id,
473
p.m_freightcategory_id,
474
p.m_locator_id,
475
p.m_product_category_id AS m_product_m_prod_category_id,
476
p.processing AS m_product_processing,
477
p.producttype,
478
p.r_mailtext_id,
479
p.salesrep_id AS m_product_salesrep_id,
480
p.s_expensetype_id,
481
p.shelfdepth,
482
p.shelfheight,
483
p.shelfwidth,
484
p.s_resource_id AS m_product_s_resource_id,
485
p.unitsperpack,
486
p.unitsperpallet,
487
p.updated AS m_product_updated,
488
p.updatedby AS m_product_updatedby,
489
p.versionno,
490
p.volume,
491
p.weight,
492
NULL::numeric AS c_charge_ad_org_id,
493
NULL::numeric AS c_charge_c_bpartner_id,
494
NULL::numeric AS c_chargetype_id,
495
NULL::numeric AS c_charge_chargeamt,
496
NULL::numeric AS c_charge_c_taxcategory_id,
497
NULL::character varying AS c_charge_description,
498
NULL::bpchar AS c_charge_isactive,
499
NULL::bpchar AS issamecurrency,
500
NULL::bpchar AS issametax,
501
NULL::bpchar AS c_charge_istaxincluded,
502
NULL::numeric AS c_bp_product_ad_org_id,
503
NULL::numeric AS c_bp_product_c_bpartner_id,
504
NULL::timestamp without time zone AS c_bp_product_created,
505
NULL::numeric AS c_bp_product_createdby,
506
NULL::character varying AS c_bp_product_description,
507
NULL::bpchar AS c_bp_product_isactive,
508
NULL::bpchar AS ismanufacturer,
509
NULL::character varying AS manufacturer,
510
NULL::numeric AS qualityrating,
511
NULL::numeric AS shelflifemindays,
512
NULL::numeric AS shelflifeminpct,
513
NULL::timestamp without time zone AS c_bp_product_updated,
514
NULL::numeric AS c_bp_product_updatedby,
515
NULL::character varying AS vendorcategory,
516
NULL::numeric AS s_rassignment_ad_org_id,
517
NULL::timestamp without time zone AS assigndatefrom,
518
NULL::timestamp without time zone AS assigndateto,
519
NULL::timestamp without time zone AS s_rassignment_created,
520
NULL::numeric AS s_rassignment_createby,
521
NULL::bpchar AS s_rassignment_isactive,
522
NULL::bpchar AS isconfirmed,
523
NULL::character varying AS s_rassignment_name,
524
NULL::numeric AS s_rassignment_qty,
525
NULL::numeric AS s_rassignment_s_resource_id,
526
NULL::timestamp without time zone AS s_rassignment_updated,
527
NULL::numeric AS s_rassignment_updatedby,
528
asi.ad_org_id AS m_asi_ad_org_id,
529
asi.created AS m_asi_created,
530
asi.createdby AS m_asi_createdby,
531
asi.description AS m_asi_description,
532
asi.isactive AS m_asi_isactive,
533
asi.updated AS m_asi_updated,
534
asi.updatedby AS m_asi_updatedby
535
FROM (((((((pp_product_bom b
536
JOIN c_invoiceline il ON ((b.m_product_id = il.m_product_id)))
537
JOIN m_product bp ON (((bp.m_product_id = il.m_product_id) AND (bp.isbom = 'Y'::bpchar) AND (bp.isverified = 'Y'::bpchar) AND (bp.isinvoiceprintdetails = 'Y'::bpchar))))
538
JOIN pp_product_bomline bl ON ((bl.pp_product_bom_id = b.pp_product_bom_id)))
539
JOIN m_product p ON ((bl.m_product_id = p.m_product_id)))
540
JOIN c_uom uom ON ((p.c_uom_id = uom.c_uom_id)))
541
LEFT JOIN c_tax t ON ((il.c_tax_id = t.c_tax_id)))
542
LEFT JOIN m_attributesetinstance asi ON ((il.m_attributesetinstance_id = asi.m_attributesetinstance_id)))
543
UNION
544
SELECT il.ad_client_id,
545
il.ad_org_id,
546
il.isactive,
547
il.created,
548
il.createdby,
549
il.updated,
550
il.updatedby,
551
'en_US'::text AS ad_language,
552
il.c_invoice_id,
553
il.c_invoiceline_id,
554
NULL::numeric AS c_tax_id,
555
NULL::numeric AS taxamt,
556
NULL::numeric AS linetotalamt,
557
NULL::character varying AS taxindicator,
558
il.line,
559
NULL::numeric AS m_product_id,
560
NULL::numeric AS qtyinvoiced,
561
NULL::numeric AS qtyentered,
562
NULL::character varying AS uomsymbol,
563
il.description AS name,
564
NULL::character varying AS description,
565
NULL::character varying AS documentnote,
566
NULL::character varying AS upc,
567
NULL::character varying AS sku,
568
NULL::character varying AS productvalue,
569
NULL::character varying AS resourcedescription,
570
NULL::numeric AS pricelist,
571
NULL::numeric AS priceenteredlist,
572
NULL::numeric AS discount,
573
NULL::numeric AS priceactual,
574
NULL::numeric AS priceentered,
575
NULL::numeric AS linenetamt,
576
NULL::numeric AS m_attributesetinstance_id,
577
NULL::numeric AS m_attributeset_id,
578
NULL::character varying AS serno,
579
NULL::character varying AS lot,
580
NULL::numeric AS m_lot_id,
581
NULL::timestamp without time zone AS guaranteedate,
582
NULL::character varying AS productdescription,
583
NULL::character varying AS imageurl,
584
NULL::numeric AS c_campaign_id,
585
NULL::numeric AS c_project_id,
586
NULL::numeric AS c_activity_id,
587
NULL::numeric AS c_projectphase_id,
588
NULL::numeric AS c_projecttask_id,
589
NULL::numeric AS c_invoiceline_ad_orgtrx_id,
590
NULL::bpchar AS a_processed,
591
NULL::numeric AS c_charge_id,
592
NULL::numeric AS c_orderline_id,
593
NULL::numeric AS c_uom_id,
594
NULL::bpchar AS isdescription,
595
NULL::bpchar AS c_invoiceline_isprinted,
596
NULL::numeric AS m_inoutline_id,
597
NULL::numeric AS m_rmaline_id,
598
NULL::numeric AS pricelimit,
599
NULL::bpchar AS c_invoiceline_processed,
600
NULL::numeric AS ref_invoiceline_id,
601
NULL::numeric AS rramt,
602
NULL::timestamp without time zone AS rrstartdate,
603
NULL::numeric AS s_resourceassignment_id,
604
NULL::numeric AS c_invoiceline_user1_id,
605
NULL::numeric AS c_invoiceline_user2_id,
606
NULL::numeric AS c_uom_ad_org_id,
607
NULL::numeric AS costingprecision,
608
NULL::character varying AS c_uom_description,
609
NULL::bpchar AS c_uom_isactive,
610
NULL::bpchar AS c_uom_isdefault,
611
NULL::character varying AS c_uom_name,
612
NULL::numeric AS stdprecision,
613
NULL::character varying AS uomtype,
614
NULL::character varying AS x12de355,
615
NULL::numeric AS c_invoice_ad_org_id,
616
NULL::numeric AS c_invoice_ad_orgtrx_id,
617
NULL::numeric AS c_invoice_ad_user_id,
618
NULL::numeric AS c_invoice_c_activity_id,
619
NULL::numeric AS c_invoice_c_bpartner_id,
620
NULL::numeric AS c_bpartner_location_id,
621
NULL::numeric AS c_invoice_c_campaign_id,
622
NULL::numeric AS c_invoice_c_charge_id,
623
NULL::numeric AS c_conversiontype_id,
624
NULL::numeric AS c_currency_id,
625
NULL::numeric AS c_doctype_id,
626
NULL::numeric AS c_doctypetarget_id,
627
NULL::numeric AS c_dunninglevel_id,
628
NULL::numeric AS c_invoice_chargeamt,
629
NULL::numeric AS c_order_id,
630
NULL::numeric AS c_payment_id,
631
NULL::numeric AS c_paymentterm_id,
632
NULL::numeric AS c_invoice_c_project_id,
633
NULL::timestamp without time zone AS c_invoice_created,
634
NULL::numeric AS c_invoice_createdby,
635
NULL::timestamp without time zone AS dateacct,
636
NULL::timestamp without time zone AS dateinvoiced,
637
NULL::timestamp without time zone AS dateordered,
638
NULL::timestamp without time zone AS dateprinted,
639
NULL::character varying AS c_invoice_description,
640
NULL::bpchar AS docaction,
641
NULL::bpchar AS docstatus,
642
NULL::character varying AS documentno,
643
NULL::date AS dunninggrace,
644
NULL::bpchar AS generateto,
645
NULL::numeric AS grandtotal,
646
NULL::bpchar AS invoicecollectiontype,
647
NULL::bpchar AS c_invoice_isactive,
648
NULL::bpchar AS isapproved,
649
NULL::bpchar AS isdiscountprinted,
650
NULL::bpchar AS isindispute,
651
NULL::bpchar AS ispaid,
652
NULL::bpchar AS ispayschedulevalid,
653
NULL::bpchar AS c_invoice_isprinted,
654
NULL::bpchar AS c_invoice_isselfservice,
655
NULL::bpchar AS issotrx,
656
NULL::bpchar AS c_invoice_istaxincluded,
657
NULL::bpchar AS istransferred,
658
NULL::numeric AS m_pricelist_id,
659
NULL::numeric AS m_rma_id,
660
NULL::bpchar AS paymentrule,
661
NULL::character varying AS poreference,
662
NULL::bpchar AS posted,
663
NULL::numeric AS processedon,
664
NULL::bpchar AS processing,
665
NULL::numeric AS ref_invoice_id,
666
NULL::numeric AS reversal_id,
667
NULL::numeric AS salesrep_id,
668
NULL::bpchar AS sendemail,
669
NULL::numeric AS totallines,
670
NULL::timestamp without time zone AS c_invoice_updated,
671
NULL::numeric AS c_invoice_updatedby,
672
NULL::numeric AS c_invoice_user1_id,
673
NULL::numeric AS c_invoice_user2_id,
674
NULL::numeric AS c_tax_ad_org_id,
675
NULL::numeric AS ad_rule_id,
676
NULL::numeric AS c_country_id,
677
NULL::numeric AS c_region_id,
678
NULL::numeric AS c_tax_c_taxcategory_id,
679
NULL::character varying AS c_tax_description,
680
NULL::bpchar AS c_tax_isactive,
681
NULL::bpchar AS c_tax_isdefault,
682
NULL::bpchar AS isdocumentlevel,
683
NULL::bpchar AS issalestax,
684
NULL::bpchar AS c_tax_issummary,
685
NULL::bpchar AS istaxexempt,
686
NULL::character varying AS c_tax_name,
687
NULL::numeric AS parent_tax_id,
688
NULL::numeric AS rate,
689
NULL::bpchar AS requirestaxcertificate,
690
NULL::bpchar AS sopotype,
691
NULL::numeric AS to_country_id,
692
NULL::numeric AS to_region_id,
693
NULL::timestamp without time zone AS validfrom,
694
NULL::numeric AS m_product_ad_org_id,
695
NULL::character varying AS classification,
696
NULL::bpchar AS m_product_copyfrom,
697
NULL::timestamp without time zone AS m_product_created,
698
NULL::numeric AS m_product_createdby,
699
NULL::numeric AS c_revenuerecognition_id,
700
NULL::numeric AS c_subscriptiontype_id,
701
NULL::numeric AS m_product_c_taxcategory_id,
702
NULL::character varying AS descriptionurl,
703
NULL::bpchar AS discontinued,
704
NULL::timestamp without time zone AS discontinuedat,
705
NULL::character varying AS group1,
706
NULL::character varying AS group2,
707
NULL::numeric AS guaranteedays,
708
NULL::numeric AS guaranteedaysmin,
709
NULL::character varying AS help,
710
NULL::bpchar AS m_product_isactive,
711
NULL::bpchar AS isbom,
712
NULL::bpchar AS isdropship,
713
NULL::bpchar AS isexcludeautodelivery,
714
NULL::bpchar AS isinvoiceprintdetails,
715
NULL::bpchar AS ispicklistprintdetails,
716
NULL::bpchar AS ispurchased,
717
NULL::bpchar AS m_product_isselfservice,
718
NULL::bpchar AS issold,
719
NULL::bpchar AS isstocked,
720
NULL::bpchar AS m_product_issummary,
721
NULL::bpchar AS isverified,
722
NULL::bpchar AS iswebstorefeatured,
723
NULL::numeric AS lowlevel,
724
NULL::numeric AS m_product_m_attributeset_id,
725
NULL::numeric AS m_product_m_asi_id,
726
NULL::numeric AS m_freightcategory_id,
727
NULL::numeric AS m_locator_id,
728
NULL::numeric AS m_product_m_prod_category_id,
729
NULL::bpchar AS m_product_processing,
730
NULL::bpchar AS producttype,
731
NULL::numeric AS r_mailtext_id,
732
NULL::numeric AS m_product_salesrep_id,
733
NULL::numeric AS s_expensetype_id,
734
NULL::numeric AS shelfdepth,
735
NULL::numeric AS shelfheight,
736
NULL::numeric AS shelfwidth,
737
NULL::numeric AS m_product_s_resource_id,
738
NULL::numeric AS unitsperpack,
739
NULL::numeric AS unitsperpallet,
740
NULL::timestamp without time zone AS m_product_updated,
741
NULL::numeric AS m_product_updatedby,
742
NULL::character varying AS versionno,
743
NULL::numeric AS volume,
744
NULL::numeric AS weight,
745
NULL::numeric AS c_charge_ad_org_id,
746
NULL::numeric AS c_charge_c_bpartner_id,
747
NULL::numeric AS c_chargetype_id,
748
NULL::numeric AS c_charge_chargeamt,
749
NULL::numeric AS c_charge_c_taxcategory_id,
750
NULL::character varying AS c_charge_description,
751
NULL::bpchar AS c_charge_isactive,
752
NULL::bpchar AS issamecurrency,
753
NULL::bpchar AS issametax,
754
NULL::bpchar AS c_charge_istaxincluded,
755
NULL::numeric AS c_bp_product_ad_org_id,
756
NULL::numeric AS c_bp_product_c_bpartner_id,
757
NULL::timestamp without time zone AS c_bp_product_created,
758
NULL::numeric AS c_bp_product_createdby,
759
NULL::character varying AS c_bp_product_description,
760
NULL::bpchar AS c_bp_product_isactive,
761
NULL::bpchar AS ismanufacturer,
762
NULL::character varying AS manufacturer,
763
NULL::numeric AS qualityrating,
764
NULL::numeric AS shelflifemindays,
765
NULL::numeric AS shelflifeminpct,
766
NULL::timestamp without time zone AS c_bp_product_updated,
767
NULL::numeric AS c_bp_product_updatedby,
768
NULL::character varying AS vendorcategory,
769
NULL::numeric AS s_rassignment_ad_org_id,
770
NULL::timestamp without time zone AS assigndatefrom,
771
NULL::timestamp without time zone AS assigndateto,
772
NULL::timestamp without time zone AS s_rassignment_created,
773
NULL::numeric AS s_rassignment_createby,
774
NULL::bpchar AS s_rassignment_isactive,
775
NULL::bpchar AS isconfirmed,
776
NULL::character varying AS s_rassignment_name,
777
NULL::numeric AS s_rassignment_qty,
778
NULL::numeric AS s_rassignment_s_resource_id,
779
NULL::timestamp without time zone AS s_rassignment_updated,
780
NULL::numeric AS s_rassignment_updatedby,
781
NULL::numeric AS m_asi_ad_org_id,
782
NULL::timestamp without time zone AS m_asi_created,
783
NULL::numeric AS m_asi_createdby,
784
NULL::character varying AS m_asi_description,
785
NULL::bpchar AS m_asi_isactive,
786
NULL::timestamp without time zone AS m_asi_updated,
787
NULL::numeric AS m_asi_updatedby
788
FROM c_invoiceline il
789
WHERE (il.c_uom_id IS NULL)
790
UNION
791
SELECT i.ad_client_id,
792
i.ad_org_id,
793
i.isactive,
794
i.created,
795
i.createdby,
796
i.updated,
797
i.updatedby,
798
'en_US'::text AS ad_language,
799
i.c_invoice_id,
800
NULL::numeric AS c_invoiceline_id,
801
NULL::numeric AS c_tax_id,
802
NULL::numeric AS taxamt,
803
NULL::numeric AS linetotalamt,
804
NULL::character varying AS taxindicator,
805
999998 AS line,
806
NULL::numeric AS m_product_id,
807
NULL::numeric AS qtyinvoiced,
808
NULL::numeric AS qtyentered,
809
NULL::character varying AS uomsymbol,
810
NULL::character varying AS name,
811
NULL::character varying AS description,
812
NULL::character varying AS documentnote,
813
NULL::character varying AS upc,
814
NULL::character varying AS sku,
815
NULL::character varying AS productvalue,
816
NULL::character varying AS resourcedescription,
817
NULL::numeric AS pricelist,
818
NULL::numeric AS priceenteredlist,
819
NULL::numeric AS discount,
820
NULL::numeric AS priceactual,
821
NULL::numeric AS priceentered,
822
NULL::numeric AS linenetamt,
823
NULL::numeric AS m_attributesetinstance_id,
824
NULL::numeric AS m_attributeset_id,
825
NULL::character varying AS serno,
826
NULL::character varying AS lot,
827
NULL::numeric AS m_lot_id,
828
NULL::timestamp without time zone AS guaranteedate,
829
NULL::character varying AS productdescription,
830
NULL::character varying AS imageurl,
831
NULL::numeric AS c_campaign_id,
832
NULL::numeric AS c_project_id,
833
NULL::numeric AS c_activity_id,
834
NULL::numeric AS c_projectphase_id,
835
NULL::numeric AS c_projecttask_id,
836
NULL::numeric AS c_invoiceline_ad_orgtrx_id,
837
NULL::bpchar AS a_processed,
838
NULL::numeric AS c_charge_id,
839
NULL::numeric AS c_orderline_id,
840
NULL::numeric AS c_uom_id,
841
NULL::bpchar AS isdescription,
842
NULL::bpchar AS c_invoiceline_isprinted,
843
NULL::numeric AS m_inoutline_id,
844
NULL::numeric AS m_rmaline_id,
845
NULL::numeric AS pricelimit,
846
NULL::bpchar AS c_invoiceline_processed,
847
NULL::numeric AS ref_invoiceline_id,
848
NULL::numeric AS rramt,
849
NULL::timestamp without time zone AS rrstartdate,
850
NULL::numeric AS s_resourceassignment_id,
851
NULL::numeric AS c_invoiceline_user1_id,
852
NULL::numeric AS c_invoiceline_user2_id,
853
NULL::numeric AS c_uom_ad_org_id,
854
NULL::numeric AS costingprecision,
855
NULL::character varying AS c_uom_description,
856
NULL::bpchar AS c_uom_isactive,
857
NULL::bpchar AS c_uom_isdefault,
858
NULL::character varying AS c_uom_name,
859
NULL::numeric AS stdprecision,
860
NULL::character varying AS uomtype,
861
NULL::character varying AS x12de355,
862
NULL::numeric AS c_invoice_ad_org_id,
863
NULL::numeric AS c_invoice_ad_orgtrx_id,
864
NULL::numeric AS c_invoice_ad_user_id,
865
NULL::numeric AS c_invoice_c_activity_id,
866
NULL::numeric AS c_invoice_c_bpartner_id,
867
NULL::numeric AS c_bpartner_location_id,
868
NULL::numeric AS c_invoice_c_campaign_id,
869
NULL::numeric AS c_invoice_c_charge_id,
870
NULL::numeric AS c_conversiontype_id,
871
NULL::numeric AS c_currency_id,
872
NULL::numeric AS c_doctype_id,
873
NULL::numeric AS c_doctypetarget_id,
874
NULL::numeric AS c_dunninglevel_id,
875
NULL::numeric AS c_invoice_chargeamt,
876
NULL::numeric AS c_order_id,
877
NULL::numeric AS c_payment_id,
878
NULL::numeric AS c_paymentterm_id,
879
NULL::numeric AS c_invoice_c_project_id,
880
NULL::timestamp without time zone AS c_invoice_created,
881
NULL::numeric AS c_invoice_createdby,
882
NULL::timestamp without time zone AS dateacct,
883
NULL::timestamp without time zone AS dateinvoiced,
884
NULL::timestamp without time zone AS dateordered,
885
NULL::timestamp without time zone AS dateprinted,
886
NULL::character varying AS c_invoice_description,
887
NULL::bpchar AS docaction,
888
NULL::bpchar AS docstatus,
889
NULL::character varying AS documentno,
890
NULL::date AS dunninggrace,
891
NULL::bpchar AS generateto,
892
NULL::numeric AS grandtotal,
893
NULL::bpchar AS invoicecollectiontype,
894
NULL::bpchar AS c_invoice_isactive,
895
NULL::bpchar AS isapproved,
896
NULL::bpchar AS isdiscountprinted,
897
NULL::bpchar AS isindispute,
898
NULL::bpchar AS ispaid,
899
NULL::bpchar AS ispayschedulevalid,
900
NULL::bpchar AS c_invoice_isprinted,
901
NULL::bpchar AS c_invoice_isselfservice,
902
NULL::bpchar AS issotrx,
903
NULL::bpchar AS c_invoice_istaxincluded,
904
NULL::bpchar AS istransferred,
905
NULL::numeric AS m_pricelist_id,
906
NULL::numeric AS m_rma_id,
907
NULL::bpchar AS paymentrule,
908
NULL::character varying AS poreference,
909
NULL::bpchar AS posted,
910
NULL::numeric AS processedon,
911
NULL::bpchar AS processing,
912
NULL::numeric AS ref_invoice_id,
913
NULL::numeric AS reversal_id,
914
NULL::numeric AS salesrep_id,
915
NULL::bpchar AS sendemail,
916
NULL::numeric AS totallines,
917
NULL::timestamp without time zone AS c_invoice_updated,
918
NULL::numeric AS c_invoice_updatedby,
919
NULL::numeric AS c_invoice_user1_id,
920
NULL::numeric AS c_invoice_user2_id,
921
NULL::numeric AS c_tax_ad_org_id,
922
NULL::numeric AS ad_rule_id,
923
NULL::numeric AS c_country_id,
924
NULL::numeric AS c_region_id,
925
NULL::numeric AS c_tax_c_taxcategory_id,
926
NULL::character varying AS c_tax_description,
927
NULL::bpchar AS c_tax_isactive,
928
NULL::bpchar AS c_tax_isdefault,
929
NULL::bpchar AS isdocumentlevel,
930
NULL::bpchar AS issalestax,
931
NULL::bpchar AS c_tax_issummary,
932
NULL::bpchar AS istaxexempt,
933
NULL::character varying AS c_tax_name,
934
NULL::numeric AS parent_tax_id,
935
NULL::numeric AS rate,
936
NULL::bpchar AS requirestaxcertificate,
937
NULL::bpchar AS sopotype,
938
NULL::numeric AS to_country_id,
939
NULL::numeric AS to_region_id,
940
NULL::timestamp without time zone AS validfrom,
941
NULL::numeric AS m_product_ad_org_id,
942
NULL::character varying AS classification,
943
NULL::bpchar AS m_product_copyfrom,
944
NULL::timestamp without time zone AS m_product_created,
945
NULL::numeric AS m_product_createdby,
946
NULL::numeric AS c_revenuerecognition_id,
947
NULL::numeric AS c_subscriptiontype_id,
948
NULL::numeric AS m_product_c_taxcategory_id,
949
NULL::character varying AS descriptionurl,
950
NULL::bpchar AS discontinued,
951
NULL::timestamp without time zone AS discontinuedat,
952
NULL::character varying AS group1,
953
NULL::character varying AS group2,
954
NULL::numeric AS guaranteedays,
955
NULL::numeric AS guaranteedaysmin,
956
NULL::character varying AS help,
957
NULL::bpchar AS m_product_isactive,
958
NULL::bpchar AS isbom,
959
NULL::bpchar AS isdropship,
960
NULL::bpchar AS isexcludeautodelivery,
961
NULL::bpchar AS isinvoiceprintdetails,
962
NULL::bpchar AS ispicklistprintdetails,
963
NULL::bpchar AS ispurchased,
964
NULL::bpchar AS m_product_isselfservice,
965
NULL::bpchar AS issold,
966
NULL::bpchar AS isstocked,
967
NULL::bpchar AS m_product_issummary,
968
NULL::bpchar AS isverified,
969
NULL::bpchar AS iswebstorefeatured,
970
NULL::numeric AS lowlevel,
971
NULL::numeric AS m_product_m_attributeset_id,
972
NULL::numeric AS m_product_m_asi_id,
973
NULL::numeric AS m_freightcategory_id,
974
NULL::numeric AS m_locator_id,
975
NULL::numeric AS m_product_m_prod_category_id,
976
NULL::bpchar AS m_product_processing,
977
NULL::bpchar AS producttype,
978
NULL::numeric AS r_mailtext_id,
979
NULL::numeric AS m_product_salesrep_id,
980
NULL::numeric AS s_expensetype_id,
981
NULL::numeric AS shelfdepth,
982
NULL::numeric AS shelfheight,
983
NULL::numeric AS shelfwidth,
984
NULL::numeric AS m_product_s_resource_id,
985
NULL::numeric AS unitsperpack,
986
NULL::numeric AS unitsperpallet,
987
NULL::timestamp without time zone AS m_product_updated,
988
NULL::numeric AS m_product_updatedby,
989
NULL::character varying AS versionno,
990
NULL::numeric AS volume,
991
NULL::numeric AS weight,
992
NULL::numeric AS c_charge_ad_org_id,
993
NULL::numeric AS c_charge_c_bpartner_id,
994
NULL::numeric AS c_chargetype_id,
995
NULL::numeric AS c_charge_chargeamt,
996
NULL::numeric AS c_charge_c_taxcategory_id,
997
NULL::character varying AS c_charge_description,
998
NULL::bpchar AS c_charge_isactive,
999
NULL::bpchar AS issamecurrency,
1000
NULL::bpchar AS issametax,
1001
NULL::bpchar AS c_charge_istaxincluded,
1002
NULL::numeric AS c_bp_product_ad_org_id,
1003
NULL::numeric AS c_bp_product_c_bpartner_id,
1004
NULL::timestamp without time zone AS c_bp_product_created,
1005
NULL::numeric AS c_bp_product_createdby,
1006
NULL::character varying AS c_bp_product_description,
1007
NULL::bpchar AS c_bp_product_isactive,
1008
NULL::bpchar AS ismanufacturer,
1009
NULL::character varying AS manufacturer,
1010
NULL::numeric AS qualityrating,
1011
NULL::numeric AS shelflifemindays,
1012
NULL::numeric AS shelflifeminpct,
1013
NULL::timestamp without time zone AS c_bp_product_updated,
1014
NULL::numeric AS c_bp_product_updatedby,
1015
NULL::character varying AS vendorcategory,
1016
NULL::numeric AS s_rassignment_ad_org_id,
1017
NULL::timestamp without time zone AS assigndatefrom,
1018
NULL::timestamp without time zone AS assigndateto,
1019
NULL::timestamp without time zone AS s_rassignment_created,
1020
NULL::numeric AS s_rassignment_createby,
1021
NULL::bpchar AS s_rassignment_isactive,
1022
NULL::bpchar AS isconfirmed,
1023
NULL::character varying AS s_rassignment_name,
1024
NULL::numeric AS s_rassignment_qty,
1025
NULL::numeric AS s_rassignment_s_resource_id,
1026
NULL::timestamp without time zone AS s_rassignment_updated,
1027
NULL::numeric AS s_rassignment_updatedby,
1028
NULL::numeric AS m_asi_ad_org_id,
1029
NULL::timestamp without time zone AS m_asi_created,
1030
NULL::numeric AS m_asi_createdby,
1031
NULL::character varying AS m_asi_description,
1032
NULL::bpchar AS m_asi_isactive,
1033
NULL::timestamp without time zone AS m_asi_updated,
1034
NULL::numeric AS m_asi_updatedby
1035
FROM c_invoice i
1036
UNION
1037
SELECT it.ad_client_id,
1038
it.ad_org_id,
1039
it.isactive,
1040
it.created,
1041
it.createdby,
1042
it.updated,
1043
it.updatedby,
1044
'en_US'::text AS ad_language,
1045
it.c_invoice_id,
1046
NULL::numeric AS c_invoiceline_id,
1047
it.c_tax_id,
1048
NULL::numeric AS taxamt,
1049
NULL::numeric AS linetotalamt,
1050
t.taxindicator,
1051
999999 AS line,
1052
NULL::numeric AS m_product_id,
1053
NULL::numeric AS qtyinvoiced,
1054
NULL::numeric AS qtyentered,
1055
NULL::character varying AS uomsymbol,
1056
t.name,
1057
NULL::character varying AS description,
1058
NULL::character varying AS documentnote,
1059
NULL::character varying AS upc,
1060
NULL::character varying AS sku,
1061
NULL::character varying AS productvalue,
1062
NULL::character varying AS resourcedescription,
1063
NULL::numeric AS pricelist,
1064
NULL::numeric AS priceenteredlist,
1065
NULL::numeric AS discount,
1066
CASE
1067
WHEN (it.istaxincluded = 'Y'::bpchar) THEN it.taxamt
1068
ELSE it.taxbaseamt
1069
END AS priceactual,
1070
CASE
1071
WHEN (it.istaxincluded = 'Y'::bpchar) THEN it.taxamt
1072
ELSE it.taxbaseamt
1073
END AS priceentered,
1074
CASE
1075
WHEN (it.istaxincluded = 'Y'::bpchar) THEN NULL::numeric
1076
ELSE it.taxamt
1077
END AS linenetamt,
1078
NULL::numeric AS m_attributesetinstance_id,
1079
NULL::numeric AS m_attributeset_id,
1080
NULL::character varying AS serno,
1081
NULL::character varying AS lot,
1082
NULL::numeric AS m_lot_id,
1083
NULL::timestamp without time zone AS guaranteedate,
1084
NULL::character varying AS productdescription,
1085
NULL::character varying AS imageurl,
1086
NULL::numeric AS c_campaign_id,
1087
NULL::numeric AS c_project_id,
1088
NULL::numeric AS c_activity_id,
1089
NULL::numeric AS c_projectphase_id,
1090
NULL::numeric AS c_projecttask_id,
1091
NULL::numeric AS c_invoiceline_ad_orgtrx_id,
1092
NULL::bpchar AS a_processed,
1093
NULL::numeric AS c_charge_id,
1094
NULL::numeric AS c_orderline_id,
1095
NULL::numeric AS c_uom_id,
1096
NULL::bpchar AS isdescription,
1097
NULL::bpchar AS c_invoiceline_isprinted,
1098
NULL::numeric AS m_inoutline_id,
1099
NULL::numeric AS m_rmaline_id,
1100
NULL::numeric AS pricelimit,
1101
NULL::bpchar AS c_invoiceline_processed,
1102
NULL::numeric AS ref_invoiceline_id,
1103
NULL::numeric AS rramt,
1104
NULL::timestamp without time zone AS rrstartdate,
1105
NULL::numeric AS s_resourceassignment_id,
1106
NULL::numeric AS c_invoiceline_user1_id,
1107
NULL::numeric AS c_invoiceline_user2_id,
1108
NULL::numeric AS c_uom_ad_org_id,
1109
NULL::numeric AS costingprecision,
1110
NULL::character varying AS c_uom_description,
1111
NULL::bpchar AS c_uom_isactive,
1112
NULL::bpchar AS c_uom_isdefault,
1113
NULL::character varying AS c_uom_name,
1114
NULL::numeric AS stdprecision,
1115
NULL::character varying AS uomtype,
1116
NULL::character varying AS x12de355,
1117
NULL::numeric AS c_invoice_ad_org_id,
1118
NULL::numeric AS c_invoice_ad_orgtrx_id,
1119
NULL::numeric AS c_invoice_ad_user_id,
1120
NULL::numeric AS c_invoice_c_activity_id,
1121
NULL::numeric AS c_invoice_c_bpartner_id,
1122
NULL::numeric AS c_bpartner_location_id,
1123
NULL::numeric AS c_invoice_c_campaign_id,
1124
NULL::numeric AS c_invoice_c_charge_id,
1125
NULL::numeric AS c_conversiontype_id,
1126
NULL::numeric AS c_currency_id,
1127
NULL::numeric AS c_doctype_id,
1128
NULL::numeric AS c_doctypetarget_id,
1129
NULL::numeric AS c_dunninglevel_id,
1130
NULL::numeric AS c_invoice_chargeamt,
1131
NULL::numeric AS c_order_id,
1132
NULL::numeric AS c_payment_id,
1133
NULL::numeric AS c_paymentterm_id,
1134
NULL::numeric AS c_invoice_c_project_id,
1135
NULL::timestamp without time zone AS c_invoice_created,
1136
NULL::numeric AS c_invoice_createdby,
1137
NULL::timestamp without time zone AS dateacct,
1138
NULL::timestamp without time zone AS dateinvoiced,
1139
NULL::timestamp without time zone AS dateordered,
1140
NULL::timestamp without time zone AS dateprinted,
1141
NULL::character varying AS c_invoice_description,
1142
NULL::bpchar AS docaction,
1143
NULL::bpchar AS docstatus,
1144
NULL::character varying AS documentno,
1145
NULL::date AS dunninggrace,
1146
NULL::bpchar AS generateto,
1147
NULL::numeric AS grandtotal,
1148
NULL::bpchar AS invoicecollectiontype,
1149
NULL::bpchar AS c_invoice_isactive,
1150
NULL::bpchar AS isapproved,
1151
NULL::bpchar AS isdiscountprinted,
1152
NULL::bpchar AS isindispute,
1153
NULL::bpchar AS ispaid,
1154
NULL::bpchar AS ispayschedulevalid,
1155
NULL::bpchar AS c_invoice_isprinted,
1156
NULL::bpchar AS c_invoice_isselfservice,
1157
NULL::bpchar AS issotrx,
1158
NULL::bpchar AS c_invoice_istaxincluded,
1159
NULL::bpchar AS istransferred,
1160
NULL::numeric AS m_pricelist_id,
1161
NULL::numeric AS m_rma_id,
1162
NULL::bpchar AS paymentrule,
1163
NULL::character varying AS poreference,
1164
NULL::bpchar AS posted,
1165
NULL::numeric AS processedon,
1166
NULL::bpchar AS processing,
1167
NULL::numeric AS ref_invoice_id,
1168
NULL::numeric AS reversal_id,
1169
NULL::numeric AS salesrep_id,
1170
NULL::bpchar AS sendemail,
1171
NULL::numeric AS totallines,
1172
NULL::timestamp without time zone AS c_invoice_updated,
1173
NULL::numeric AS c_invoice_updatedby,
1174
NULL::numeric AS c_invoice_user1_id,
1175
NULL::numeric AS c_invoice_user2_id,
1176
NULL::numeric AS c_tax_ad_org_id,
1177
NULL::numeric AS ad_rule_id,
1178
NULL::numeric AS c_country_id,
1179
NULL::numeric AS c_region_id,
1180
NULL::numeric AS c_tax_c_taxcategory_id,
1181
NULL::character varying AS c_tax_description,
1182
NULL::bpchar AS c_tax_isactive,
1183
NULL::bpchar AS c_tax_isdefault,
1184
NULL::bpchar AS isdocumentlevel,
1185
NULL::bpchar AS issalestax,
1186
NULL::bpchar AS c_tax_issummary,
1187
NULL::bpchar AS istaxexempt,
1188
NULL::character varying AS c_tax_name,
1189
NULL::numeric AS parent_tax_id,
1190
NULL::numeric AS rate,
1191
NULL::bpchar AS requirestaxcertificate,
1192
NULL::bpchar AS sopotype,
1193
NULL::numeric AS to_country_id,
1194
NULL::numeric AS to_region_id,
1195
NULL::timestamp without time zone AS validfrom,
1196
NULL::numeric AS m_product_ad_org_id,
1197
NULL::character varying AS classification,
1198
NULL::bpchar AS m_product_copyfrom,
1199
NULL::timestamp without time zone AS m_product_created,
1200
NULL::numeric AS m_product_createdby,
1201
NULL::numeric AS c_revenuerecognition_id,
1202
NULL::numeric AS c_subscriptiontype_id,
1203
NULL::numeric AS m_product_c_taxcategory_id,
1204
NULL::character varying AS descriptionurl,
1205
NULL::bpchar AS discontinued,
1206
NULL::timestamp without time zone AS discontinuedat,
1207
NULL::character varying AS group1,
1208
NULL::character varying AS group2,
1209
NULL::numeric AS guaranteedays,
1210
NULL::numeric AS guaranteedaysmin,
1211
NULL::character varying AS help,
1212
NULL::bpchar AS m_product_isactive,
1213
NULL::bpchar AS isbom,
1214
NULL::bpchar AS isdropship,
1215
NULL::bpchar AS isexcludeautodelivery,
1216
NULL::bpchar AS isinvoiceprintdetails,
1217
NULL::bpchar AS ispicklistprintdetails,
1218
NULL::bpchar AS ispurchased,
1219
NULL::bpchar AS m_product_isselfservice,
1220
NULL::bpchar AS issold,
1221
NULL::bpchar AS isstocked,
1222
NULL::bpchar AS m_product_issummary,
1223
NULL::bpchar AS isverified,
1224
NULL::bpchar AS iswebstorefeatured,
1225
NULL::numeric AS lowlevel,
1226
NULL::numeric AS m_product_m_attributeset_id,
1227
NULL::numeric AS m_product_m_asi_id,
1228
NULL::numeric AS m_freightcategory_id,
1229
NULL::numeric AS m_locator_id,
1230
NULL::numeric AS m_product_m_prod_category_id,
1231
NULL::bpchar AS m_product_processing,
1232
NULL::bpchar AS producttype,
1233
NULL::numeric AS r_mailtext_id,
1234
NULL::numeric AS m_product_salesrep_id,
1235
NULL::numeric AS s_expensetype_id,
1236
NULL::numeric AS shelfdepth,
1237
NULL::numeric AS shelfheight,
1238
NULL::numeric AS shelfwidth,
1239
NULL::numeric AS m_product_s_resource_id,
1240
NULL::numeric AS unitsperpack,
1241
NULL::numeric AS unitsperpallet,
1242
NULL::timestamp without time zone AS m_product_updated,
1243
NULL::numeric AS m_product_updatedby,
1244
NULL::character varying AS versionno,
1245
NULL::numeric AS volume,
1246
NULL::numeric AS weight,
1247
NULL::numeric AS c_charge_ad_org_id,
1248
NULL::numeric AS c_charge_c_bpartner_id,
1249
NULL::numeric AS c_chargetype_id,
1250
NULL::numeric AS c_charge_chargeamt,
1251
NULL::numeric AS c_charge_c_taxcategory_id,
1252
NULL::character varying AS c_charge_description,
1253
NULL::bpchar AS c_charge_isactive,
1254
NULL::bpchar AS issamecurrency,
1255
NULL::bpchar AS issametax,
1256
NULL::bpchar AS c_charge_istaxincluded,
1257
NULL::numeric AS c_bp_product_ad_org_id,
1258
NULL::numeric AS c_bp_product_c_bpartner_id,
1259
NULL::timestamp without time zone AS c_bp_product_created,
1260
NULL::numeric AS c_bp_product_createdby,
1261
NULL::character varying AS c_bp_product_description,
1262
NULL::bpchar AS c_bp_product_isactive,
1263
NULL::bpchar AS ismanufacturer,
1264
NULL::character varying AS manufacturer,
1265
NULL::numeric AS qualityrating,
1266
NULL::numeric AS shelflifemindays,
1267
NULL::numeric AS shelflifeminpct,
1268
NULL::timestamp without time zone AS c_bp_product_updated,
1269
NULL::numeric AS c_bp_product_updatedby,
1270
NULL::character varying AS vendorcategory,
1271
NULL::numeric AS s_rassignment_ad_org_id,
1272
NULL::timestamp without time zone AS assigndatefrom,
1273
NULL::timestamp without time zone AS assigndateto,
1274
NULL::timestamp without time zone AS s_rassignment_created,
1275
NULL::numeric AS s_rassignment_createby,
1276
NULL::bpchar AS s_rassignment_isactive,
1277
NULL::bpchar AS isconfirmed,
1278
NULL::character varying AS s_rassignment_name,
1279
NULL::numeric AS s_rassignment_qty,
1280
NULL::numeric AS s_rassignment_s_resource_id,
1281
NULL::timestamp without time zone AS s_rassignment_updated,
1282
NULL::numeric AS s_rassignment_updatedby,
1283
NULL::numeric AS m_asi_ad_org_id,
1284
NULL::timestamp without time zone AS m_asi_created,
1285
NULL::numeric AS m_asi_createdby,
1286
NULL::character varying AS m_asi_description,
1287
NULL::bpchar AS m_asi_isactive,
1288
NULL::timestamp without time zone AS m_asi_updated,
1289
NULL::numeric AS m_asi_updatedby
1290
FROM (c_invoicetax it
1291
JOIN c_tax t ON ((it.c_tax_id = t.c_tax_id)));