DBA Data[Home] [Help]

APPS.XLA_THIRD_PARTY_MERGE dependencies on XLA_AE_LINES

Line 27: | 03-Mar-05 V. Kumar Bug 5041325 Populating GL_SL_LINK_ID in xla_ae_lines|

23: | - these APIs are not supposed to raise any exception |
24: | |
25: | HISTORY |
26: | 08-Sep-05 L. Poon Created |
27: | 03-Mar-05 V. Kumar Bug 5041325 Populating GL_SL_LINK_ID in xla_ae_lines|
28: | 21-Jun-2006 A.Wan 5100860 Performance fix, see bug for detail |
29: | 01-Oct-2012 vkanteti 14773226 Performance saving receipt changing cust |
30: | 25-Apr-2013 vkanteti 16759107 Dynamic SQL correction and Debugs added |
31: +===========================================================================*/

Line 1110: from xla_ae_lines_gt;

1106:
1107: CURSOR csr_set_linenum is
1108: select rowid, dense_rank() over (partition by ae_header_id
1109: order by line_hash_num, merge_index) ae_line_num
1110: from xla_ae_lines_gt;
1111:
1112: CURSOR csr_rounding_lines is
1113: SELECT max(xalg.rowid)
1114: ,rounding_class_code

Line 1123: FROM xla_ae_lines_gt xalg

1119: ,ae_header_id
1120: ,NVL(SUM(unrounded_entered_cr), 0)
1121: - NVL(SUM(unrounded_entered_dr), 0) unrounded_entered_amount
1122: ,entered_currency_mau
1123: FROM xla_ae_lines_gt xalg
1124: WHERE temp_line_num <> 0
1125: GROUP BY ledger_id, event_id, ae_header_id,
1126: rounding_class_code, document_rounding_level, ae_line_num
1127: ,entered_currency_mau

Line 1153: UPDATE xla_ae_lines_gt ael

1149: END LOOP;
1150:
1151: BEGIN
1152:
1153: UPDATE xla_ae_lines_gt ael
1154: set line_hash_num =
1155: DBMS_UTILITY.GET_HASH_VALUE
1156: (ae_header_id
1157: ||accounting_class_code

Line 1208: UPDATE xla_ae_lines_gt

1204: EXIT;
1205: END IF;
1206:
1207: FORALL i IN 1..l_array_rowid.count
1208: UPDATE xla_ae_lines_gt
1209: SET ae_line_num = l_array_ae_line_num(i)
1210: WHERE rowid = l_array_rowid(i);
1211: END LOOP;
1212: Close csr_set_linenum;

Line 1217: (p_msg => 'SQL - Update xla_ae_lines_gt 3'

1213:
1214: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1215:
1216: trace
1217: (p_msg => 'SQL - Update xla_ae_lines_gt 3'
1218: ,p_level => C_LEVEL_STATEMENT
1219: ,p_module => l_log_module);
1220:
1221: END IF;

Line 1257: (p_msg => 'SQL - Update xla_ae_lines_gt 6'

1253: EXIT;
1254: END IF;
1255: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1256: trace
1257: (p_msg => 'SQL - Update xla_ae_lines_gt 6'
1258: ,p_level => C_LEVEL_STATEMENT
1259: ,p_module => l_log_module);
1260: trace
1261: (p_msg => 'count:'||to_char(l_array_rounding_class_code.count)

Line 1360: update xla_ae_lines_gt

1356: l_array_rounding_entd_amt1(j) := l_curr_entd_rounding_amount;
1357: j:= j+1;
1358: IF (j> C_BULK_LIMIT) THEN
1359: FORALL i in 1..j-1
1360: update xla_ae_lines_gt
1361: set doc_rounding_acctd_amt = l_array_doc_rounding_amt1(i)
1362: ,doc_rounding_entered_amt = l_array_rounding_entd_amt1(i)
1363: where rowid = l_array_rowid1(i);
1364: j:=1;

Line 1459: (p_msg => 'SQL - Update xla_ae_lines_gt 7, j='||to_char(j)

1455: END IF;
1456:
1457: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1458: trace
1459: (p_msg => 'SQL - Update xla_ae_lines_gt 7, j='||to_char(j)
1460: ,p_level => C_LEVEL_STATEMENT
1461: ,p_module => l_log_module);
1462: END IF;
1463:

Line 1466: update xla_ae_lines_gt

1462: END IF;
1463:
1464: IF j>1 THEN
1465: FORALL i in 1..j-1
1466: update xla_ae_lines_gt
1467: set doc_rounding_acctd_amt = l_array_doc_rounding_amt1(i)
1468: ,doc_rounding_entered_amt = l_array_rounding_entd_amt1(i)
1469: where rowid = l_array_rowid1(i);
1470: END IF;

Line 1715: FROM xla_ae_lines_gt;

1711: , rounding_class_code
1712: , document_rounding_level
1713: , doc_rounding_acctd_amt
1714: , doc_rounding_entered_amt
1715: FROM xla_ae_lines_gt;
1716:
1717: IF (C_LEVEL_PROCEDURE >= g_log_level)
1718: THEN
1719: trace( p_msg => 'END - ' || v_function

Line 1748: INSERT INTO xla_ae_lines

1744: , p_module => v_module);
1745: END IF; -- IF (C_LEVEL_PROCEDURE >= g_log_level)
1746:
1747: FORALL i in 1..p_array_ledger_id.count
1748: INSERT INTO xla_ae_lines
1749: (
1750: ae_header_id
1751: , ae_line_num
1752: , displayed_line_number

Line 2236: FROM xla_ae_lines_gt lin

2232: , accounting_date
2233: , ledger_id
2234: , alt_segment1
2235: , accounting_entry_status_code
2236: FROM xla_ae_lines_gt lin
2237: WHERE ledger_id = p_array_ledger_id(i)
2238: AND ae_line_num is not NULL
2239: GROUP BY lin.ae_header_id
2240: , ae_line_num

Line 2282: (p_msg => '# journal entry lines inserted into xla_ae_lines = '||to_char(l_count)

2278:
2279: l_count := SQL%ROWCOUNT;
2280: IF (C_LEVEL_EVENT >= g_log_level) THEN
2281: trace
2282: (p_msg => '# journal entry lines inserted into xla_ae_lines = '||to_char(l_count)
2283: ,p_level => C_LEVEL_EVENT
2284: ,p_module => v_module);
2285: END IF;
2286:

Line 2508: FROM xla_ae_lines ael

2504: AND 'TRANSFER' = p_array_merge_option(i)
2505: AND merge_event_id is null
2506: AND ae_header_id in
2507: (SELECT ael.ae_header_id
2508: FROM xla_ae_lines ael
2509: ,XLA_PARTIAL_MERGE_TXNS pmt
2510: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id
2511: AND nvl(nvl(ael.merge_party_site_id, ael.party_site_id), -1)
2512: = nvl(p_old_site_id, -1)

Line 2551: FROM xla_ae_lines ael

2547: AND 'TRANSFER' = p_array_merge_option(i)
2548: AND merge_event_id is null
2549: AND ae_header_id in
2550: (SELECT ael.ae_header_id
2551: FROM xla_ae_lines ael
2552: ,XLA_PARTIAL_MERGE_TXNS pmt
2553: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id
2554: AND nvl(nvl(ael.merge_party_site_id, ael.party_site_id), -1)
2555: = nvl(p_old_site_id, -1)

Line 2592: FROM xla_ae_lines ael

2588: AND 'TRANSFER' = p_array_merge_option(i)
2589: AND merge_event_id is null
2590: AND ae_header_id in
2591: (SELECT ael.ae_header_id
2592: FROM xla_ae_lines ael
2593: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id
2594: AND nvl(nvl(ael.merge_party_site_id, ael.party_site_id), -1)
2595: = nvl(p_old_site_id, -1)
2596: and nvl(ael.party_type_code , p_party_type) = p_party_type

Line 2630: FROM xla_ae_lines ael

2626: AND 'TRANSFER' = p_array_merge_option(i)
2627: AND merge_event_id is null
2628: AND ae_header_id in
2629: (SELECT ael.ae_header_id
2630: FROM xla_ae_lines ael
2631: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id
2632: AND nvl(nvl(ael.merge_party_site_id, ael.party_site_id), -1)
2633: = nvl(p_old_site_id, -1)
2634: and nvl(ael.party_type_code , p_party_type) = p_party_type

Line 2708: INSERT INTO xla_ae_lines_gt

2704: , p_module => v_module);
2705: END IF;
2706:
2707: FORALL i in 1..p_array_ledger_id.count
2708: INSERT INTO xla_ae_lines_gt
2709: (ae_header_id
2710: ,temp_line_num
2711: ,event_id
2712: ,ref_ae_header_id

Line 2813: xla_ae_lines ael

2809: ,0 -- 5100860 assign value to avoid using function index
2810: ,decode(ael.control_balance_flag, 'Y', 'P', 'P', 'P', null)
2811: ,ael.encumbrance_type_id
2812: FROM
2813: xla_ae_lines ael
2814: ,xla_ae_headers aeh
2815: ,xla_distribution_links xdl
2816: ,fnd_currencies fcu
2817: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id

Line 2874: INSERT INTO xla_ae_lines_gt

2870: END IF;
2871:
2872:
2873: FORALL i in 1..p_array_ledger_id.count
2874: INSERT INTO xla_ae_lines_gt
2875: (ae_header_id
2876: ,temp_line_num
2877: ,event_id
2878: ,ref_ae_header_id

Line 2979: xla_ae_lines ael

2975: ,0 -- 5100860 assign value to avoid using function index
2976: ,decode(ael.control_balance_flag, 'Y', 'P', 'P', 'P', null)
2977: ,ael.encumbrance_type_id
2978: FROM
2979: xla_ae_lines ael
2980: ,xla_ae_headers aeh
2981: ,xla_distribution_links xdl
2982: ,fnd_currencies fcu
2983: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id

Line 3099: (select ledger_id from xla_ae_lines_gt);

3095: ,'Other'
3096: from dual
3097: where p_array_merge_option(i) = 'TRANSFER'
3098: AND p_array_ledger_id(i) in
3099: (select ledger_id from xla_ae_lines_gt);
3100:
3101: IF (C_LEVEL_STATEMENT>= g_log_level)
3102: THEN
3103: trace( p_msg => 'Header inserted'

Line 3108: UPDATE xla_ae_lines_gt xal

3104: , p_level => C_LEVEL_STATEMENT
3105: , p_module => v_module);
3106: END IF;
3107:
3108: UPDATE xla_ae_lines_gt xal
3109: set (ae_header_id, accounting_date) =(
3110: select ae_header_id, accounting_date
3111: from xla_ae_headers_gt xah
3112: where xah.ledger_id = xal.ledger_id);

Line 3182: INSERT INTO xla_ae_lines_gt

3178: , p_module => v_module);
3179: END IF;
3180:
3181: FORALL i in 1..p_array_ledger_id.count
3182: INSERT INTO xla_ae_lines_gt
3183: (ae_header_id
3184: ,temp_line_num
3185: ,event_id
3186: ,ref_ae_header_id

Line 3307: xla_ae_lines ael

3303: ,0 -- 5100860 assign value to avoid using function index
3304: ,decode(ael.control_balance_flag, 'Y', 'P', 'P', 'P', null)
3305: ,ael.encumbrance_type_id
3306: FROM
3307: xla_ae_lines ael
3308: ,xla_ae_headers aeh
3309: ,xla_distribution_links xdl
3310: ,fnd_currencies fcu
3311: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id

Line 3367: INSERT INTO xla_ae_lines_gt

3363: return 0;
3364: END IF;
3365:
3366: FORALL i in 1..p_array_ledger_id.count
3367: INSERT INTO xla_ae_lines_gt
3368: (ae_header_id
3369: ,temp_line_num
3370: ,event_id
3371: ,ref_ae_header_id

Line 3493: xla_ae_lines ael

3489: ,0 -- 5100860 assign value to avoid using function index
3490: ,decode(ael.control_balance_flag, 'Y', 'P', 'P', 'P', null)
3491: ,ael.encumbrance_type_id
3492: FROM
3493: xla_ae_lines ael
3494: ,xla_ae_headers aeh
3495: ,xla_distribution_links xdl
3496: ,fnd_currencies fcu
3497: WHERE nvl(ael.merge_party_id, ael.party_id) = p_old_party_id

Line 3739: UPDATE xla_ae_lines xal

3735: raise BalanceError;
3736: END IF;
3737:
3738: IF(p_accounting_mode <> 'D') THEN
3739: UPDATE xla_ae_lines xal
3740: SET (merge_party_id, merge_party_site_id, merge_code_combination_id)
3741: = (select party_id, party_site_id, code_combination_id
3742: from xla_ae_lines_gt xalg
3743: where xalg.ref_ae_header_id = xal.ae_header_id

Line 3742: from xla_ae_lines_gt xalg

3738: IF(p_accounting_mode <> 'D') THEN
3739: UPDATE xla_ae_lines xal
3740: SET (merge_party_id, merge_party_site_id, merge_code_combination_id)
3741: = (select party_id, party_site_id, code_combination_id
3742: from xla_ae_lines_gt xalg
3743: where xalg.ref_ae_header_id = xal.ae_header_id
3744: AND xalg.ref_ae_line_num = xal.ae_line_num
3745: AND xalg.reversal_code in ('REBOOKING', 'TRANSFER_BALANCE')
3746: and rownum = 1)

Line 3750: from xla_ae_lines_gt xlg

3746: and rownum = 1)
3747: WHERE xal.application_id = p_application_id
3748: AND (ae_header_id, ae_line_num) in
3749: (select xlg.ref_ae_header_id, xlg.ref_ae_line_num
3750: from xla_ae_lines_gt xlg
3751: ,xla_ae_headers xah
3752: where xlg.reversal_code in ('REBOOKING', 'TRANSFER_BALANCE')
3753: -- Bug 5103972 MPA / Reversal of incomplete JE
3754: -- should not be stamped with merge party informtion

Line 3948: FROM XLA_AE_LINES ael

3944: )
3945: )
3946: AND EXISTS
3947: (SELECT 'X'
3948: FROM XLA_AE_LINES ael
3949: WHERE ael.PARTY_ID = p_old_party_id
3950: AND ( p_old_site_id IS NULL
3951: OR ael.PARTY_SITE_ID = p_old_site_id)
3952: AND ael.PARTY_TYPE_CODE = p_party_type

Line 3994: FROM XLA_AE_LINES ael

3990: )
3991: )
3992: AND EXISTS
3993: (SELECT 'X'
3994: FROM XLA_AE_LINES ael
3995: WHERE ael.PARTY_ID = p_old_party_id
3996: AND ( p_old_site_id IS NULL
3997: OR ael.PARTY_SITE_ID = p_old_site_id)
3998: AND ael.PARTY_TYPE_CODE = p_party_type

Line 4040: UPDATE XLA_AE_LINES ael

4036: END IF;
4037:
4038: IF(p_merge_type = 'PARTIAL_MERGE') THEN
4039: FORALL i IN 1..p_array_ledger_id.count
4040: UPDATE XLA_AE_LINES ael
4041: SET PARTY_ID = p_new_party_id,
4042: PARTY_SITE_ID = NVL(p_new_site_id, PARTY_SITE_ID),
4043: DESCRIPTION
4044: = DECODE(DESCRIPTION

Line 4149: UPDATE XLA_AE_LINES ael

4145: END IF;
4146:
4147: ELSE
4148: FORALL i IN 1..p_array_ledger_id.count
4149: UPDATE XLA_AE_LINES ael
4150: SET PARTY_ID = p_new_party_id,
4151: PARTY_SITE_ID = NVL(p_new_site_id, PARTY_SITE_ID),
4152: DESCRIPTION
4153: = DECODE(DESCRIPTION

Line 4265: from xla_ae_lines_gt

4261: v_function VARCHAR2(240);
4262: v_module VARCHAR2(240);
4263: cursor c_null_ccid is
4264: select 1
4265: from xla_ae_lines_gt
4266: where code_combination_id is null;
4267: v_temp NUMBER;
4268: begin
4269: v_function := 'xla_third_party_merge.populate_ccid_to_gt';

Line 4280: update xla_ae_lines_gt xalg

4276: , p_level => C_LEVEL_PROCEDURE
4277: , p_module => v_module);
4278: END IF; -- IF (C_LEVEL_PROCEDURE >= g_log_level)
4279:
4280: update xla_ae_lines_gt xalg
4281: set code_combination_id =
4282: (select code_combination_id
4283: from gl_code_combinations gcc
4284: where gcc.chart_of_accounts_id = xalg.ccid_coa_id

Line 4325: update xla_ae_lines_gt temp

4321: , p_level => C_LEVEL_STATEMENT
4322: , p_module => v_module);
4323: END IF;
4324:
4325: update xla_ae_lines_gt temp
4326: SET code_combination_id =
4327: xla_ae_code_combination_pkg.GetCcid(
4328: temp.segment1
4329: ,temp.segment2

Line 4399: from xla_ae_lines_gt

4395: v_function VARCHAR2(240);
4396: v_module VARCHAR2(240);
4397: cursor c_null_ccid is
4398: select 1
4399: from xla_ae_lines_gt
4400: where code_combination_id is null;
4401: v_temp NUMBER;
4402: begin
4403: v_function := 'xla_third_party_merge.process_accounting_mapping';

Line 4414: update xla_ae_lines_gt xalg

4410: , p_level => C_LEVEL_PROCEDURE
4411: , p_module => v_module);
4412: END IF; -- IF (C_LEVEL_PROCEDURE >= g_log_level)
4413:
4414: update xla_ae_lines_gt xalg
4415: set ( code_combination_id
4416: ,ccid_coa_id
4417: ,segment1
4418: ,segment2

Line 4596: -- private procedure, populate xla_ae_lines_gt table

4592:
4593: END process_accounting_mapping;
4594:
4595:
4596: -- private procedure, populate xla_ae_lines_gt table
4597: -- for the purpose of account mapping
4598: FUNCTION populate_gt_for_mapping(
4599: p_application_id IN NUMBER
4600: ,p_event_id IN NUMBER

Line 4631: INSERT INTO xla_ae_lines_gt (

4627:
4628:
4629: IF(p_merge_type = 'PARTIAL_MERGE') THEN
4630: FORALL i IN 1..p_array_ledger_id.count
4631: INSERT INTO xla_ae_lines_gt (
4632: ae_header_id
4633: ,ae_line_num
4634: ,temp_line_num
4635: ,inherit_desc_flag

Line 4711: ,xla_ae_lines ael

4707: ,decode(segment_code, 'SEGMENT29', to_value, gcc.segment29)
4708: ,decode(segment_code, 'SEGMENT30', to_value, gcc.segment30)
4709: FROM xla_merge_seg_maps map
4710: ,gl_code_combinations gcc
4711: ,xla_ae_lines ael
4712: ,xla_ae_headers aeh
4713: ,XLA_PARTIAL_MERGE_TXNS xpmt
4714: ,XLA_LEDGER_RELATIONSHIPS_V rs
4715: ,gl_ledgers gld

Line 4781: INSERT INTO xla_ae_lines_gt (

4777: END IF;
4778: ELSE
4779:
4780: FORALL i IN 1..p_array_ledger_id.count
4781: INSERT INTO xla_ae_lines_gt (
4782: ae_header_id
4783: ,ae_line_num
4784: ,temp_line_num
4785: ,inherit_desc_flag

Line 4861: ,xla_ae_lines ael

4857: ,decode(segment_code, 'SEGMENT29', to_value, gcc.segment29)
4858: ,decode(segment_code, 'SEGMENT30', to_value, gcc.segment30)
4859: FROM xla_merge_seg_maps map
4860: ,gl_code_combinations gcc
4861: ,xla_ae_lines ael
4862: ,xla_ae_headers aeh
4863: ,XLA_LEDGER_RELATIONSHIPS_V rs
4864: ,gl_ledgers gld
4865: WHERE ael.PARTY_ID = p_old_party_id

Line 4952: from xla_ae_lines_gt

4948: v_function VARCHAR2(240);
4949: v_module VARCHAR2(240);
4950: cursor c_null_ccid is
4951: select 1
4952: from xla_ae_lines_gt
4953: where code_combination_id is null;
4954: v_row_count NUMBER;
4955: begin
4956: v_function := 'xla_third_party_merge.process_incomplete_acct_map';

Line 5007: FROM xla_ae_lines_gt xalg

5003:
5004: UPDATE
5005: (SELECT xalg.code_combination_id
5006: , xal.code_combination_id code_combination_id1
5007: FROM xla_ae_lines_gt xalg
5008: , xla_ae_lines xal
5009: WHERE xalg.ae_header_id = xal.ae_header_id
5010: AND xalg.ae_line_num = xal.ae_line_num
5011: AND xal.application_id = p_application_id

Line 5008: , xla_ae_lines xal

5004: UPDATE
5005: (SELECT xalg.code_combination_id
5006: , xal.code_combination_id code_combination_id1
5007: FROM xla_ae_lines_gt xalg
5008: , xla_ae_lines xal
5009: WHERE xalg.ae_header_id = xal.ae_header_id
5010: AND xalg.ae_line_num = xal.ae_line_num
5011: AND xal.application_id = p_application_id
5012: AND xalg.temp_line_num = xal.ae_line_num

Line 5076: -- to be stamped on xla_ae_lines_gt

5072: , amb_context_code
5073: , budget_version_id
5074: -- 5103972
5075: -- Used at the end of this procedure to find ae header ids
5076: -- to be stamped on xla_ae_lines_gt
5077: , parent_header_id
5078: )
5079: (select xla_ae_headers_s.nextval
5080: ,p_accounting_mode

Line 5108: ,xla_ae_lines_gt xal

5104: , xah.balance_type_code
5105: , xal.ae_header_id
5106: , xal.ref_ae_header_id -- 5103972
5107: from xla_ae_headers xah
5108: ,xla_ae_lines_gt xal
5109: where xah.application_id = p_application_id
5110: and xah.ae_header_id =xal.ref_ae_header_id
5111: and xal.reversal_code = 'REBOOKING'));
5112:

Line 5151: UPDATE xla_ae_lines_gt xal

5147: , p_level => C_LEVEL_STATEMENT
5148: , p_module => v_module);
5149: END IF;
5150:
5151: UPDATE xla_ae_lines_gt xal
5152: SET (ae_header_id, accounting_date) =
5153: (SELECT ae_header_id, accounting_date
5154: FROM xla_ae_headers_gt xah
5155: WHERE xal.event_id = xah.event_id

Line 6194: DELETE FROM xla_ae_lines

6190: ,p_level => C_LEVEL_STATEMENT
6191: ,p_module => l_log_module);
6192: END IF;
6193:
6194: DELETE FROM xla_ae_lines
6195: WHERE application_id = p_application_id
6196: AND ae_header_id IN
6197: (SELECT ae_header_id FROM xla_ae_headers
6198: WHERE application_id = p_application_id