DBA Data[Home] [Help]

APPS.ARP_CREDIT_MEMO_MODULE dependencies on RA_CUST_TRX_LINE_GL_DIST

Line 514: 'DELETE from ra_cust_trx_line_gl_dist

510:
511: print_fcn_label( 'arp_credit_memo_module.build_update_mode_sql()+' );
512:
513: l_delete_header_dist_sql :=
514: 'DELETE from ra_cust_trx_line_gl_dist
515: WHERE customer_trx_id = :customer_trx_id
516: and account_class <> ''REC''
517: and account_set_flag = ''N'' ';
518:

Line 529: 'DELETE from ra_cust_trx_line_gl_dist

525: to_char(lengthb(l_delete_header_dist_sql)));
526:
527:
528: l_delete_line_dist_sql :=
529: 'DELETE from ra_cust_trx_line_gl_dist
530: WHERE customer_trx_line_id = :customer_trx_line_id
531: AND account_set_flag = ''N'' ';
532:
533: /* add returning clause for mrc */

Line 817: -- Construct insert into ra_cust_trx_line_gl_dist

813: )' ;
814:
815:
816: ------------------------------------------------
817: -- Construct insert into ra_cust_trx_line_gl_dist
818: ------------------------------------------------
819: l_nonrule_insert_dist_sql :=
820: 'INSERT into ra_cust_trx_line_gl_dist
821: (

Line 820: 'INSERT into ra_cust_trx_line_gl_dist

816: ------------------------------------------------
817: -- Construct insert into ra_cust_trx_line_gl_dist
818: ------------------------------------------------
819: l_nonrule_insert_dist_sql :=
820: 'INSERT into ra_cust_trx_line_gl_dist
821: (
822: /* gl_dist_id used to be here - now populated by BRI trigger */
823: customer_trx_id, /* credit memo customer_trx_id */
824: customer_trx_line_id, /* credit memo customer_trx_line_id */

Line 949: ra_cust_trx_line_gl_dist ctlgd,

945: fnd_currencies foreign_fc,
946: ar_lookups al_rules,
947: ra_customer_trx ct,
948: ra_customer_trx_lines ctl,
949: ra_cust_trx_line_gl_dist ctlgd,
950: ra_cust_trx_line_gl_dist rec_ctlgd, /* cm rec dist */
951: ra_cust_trx_line_salesreps ctls,
952: ra_customer_trx prev_ct,
953: ra_customer_trx_lines prev_ctl,

Line 950: ra_cust_trx_line_gl_dist rec_ctlgd, /* cm rec dist */

946: ar_lookups al_rules,
947: ra_customer_trx ct,
948: ra_customer_trx_lines ctl,
949: ra_cust_trx_line_gl_dist ctlgd,
950: ra_cust_trx_line_gl_dist rec_ctlgd, /* cm rec dist */
951: ra_cust_trx_line_salesreps ctls,
952: ra_customer_trx prev_ct,
953: ra_customer_trx_lines prev_ctl,
954: ra_cust_trx_line_gl_dist prev_ctlgd,

Line 954: ra_cust_trx_line_gl_dist prev_ctlgd,

950: ra_cust_trx_line_gl_dist rec_ctlgd, /* cm rec dist */
951: ra_cust_trx_line_salesreps ctls,
952: ra_customer_trx prev_ct,
953: ra_customer_trx_lines prev_ctl,
954: ra_cust_trx_line_gl_dist prev_ctlgd,
955: ra_cust_trx_line_gl_dist prev_ctlgd2 /* inv rec dist */
956: WHERE ct.customer_trx_id = ctl.customer_trx_id
957: and ctl.customer_trx_line_id = ctlgd.customer_trx_line_id(+)
958: /* only look at invoices without an invoicing rule */

Line 955: ra_cust_trx_line_gl_dist prev_ctlgd2 /* inv rec dist */

951: ra_cust_trx_line_salesreps ctls,
952: ra_customer_trx prev_ct,
953: ra_customer_trx_lines prev_ctl,
954: ra_cust_trx_line_gl_dist prev_ctlgd,
955: ra_cust_trx_line_gl_dist prev_ctlgd2 /* inv rec dist */
956: WHERE ct.customer_trx_id = ctl.customer_trx_id
957: and ctl.customer_trx_line_id = ctlgd.customer_trx_line_id(+)
958: /* only look at invoices without an invoicing rule */
959: and al_rules.lookup_code = ''N''

Line 1113: ra_cust_trx_line_gl_dist inv_rec,

1109: ct.org_id
1110: FROM
1111: ra_customer_trx ct,
1112: ar_lookups al_rules,
1113: ra_cust_trx_line_gl_dist inv_rec,
1114: ra_cust_trx_line_gl_dist cm_rec,
1115: ra_cust_trx_line_gl_dist lgd,
1116: ra_customer_trx_lines ctl
1117: WHERE ct.customer_trx_id = ctl.customer_trx_id

Line 1114: ra_cust_trx_line_gl_dist cm_rec,

1110: FROM
1111: ra_customer_trx ct,
1112: ar_lookups al_rules,
1113: ra_cust_trx_line_gl_dist inv_rec,
1114: ra_cust_trx_line_gl_dist cm_rec,
1115: ra_cust_trx_line_gl_dist lgd,
1116: ra_customer_trx_lines ctl
1117: WHERE ct.customer_trx_id = ctl.customer_trx_id
1118: and ctl.customer_trx_id = lgd.customer_trx_id(+)

Line 1115: ra_cust_trx_line_gl_dist lgd,

1111: ra_customer_trx ct,
1112: ar_lookups al_rules,
1113: ra_cust_trx_line_gl_dist inv_rec,
1114: ra_cust_trx_line_gl_dist cm_rec,
1115: ra_cust_trx_line_gl_dist lgd,
1116: ra_customer_trx_lines ctl
1117: WHERE ct.customer_trx_id = ctl.customer_trx_id
1118: and ctl.customer_trx_id = lgd.customer_trx_id(+)
1119: and ''REC'' = lgd.account_class(+)

Line 1206: FROM ra_cust_trx_line_gl_dist d

1202: 'and ctl.autorule_complete_flag||'''' = ''N''
1203: and exists
1204: (
1205: SELECT ''x''
1206: FROM ra_cust_trx_line_gl_dist d
1207: WHERE d.customer_trx_id = ctl.customer_trx_id
1208: and d.account_class = ''REC''
1209: and d.account_set_flag = ''N''
1210: )';

Line 1222: 'UPDATE ra_cust_trx_line_gl_dist d

1218: ------------------------------------------------
1219: -- Construct the update dist sql
1220: ------------------------------------------------
1221: l_nonrule_update_dist_sql :=
1222: 'UPDATE ra_cust_trx_line_gl_dist d
1223: SET latest_rec_flag = ''N''
1224: WHERE account_class = ''REC''
1225: and d.latest_rec_flag = ''Y''
1226: and d.account_set_flag = ''Y''

Line 1237: FROM ra_cust_trx_line_gl_dist d2

1233: ')
1234: and exists
1235: (
1236: SELECT 1
1237: FROM ra_cust_trx_line_gl_dist d2
1238: WHERE d2.account_class = ''REC''
1239: and d2.latest_rec_flag = ''Y''
1240: and d2.customer_trx_id = d.customer_trx_id
1241: and d.rowid <> d2.rowid

Line 1271: 'UPDATE ra_cust_trx_line_gl_dist lgd

1267:
1268: END IF;
1269:
1270: l_nonrule_update_dist2_sql :=
1271: 'UPDATE ra_cust_trx_line_gl_dist lgd
1272: set
1273: (
1274: amount,
1275: acctd_amount

Line 1285: ra_cust_trx_line_gl_dist lgd2

1281: ' - sum(lgd2.acctd_amount)) + lgd.acctd_amount
1282: FROM
1283: ra_customer_trx_lines ctl,
1284: ra_customer_trx ct,
1285: ra_cust_trx_line_gl_dist lgd2
1286: WHERE ctl.customer_trx_line_id = lgd2.customer_trx_line_id
1287: and ctl.customer_trx_line_id = lgd.customer_trx_line_id
1288: and ct.customer_trx_id = ctl.customer_trx_id
1289: GROUP BY

Line 1301: ra_cust_trx_line_gl_dist lgd3

1297: SELECT min(cust_trx_line_gl_dist_id)
1298: from
1299: ra_customer_trx_lines ctl,
1300: ra_customer_trx ct,
1301: ra_cust_trx_line_gl_dist lgd3
1302: where ctl.customer_trx_line_id = lgd3.customer_trx_line_id';
1303:
1304: IF( p_cm_control.customer_trx_id IS NULL ) then
1305:

Line 1512: ra_cust_trx_line_gl_dist cm_rec,

1508: cm.unit_selling_price,
1509: inv.rule_end_date
1510: FROM
1511: ra_rules rule,
1512: ra_cust_trx_line_gl_dist cm_rec,
1513: ra_cust_trx_line_gl_dist inv_rec,
1514: ra_cust_trx_line_gl_dist inv_rev,
1515: ra_cust_trx_types inv_type,
1516: ra_customer_trx inv_trx,

Line 1513: ra_cust_trx_line_gl_dist inv_rec,

1509: inv.rule_end_date
1510: FROM
1511: ra_rules rule,
1512: ra_cust_trx_line_gl_dist cm_rec,
1513: ra_cust_trx_line_gl_dist inv_rec,
1514: ra_cust_trx_line_gl_dist inv_rev,
1515: ra_cust_trx_types inv_type,
1516: ra_customer_trx inv_trx,
1517: ra_customer_trx_lines inv,

Line 1514: ra_cust_trx_line_gl_dist inv_rev,

1510: FROM
1511: ra_rules rule,
1512: ra_cust_trx_line_gl_dist cm_rec,
1513: ra_cust_trx_line_gl_dist inv_rec,
1514: ra_cust_trx_line_gl_dist inv_rev,
1515: ra_cust_trx_types inv_type,
1516: ra_customer_trx inv_trx,
1517: ra_customer_trx_lines inv,
1518: ra_customer_trx cmt,

Line 1538: FROM ra_cust_trx_line_gl_dist inv_dist2

1534: and inv_rev.cust_trx_line_gl_dist_id =
1535: (
1536: SELECT nvl(min(inv_dist2.cust_trx_line_gl_dist_id),
1537: inv_rec.cust_trx_line_gl_dist_id)
1538: FROM ra_cust_trx_line_gl_dist inv_dist2
1539: WHERE inv.customer_trx_line_id = inv_dist2.customer_trx_line_id
1540: and inv_dist2.account_set_flag = ''N''
1541: and inv_dist2.account_class IN (''REV'',''UNEARN'')
1542: )

Line 1548: FROM ra_cust_trx_line_gl_dist subdist

1544: already exist. */
1545: and not exists
1546: (
1547: SELECT ''dists exist''
1548: FROM ra_cust_trx_line_gl_dist subdist
1549: WHERE subdist.customer_trx_line_id = cm.customer_trx_line_id
1550: and nvl(inv.accounting_rule_duration, 1) = 1
1551: and subdist.account_class IN (''REV'',''UNEARN'')
1552: and account_set_flag = ''N''

Line 1595: -- Build insert stmt for ra_cust_trx_line_gl_dist

1591: to_char(lengthb(l_rule_update_cm_lines_sql)));
1592:
1593:
1594: --------------------------------------------------
1595: -- Build insert stmt for ra_cust_trx_line_gl_dist
1596: --------------------------------------------------
1597: l_rule_insert_dist_sql :=
1598: 'INSERT INTO ra_cust_trx_line_gl_dist
1599: (

Line 1598: 'INSERT INTO ra_cust_trx_line_gl_dist

1594: --------------------------------------------------
1595: -- Build insert stmt for ra_cust_trx_line_gl_dist
1596: --------------------------------------------------
1597: l_rule_insert_dist_sql :=
1598: 'INSERT INTO ra_cust_trx_line_gl_dist
1599: (
1600: cust_trx_line_gl_dist_id,
1601: created_by,
1602: creation_date,

Line 1671: INDEX (inv_rec ra_cust_trx_line_gl_dist_n6) */

1667:
1668: l_rule_insert_dist_sql := l_rule_insert_dist_sql || CRLF ||
1669: '(SELECT /*+ ORDERED
1670: INDEX (ara.ragt ar_revenue_assignments_gt_n1)
1671: INDEX (inv_rec ra_cust_trx_line_gl_dist_n6) */
1672: ra_cust_trx_line_gl_dist_s.nextval, /* cust_trx_line_dist_id */
1673: ctl.created_by, /* created_by */
1674: sysdate, /* creation_date */
1675: ctl.last_updated_by, /* last_updated_by */

Line 1672: ra_cust_trx_line_gl_dist_s.nextval, /* cust_trx_line_dist_id */

1668: l_rule_insert_dist_sql := l_rule_insert_dist_sql || CRLF ||
1669: '(SELECT /*+ ORDERED
1670: INDEX (ara.ragt ar_revenue_assignments_gt_n1)
1671: INDEX (inv_rec ra_cust_trx_line_gl_dist_n6) */
1672: ra_cust_trx_line_gl_dist_s.nextval, /* cust_trx_line_dist_id */
1673: ctl.created_by, /* created_by */
1674: sysdate, /* creation_date */
1675: ctl.last_updated_by, /* last_updated_by */
1676: sysdate, /* last_update_date */

Line 1789: ra_cust_trx_line_gl_dist inv_rec,

1785: ra_customer_trx_lines ctl,
1786: ra_customer_trx ct,
1787: fnd_currencies fc,
1788: ar_revenue_assignments_v ara /* Bug 2347001 */,
1789: ra_cust_trx_line_gl_dist inv_rec,
1790: ra_cust_trx_line_gl_dist lgd,
1791: ra_cust_trx_line_salesreps ctls
1792: WHERE lgd.customer_trx_line_id = ctl.previous_customer_trx_line_id
1793: and ctl.previous_customer_trx_line_id = ara.customer_trx_line_id

Line 1790: ra_cust_trx_line_gl_dist lgd,

1786: ra_customer_trx ct,
1787: fnd_currencies fc,
1788: ar_revenue_assignments_v ara /* Bug 2347001 */,
1789: ra_cust_trx_line_gl_dist inv_rec,
1790: ra_cust_trx_line_gl_dist lgd,
1791: ra_cust_trx_line_salesreps ctls
1792: WHERE lgd.customer_trx_line_id = ctl.previous_customer_trx_line_id
1793: and ctl.previous_customer_trx_line_id = ara.customer_trx_line_id
1794: and ara.session_id in (:session_id, -99) /**Bug 2347001 */

Line 1856: ra_cust_trx_line_gl_dist_s.nextval, /* cust_trx_line_dist_id */

1852: --------------------------------------------------------
1853:
1854: l_rule_insert_dist_sql := l_rule_insert_dist_sql || CRLF ||
1855: ' (SELECT
1856: ra_cust_trx_line_gl_dist_s.nextval, /* cust_trx_line_dist_id */
1857: ct.created_by, /* created_by */
1858: sysdate, /* creation_date */
1859: ct.last_updated_by, /* last_updated_by */
1860: sysdate, /* last_update_date */

Line 1957: ra_cust_trx_line_gl_dist lgd,

1953: lgd.collected_tax_concat_seg, /* collected tax seg */
1954: lgd.revenue_adjustment_id, /* revenue_adjustment_id */ /*Bug 2543675*/
1955: ct.org_id
1956: FROM
1957: ra_cust_trx_line_gl_dist lgd,
1958: fnd_currencies fc,
1959: ra_customer_trx_lines ctl,
1960: ra_customer_trx ct,
1961: ra_customer_trx_lines ictl,

Line 2144: FROM ra_cust_trx_line_gl_dist lgd,

2140: decode(lgd.customer_trx_id,
2141: NULL, ''N'',
2142: ''Y'')
2143: ) /* inv dist exists */
2144: FROM ra_cust_trx_line_gl_dist lgd,
2145: ra_customer_trx trx,
2146: ar_cm_net_revenue_form cnr
2147: WHERE cnr.previous_customer_trx_line_id = :start_prev_ctlid
2148: and cnr.previous_customer_trx_line_id = lgd.customer_trx_line_id(+)

Line 2196: FROM ra_cust_trx_line_gl_dist lgd,

2192: decode(lgd.customer_trx_id,
2193: NULL, ''N'',
2194: ''Y'')
2195: ) /* inv dist exists */
2196: FROM ra_cust_trx_line_gl_dist lgd,
2197: ra_customer_trx trx,
2198: ar_cm_net_rev_dist_form cnr
2199: WHERE cnr.previous_customer_trx_line_id = :start_prev_ctlid
2200: and cnr.previous_customer_trx_line_id = lgd.customer_trx_line_id(+)

Line 2313: FROM RA_CUST_TRX_LINE_GL_DIST LGD,

2309:
2310:
2311: SELECT SUM(LGD.AMOUNT), MAX(SUBSTR(NVL(RR.TYPE, 'N'), 1, 1))
2312: INTO l_rev_count, l_rule_type
2313: FROM RA_CUST_TRX_LINE_GL_DIST LGD,
2314: RA_CUSTOMER_TRX_LINES_ALL CTL,
2315: RA_RULES RR
2316: WHERE LGD.CUSTOMER_TRX_LINE_ID = p_prev_cust_trx_line_id
2317: AND CTL.CUSTOMER_TRX_LINE_ID = LGD.CUSTOMER_TRX_LINE_ID

Line 2463: FROM ra_cust_trx_line_gl_dist gld

2459: l_ignore INTEGER;
2460:
2461: CURSOR mrc_gl_dist(p_trx_id NUMBER, p_trx_line_id NUMBER) IS
2462: SELECT cust_trx_line_gl_dist_id
2463: FROM ra_cust_trx_line_gl_dist gld
2464: WHERE gld.customer_trx_id = p_trx_id
2465: AND gld.customer_trx_line_id =
2466: nvl(p_trx_line_id, gld.customer_trx_line_id);
2467:

Line 3007: gl_dist_id ra_cust_trx_line_gl_dist.cust_trx_line_gl_dist_id%TYPE;

3003: l_accounting_rule_id ra_customer_trx_lines_all.accounting_rule_id%TYPE;
3004: l_line_amount ra_customer_trx_lines_all.extended_amount%TYPE;
3005: l_rule_start_date ra_customer_trx_lines_all.rule_start_date%TYPE;
3006: l_original_gl_date ra_customer_trx_lines_all.rule_start_date%TYPE;
3007: gl_dist_id ra_cust_trx_line_gl_dist.cust_trx_line_gl_dist_id%TYPE;
3008:
3009: BEGIN
3010:
3011: print_fcn_label2('arp_credit_memo_module.write_cm_sched_to_table()+' );

Line 3037: -- Insert into ra_cust_trx_line_gl_dist

3033:
3034:
3035: IF( cm_sched_insert_dist_t( i ) = YES ) THEN
3036: -------------------------------------------------------------
3037: -- Insert into ra_cust_trx_line_gl_dist
3038: -------------------------------------------------------------
3039: -------------------------------------------------------------
3040: -- Bind vars
3041: -------------------------------------------------------------

Line 5332: FROM ra_cust_trx_line_gl_dist ctlgd

5328: FROM ra_interface_lines int
5329: WHERE int.request_id = p_request_id
5330: AND int.previous_customer_trx_id IS NOT NULL
5331: AND NOT EXISTS (SELECT 1
5332: FROM ra_cust_trx_line_gl_dist ctlgd
5333: WHERE int.previous_customer_trx_id = ctlgd.customer_trx_id
5334: AND ctlgd.account_class = 'REC'
5335: AND ctlgd.account_set_flag = 'N')
5336: AND EXISTS (SELECT 1