948: sysdate,
949: arp_standard.profile.user_id,
950: -3,
951: ass.gl_date, /* original_gl_date */
952: ra_cust_trx_line_gl_dist_s.NEXTVAL, /* cust_trx_line_gl_dist_id */
953: header.org_id
954: FROM
955: ra_customer_trx header,
956: fnd_currencies fc,
998: 0, NVL(lines.previous_customer_trx_line_id,
999: lines.customer_trx_line_id),
1000: lines.customer_trx_line_id)
1001: FROM
1002: ra_cust_trx_line_gl_dist subdist2
1003: WHERE
1004: subdist2.customer_trx_line_id = lines.customer_trx_line_id
1005: AND subdist2.account_set_flag = 'Y'
1006: AND subdist2.gl_date IS NULL
1017: (
1018: SELECT
1019: 'distribution exists'
1020: FROM
1021: ra_cust_trx_line_gl_dist subdist
1022: WHERE
1023: subdist.customer_trx_line_id = ass.customer_trx_line_id
1024: AND subdist.customer_trx_id + 0 = lines.customer_trx_id
1025: AND subdist.account_set_flag = 'N'
1182: sysdate,
1183: arp_standard.profile.user_id,
1184: -3,
1185: ass.gl_date, /* original_gl_date */
1186: ra_cust_trx_line_gl_dist_s.NEXTVAL, /* cust_trx_line_gl_dist_id */
1187: header.org_id
1188: FROM
1189: ra_customer_trx header,
1190: fnd_currencies fc,
1232: 0, NVL(lines.previous_customer_trx_line_id,
1233: lines.customer_trx_line_id),
1234: lines.customer_trx_line_id)
1235: FROM
1236: ra_cust_trx_line_gl_dist subdist2
1237: WHERE
1238: subdist2.customer_trx_line_id = lines.customer_trx_line_id
1239: AND subdist2.account_set_flag = 'Y'
1240: AND subdist2.gl_date IS NULL
1251: (
1252: SELECT
1253: 'distribution exists'
1254: FROM
1255: ra_cust_trx_line_gl_dist subdist
1256: WHERE
1257: subdist.customer_trx_line_id = ass.customer_trx_line_id
1258: AND subdist.customer_trx_id + 0 = lines.customer_trx_id
1259: AND subdist.account_set_flag = 'N'
1411: arp_standard.profile.program_id,
1412: sysdate,
1413: -3, /* posting_control_id */
1414: NVL(NVL(rec.original_gl_date, rec.gl_date), header.trx_date),
1415: ra_cust_trx_line_gl_dist_s.NEXTVAL,
1416: header.org_id
1417: FROM
1418: ra_cust_trx_line_gl_dist rec,
1419: ra_customer_trx header
1609: arp_standard.profile.program_id,
1610: sysdate,
1611: -3, /* posting_control_id */
1612: NVL(NVL(rec.original_gl_date, rec.gl_date), header.trx_date),
1613: ra_cust_trx_line_gl_dist_s.nextval,
1614: header.org_id
1615: FROM
1616: ra_customer_trx header,
1617: ra_cust_trx_line_gl_dist rec, /* ROUND row */
1891: arp_standard.profile.program_id,
1892: sysdate,
1893: -3, /* posting_control_id */
1894: NVL( NVL(rec.original_gl_date, rec.gl_date), trx.trx_date),
1895: ra_cust_trx_line_gl_dist_s.NEXTVAL,
1896: /* Bug 2150541 */
1897: DECODE(psum.account_class, 'UNEARN', 'Y',
1898: 'UNBILL', 'Y',
1899: NULL) ,
1935: 0, NVL(lines.previous_customer_trx_line_id,
1936: lines.customer_trx_line_id),
1937: lines.customer_trx_line_id)
1938: FROM
1939: ra_cust_trx_line_gl_dist subdist2
1940: WHERE
1941: subdist2.customer_trx_line_id = lines.customer_trx_line_id
1942: AND subdist2.account_set_flag = 'Y'
1943: AND subdist2.gl_date IS NULL
1959: (
1960: SELECT
1961: 'plug sum account exists'
1962: FROM
1963: ra_cust_trx_line_gl_dist subdist
1964: WHERE
1965: subdist.account_class IN
1966: ( 'SUSPENSE', DECODE(trx.invoicing_rule_id,
1967: -2, 'UNEARN',
2094: arp_standard.profile.program_id,
2095: sysdate,
2096: -3, /* posting_control_id */
2097: NVL( NVL(rec.original_gl_date, rec.gl_date), trx.trx_date),
2098: ra_cust_trx_line_gl_dist_s.NEXTVAL,
2099: /* Bug 2150541 */
2100: DECODE(psum.account_class, 'UNEARN', 'Y',
2101: 'UNBILL', 'Y',
2102: NULL),
2147: (
2148: SELECT
2149: 'plug sum account exists'
2150: FROM
2151: ra_cust_trx_line_gl_dist subdist
2152: WHERE
2153: subdist.account_class IN
2154: ( 'SUSPENSE', DECODE(trx.invoicing_rule_id,
2155: -2, 'UNEARN',
2352: arp_standard.profile.program_id,
2353: sysdate,
2354: -3,
2355: NVL( NVL(rec.original_gl_date, rec.gl_date), trx.trx_date),
2356: ra_cust_trx_line_gl_dist_s.NEXTVAL,
2357: tax.collected_tax_ccid,
2358: trx.org_id
2359: FROM
2360: ra_customer_trx model_trx,
2386: 0, NVL(tax_line.previous_customer_trx_line_id,
2387: tax_line.customer_trx_line_id),
2388: tax_line.customer_trx_line_id)
2389: FROM
2390: ra_cust_trx_line_gl_dist subdist2
2391: WHERE
2392: subdist2.customer_trx_line_id=tax_line.customer_trx_line_id
2393: AND subdist2.account_set_flag = 'Y'
2394: AND subdist2.gl_date IS NULL
2401: AND NOT EXISTS
2402: (SELECT
2403: 'tax account exists'
2404: FROM
2405: ra_cust_trx_line_gl_dist subdist
2406: WHERE
2407: tax_line.customer_trx_line_id = subdist.customer_trx_line_id
2408: AND subdist.account_set_flag = 'N'
2409: AND subdist.gl_date IS NOT NULL
2551: arp_standard.profile.program_id,
2552: sysdate,
2553: -3,
2554: NVL( NVL(rec.original_gl_date, rec.gl_date), trx.trx_date),
2555: ra_cust_trx_line_gl_dist_s.NEXTVAL,
2556: trx.org_id
2557: FROM
2558: ra_customer_trx model_trx,
2559: ra_cust_trx_line_gl_dist freight,
2587: 0, NVL(lines.previous_customer_trx_line_id,
2588: lines.customer_trx_line_id),
2589: lines.customer_trx_line_id)
2590: FROM
2591: ra_cust_trx_line_gl_dist subdist2
2592: WHERE
2593: subdist2.customer_trx_line_id = lines.customer_trx_line_id
2594: AND subdist2.account_set_flag = 'Y'
2595: AND subdist2.gl_date IS NULL
2603: AND NOT EXISTS
2604: (SELECT
2605: 'freight account exists'
2606: FROM
2607: ra_cust_trx_line_gl_dist subdist
2608: WHERE
2609: subdist.customer_trx_line_id = lines.customer_trx_line_id
2610: AND subdist.account_set_flag = 'N'
2611: AND subdist.gl_date IS NOT NULL