DBA Data[Home] [Help]

APPS.ARP_CREDIT_MEMO_MODULE dependencies on RA_CUST_TRX_LINE_GL_DIST

Line 510: 'DELETE from ra_cust_trx_line_gl_dist

506:
507: print_fcn_label( 'arp_credit_memo_module.build_update_mode_sql()+' );
508:
509: l_delete_header_dist_sql :=
510: 'DELETE from ra_cust_trx_line_gl_dist
511: WHERE customer_trx_id = :customer_trx_id
512: and account_class <> ''REC''
513: and account_set_flag = ''N'' ';
514:

Line 525: 'DELETE from ra_cust_trx_line_gl_dist

521: to_char(lengthb(l_delete_header_dist_sql)));
522:
523:
524: l_delete_line_dist_sql :=
525: 'DELETE from ra_cust_trx_line_gl_dist
526: WHERE customer_trx_line_id = :customer_trx_line_id
527: AND account_set_flag = ''N'' ';
528:
529: /* add returning clause for mrc */

Line 813: -- Construct insert into ra_cust_trx_line_gl_dist

809: )' ;
810:
811:
812: ------------------------------------------------
813: -- Construct insert into ra_cust_trx_line_gl_dist
814: ------------------------------------------------
815: l_nonrule_insert_dist_sql :=
816: 'INSERT into ra_cust_trx_line_gl_dist
817: (

Line 816: 'INSERT into ra_cust_trx_line_gl_dist

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

Line 945: ra_cust_trx_line_gl_dist ctlgd,

941: fnd_currencies foreign_fc,
942: ar_lookups al_rules,
943: ra_customer_trx ct,
944: ra_customer_trx_lines ctl,
945: ra_cust_trx_line_gl_dist ctlgd,
946: ra_cust_trx_line_gl_dist rec_ctlgd, /* cm rec dist */
947: ra_cust_trx_line_salesreps ctls,
948: ra_customer_trx prev_ct,
949: ra_customer_trx_lines prev_ctl,

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

942: ar_lookups al_rules,
943: ra_customer_trx ct,
944: ra_customer_trx_lines ctl,
945: ra_cust_trx_line_gl_dist ctlgd,
946: ra_cust_trx_line_gl_dist rec_ctlgd, /* cm rec dist */
947: ra_cust_trx_line_salesreps ctls,
948: ra_customer_trx prev_ct,
949: ra_customer_trx_lines prev_ctl,
950: ra_cust_trx_line_gl_dist prev_ctlgd,

Line 950: ra_cust_trx_line_gl_dist prev_ctlgd,

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

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

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

Line 1106: ra_cust_trx_line_gl_dist inv_rec,

1102: ct.org_id
1103: FROM
1104: ra_customer_trx ct,
1105: ar_lookups al_rules,
1106: ra_cust_trx_line_gl_dist inv_rec,
1107: ra_cust_trx_line_gl_dist cm_rec,
1108: ra_cust_trx_line_gl_dist lgd,
1109: ra_customer_trx_lines ctl
1110: WHERE ct.customer_trx_id = ctl.customer_trx_id

Line 1107: ra_cust_trx_line_gl_dist cm_rec,

1103: FROM
1104: ra_customer_trx ct,
1105: ar_lookups al_rules,
1106: ra_cust_trx_line_gl_dist inv_rec,
1107: ra_cust_trx_line_gl_dist cm_rec,
1108: ra_cust_trx_line_gl_dist lgd,
1109: ra_customer_trx_lines ctl
1110: WHERE ct.customer_trx_id = ctl.customer_trx_id
1111: and ctl.customer_trx_id = lgd.customer_trx_id(+)

Line 1108: ra_cust_trx_line_gl_dist lgd,

1104: ra_customer_trx ct,
1105: ar_lookups al_rules,
1106: ra_cust_trx_line_gl_dist inv_rec,
1107: ra_cust_trx_line_gl_dist cm_rec,
1108: ra_cust_trx_line_gl_dist lgd,
1109: ra_customer_trx_lines ctl
1110: WHERE ct.customer_trx_id = ctl.customer_trx_id
1111: and ctl.customer_trx_id = lgd.customer_trx_id(+)
1112: and ''REC'' = lgd.account_class(+)

Line 1199: FROM ra_cust_trx_line_gl_dist d

1195: 'and ctl.autorule_complete_flag||'''' = ''N''
1196: and exists
1197: (
1198: SELECT ''x''
1199: FROM ra_cust_trx_line_gl_dist d
1200: WHERE d.customer_trx_id = ctl.customer_trx_id
1201: and d.account_class = ''REC''
1202: and d.account_set_flag = ''N''
1203: )';

Line 1215: 'UPDATE ra_cust_trx_line_gl_dist d

1211: ------------------------------------------------
1212: -- Construct the update dist sql
1213: ------------------------------------------------
1214: l_nonrule_update_dist_sql :=
1215: 'UPDATE ra_cust_trx_line_gl_dist d
1216: SET latest_rec_flag = ''N''
1217: WHERE account_class = ''REC''
1218: and d.latest_rec_flag = ''Y''
1219: and d.account_set_flag = ''Y''

Line 1230: FROM ra_cust_trx_line_gl_dist d2

1226: ')
1227: and exists
1228: (
1229: SELECT 1
1230: FROM ra_cust_trx_line_gl_dist d2
1231: WHERE d2.account_class = ''REC''
1232: and d2.latest_rec_flag = ''Y''
1233: and d2.customer_trx_id = d.customer_trx_id
1234: and d.rowid <> d2.rowid

Line 1264: 'UPDATE ra_cust_trx_line_gl_dist lgd

1260:
1261: END IF;
1262:
1263: l_nonrule_update_dist2_sql :=
1264: 'UPDATE ra_cust_trx_line_gl_dist lgd
1265: set
1266: (
1267: amount,
1268: acctd_amount

Line 1278: ra_cust_trx_line_gl_dist lgd2

1274: ' - sum(lgd2.acctd_amount)) + lgd.acctd_amount
1275: FROM
1276: ra_customer_trx_lines ctl,
1277: ra_customer_trx ct,
1278: ra_cust_trx_line_gl_dist lgd2
1279: WHERE ctl.customer_trx_line_id = lgd2.customer_trx_line_id
1280: and ctl.customer_trx_line_id = lgd.customer_trx_line_id
1281: and ct.customer_trx_id = ctl.customer_trx_id
1282: GROUP BY

Line 1294: ra_cust_trx_line_gl_dist lgd3

1290: SELECT min(cust_trx_line_gl_dist_id)
1291: from
1292: ra_customer_trx_lines ctl,
1293: ra_customer_trx ct,
1294: ra_cust_trx_line_gl_dist lgd3
1295: where ctl.customer_trx_line_id = lgd3.customer_trx_line_id';
1296:
1297: IF( p_cm_control.customer_trx_id IS NULL ) then
1298:

Line 1504: ra_cust_trx_line_gl_dist cm_rec,

1500: inv.unit_selling_price,
1501: cm.unit_selling_price
1502: FROM
1503: ra_rules rule,
1504: ra_cust_trx_line_gl_dist cm_rec,
1505: ra_cust_trx_line_gl_dist inv_rec,
1506: ra_cust_trx_line_gl_dist inv_rev,
1507: ra_cust_trx_types inv_type,
1508: ra_customer_trx inv_trx,

Line 1505: ra_cust_trx_line_gl_dist inv_rec,

1501: cm.unit_selling_price
1502: FROM
1503: ra_rules rule,
1504: ra_cust_trx_line_gl_dist cm_rec,
1505: ra_cust_trx_line_gl_dist inv_rec,
1506: ra_cust_trx_line_gl_dist inv_rev,
1507: ra_cust_trx_types inv_type,
1508: ra_customer_trx inv_trx,
1509: ra_customer_trx_lines inv,

Line 1506: ra_cust_trx_line_gl_dist inv_rev,

1502: FROM
1503: ra_rules rule,
1504: ra_cust_trx_line_gl_dist cm_rec,
1505: ra_cust_trx_line_gl_dist inv_rec,
1506: ra_cust_trx_line_gl_dist inv_rev,
1507: ra_cust_trx_types inv_type,
1508: ra_customer_trx inv_trx,
1509: ra_customer_trx_lines inv,
1510: ra_customer_trx cmt,

Line 1529: FROM ra_cust_trx_line_gl_dist inv_dist2

1525: and inv_rev.cust_trx_line_gl_dist_id =
1526: (
1527: SELECT nvl(min(inv_dist2.cust_trx_line_gl_dist_id),
1528: inv_rec.cust_trx_line_gl_dist_id)
1529: FROM ra_cust_trx_line_gl_dist inv_dist2
1530: WHERE inv.customer_trx_line_id = inv_dist2.customer_trx_line_id
1531: and inv_dist2.account_set_flag = ''N''
1532: and inv_dist2.account_class IN (''REV'',''UNEARN'')
1533: )

Line 1539: FROM ra_cust_trx_line_gl_dist subdist

1535: already exist. */
1536: and not exists
1537: (
1538: SELECT ''dists exist''
1539: FROM ra_cust_trx_line_gl_dist subdist
1540: WHERE subdist.customer_trx_line_id = cm.customer_trx_line_id
1541: and nvl(inv.accounting_rule_duration, 1) = 1
1542: and subdist.account_class IN (''REV'',''UNEARN'')
1543: and account_set_flag = ''N''

Line 1586: -- Build insert stmt for ra_cust_trx_line_gl_dist

1582: to_char(lengthb(l_rule_update_cm_lines_sql)));
1583:
1584:
1585: --------------------------------------------------
1586: -- Build insert stmt for ra_cust_trx_line_gl_dist
1587: --------------------------------------------------
1588: l_rule_insert_dist_sql :=
1589: 'INSERT INTO ra_cust_trx_line_gl_dist
1590: (

Line 1589: 'INSERT INTO ra_cust_trx_line_gl_dist

1585: --------------------------------------------------
1586: -- Build insert stmt for ra_cust_trx_line_gl_dist
1587: --------------------------------------------------
1588: l_rule_insert_dist_sql :=
1589: 'INSERT INTO ra_cust_trx_line_gl_dist
1590: (
1591: cust_trx_line_gl_dist_id,
1592: created_by,
1593: creation_date,

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

1658:
1659: l_rule_insert_dist_sql := l_rule_insert_dist_sql || CRLF ||
1660: '(SELECT /*+ ORDERED
1661: INDEX (ara.ragt ar_revenue_assignments_gt_n1) */
1662: ra_cust_trx_line_gl_dist_s.nextval, /* cust_trx_line_dist_id */
1663: ctl.created_by, /* created_by */
1664: sysdate, /* creation_date */
1665: ctl.last_updated_by, /* last_updated_by */
1666: sysdate, /* last_update_date */

Line 1777: ra_cust_trx_line_gl_dist inv_rec,

1773: ra_customer_trx_lines ctl,
1774: ra_customer_trx ct,
1775: fnd_currencies fc,
1776: ar_revenue_assignments_v ara /* Bug 2347001 */,
1777: ra_cust_trx_line_gl_dist inv_rec,
1778: ra_cust_trx_line_gl_dist lgd,
1779: ra_cust_trx_line_salesreps ctls
1780: WHERE lgd.customer_trx_line_id = ctl.previous_customer_trx_line_id
1781: and ctl.previous_customer_trx_line_id = ara.customer_trx_line_id

Line 1778: ra_cust_trx_line_gl_dist lgd,

1774: ra_customer_trx ct,
1775: fnd_currencies fc,
1776: ar_revenue_assignments_v ara /* Bug 2347001 */,
1777: ra_cust_trx_line_gl_dist inv_rec,
1778: ra_cust_trx_line_gl_dist lgd,
1779: ra_cust_trx_line_salesreps ctls
1780: WHERE lgd.customer_trx_line_id = ctl.previous_customer_trx_line_id
1781: and ctl.previous_customer_trx_line_id = ara.customer_trx_line_id
1782: and ara.session_id in (:session_id, -99) /**Bug 2347001 */

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

1838: --------------------------------------------------------
1839:
1840: l_rule_insert_dist_sql := l_rule_insert_dist_sql || CRLF ||
1841: ' (SELECT
1842: ra_cust_trx_line_gl_dist_s.nextval, /* cust_trx_line_dist_id */
1843: ct.created_by, /* created_by */
1844: sysdate, /* creation_date */
1845: ct.last_updated_by, /* last_updated_by */
1846: sysdate, /* last_update_date */

Line 1943: ra_cust_trx_line_gl_dist lgd,

1939: lgd.collected_tax_concat_seg, /* collected tax seg */
1940: lgd.revenue_adjustment_id, /* revenue_adjustment_id */ /*Bug 2543675*/
1941: ct.org_id
1942: FROM
1943: ra_cust_trx_line_gl_dist lgd,
1944: fnd_currencies fc,
1945: ra_customer_trx_lines ctl,
1946: ra_customer_trx ct,
1947: ra_customer_trx_lines ictl,

Line 2140: FROM ra_cust_trx_line_gl_dist lgd,

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

Line 2383: FROM ra_cust_trx_line_gl_dist gld

2379: l_ignore INTEGER;
2380:
2381: CURSOR mrc_gl_dist(p_trx_id NUMBER, p_trx_line_id NUMBER) IS
2382: SELECT cust_trx_line_gl_dist_id
2383: FROM ra_cust_trx_line_gl_dist gld
2384: WHERE gld.customer_trx_id = p_trx_id
2385: AND gld.customer_trx_line_id =
2386: nvl(p_trx_line_id, gld.customer_trx_line_id);
2387:

Line 2922: gl_dist_id ra_cust_trx_line_gl_dist.cust_trx_line_gl_dist_id%TYPE;

2918: l_accounting_rule_id ra_customer_trx_lines_all.accounting_rule_id%TYPE;
2919: l_line_amount ra_customer_trx_lines_all.extended_amount%TYPE;
2920: l_rule_start_date ra_customer_trx_lines_all.rule_start_date%TYPE;
2921: l_original_gl_date ra_customer_trx_lines_all.rule_start_date%TYPE;
2922: gl_dist_id ra_cust_trx_line_gl_dist.cust_trx_line_gl_dist_id%TYPE;
2923:
2924: BEGIN
2925:
2926: print_fcn_label2('arp_credit_memo_module.write_cm_sched_to_table()+' );

Line 2950: -- Insert into ra_cust_trx_line_gl_dist

2946:
2947:
2948: IF( cm_sched_insert_dist_t( i ) = YES ) THEN
2949: -------------------------------------------------------------
2950: -- Insert into ra_cust_trx_line_gl_dist
2951: -------------------------------------------------------------
2952: -------------------------------------------------------------
2953: -- Bind vars
2954: -------------------------------------------------------------