DBA Data[Home] [Help]

APPS.XLA_AE_LINES_PKG dependencies on XLA_AE_LINES

Line 1: PACKAGE BODY xla_ae_lines_pkg AS

1: PACKAGE BODY xla_ae_lines_pkg AS
2: /* $Header: xlajelns.pkb 120.197.12010000.7 2008/11/13 10:00:46 shrakuma ship $ */
3: /*===========================================================================+
4: | Copyright (c) 2001-2002 Oracle Corporation |
5: | Redwood Shores, CA, USA |

Line 9: | XLA_AE_LINES_PKG |

5: | Redwood Shores, CA, USA |
6: | All rights reserved. |
7: +============================================================================+
8: | PACKAGE NAME |
9: | XLA_AE_LINES_PKG |
10: | |
11: | DESCRIPTION |
12: | |
13: | |

Line 27: | xla_ae_lines_gt, xla_je_headers_gt by |

23: | 03-APR-2003 K.Boussema Included Analytical criteria feature |
24: | 19-APR-2003 K.Boussema Included Error messages |
25: | 06-MAI-2003 K.Boussema Modified to fix bug 2936066(Unbalanced JE) |
26: | 13-MAI-2003 K.Boussema Renamed temporary tables xla_je_lines_gt by |
27: | xla_ae_lines_gt, xla_je_headers_gt by |
28: | xla_ae_headers_gt |
29: | Renamed in xla_distribution_links the column |
30: | base_amount by ledger_amount |
31: | 20-MAI-2003 K.Boussema Added a Token to XLA_AP_CANNOT_INSERT_JE |

Line 65: | 12-DEC-2003 K.Boussema Renamed target_coa_id in xla_ae_lines_gt |

61: | and LineReversal_2. |
62: | Merged procedures TransactionReversal and |
63: | TransactionReversal_2. |
64: | 05-DEC-2003 K.Boussema Changed the code to fix bug3289875 |
65: | 12-DEC-2003 K.Boussema Renamed target_coa_id in xla_ae_lines_gt |
66: | by ccid_coa_id |
67: | 18-DEC-2003 K.Boussema Changed to fix bug 3042840,3307761,3268940 |
68: | 3310291 and 3320689 |
69: | 07-JAN-2003 K.Boussema Changed to populate switch_side_flag column |

Line 115: | from xla_ae_lines table. |

111: | AccountingReversal. |
112: | Also modified the insert statments in |
113: | AccountingRevesal to use amounts from |
114: | xla_distribution_links instead of amounts |
115: | from xla_ae_lines table. |
116: | 09-MAR-2005 W.Shen Ledger Currency Project. |
117: | 14-Mar-2005 K.Boussema Changed for ADR-enhancements. |
118: | 28-Mar-2005 A.Wan Changed for Business Flow. |
119: | 20-Apr-2005 W. Shen replace column document_rounding_amount by |

Line 180: | xla_ae_lines_gt |

176: | ae_lines_gt detail for bflow entries|
177: | for MPA and Accrual Reversal lines. |
178: | 10-Feb-2006 A.Wan 5019460 - could not reverse prior entries. |
179: | 13-Feb-2006 V.Kumar 4955764 Populating Accounting_date in |
180: | xla_ae_lines_gt |
181: | 14-Feb-2006 A.Wan 4967526 - copy following for Third Party info |
182: | in BusinessFlowPriorEntries: |
183: | - merge_code_combination_id |
184: | - merge_party_id |

Line 227: | 14-Dec-2007 V.Swapna 6648062 - Populate xla_ae_lines_gt with |

223: | if there are no MPA in this run. |
224: | 26-jan-2007 A.Wan 5845547 - upgrade fail for not upgraded bflow |
225: | and reversal transactions. Add |
226: | upgrade party attributes. |
227: | 14-Dec-2007 V.Swapna 6648062 - Populate xla_ae_lines_gt with |
228: | the values passed in override acctd |
229: | amts accounting attribute and use |
230: | it in business flow procedure |
231: | 31-Dec-2007 V. Swapna 5339999 - Changes to BusinessFlowPriorEntries |

Line 473: C_DEFAULT_MODULE CONSTANT VARCHAR2(240) := 'xla.plsql.XLA_AE_LINES_PKG';

469: C_LEVEL_ERROR CONSTANT NUMBER := FND_LOG.LEVEL_ERROR;
470: C_LEVEL_UNEXPECTED CONSTANT NUMBER := FND_LOG.LEVEL_UNEXPECTED;
471:
472: C_LEVEL_LOG_DISABLED CONSTANT NUMBER := 99;
473: C_DEFAULT_MODULE CONSTANT VARCHAR2(240) := 'xla.plsql.XLA_AE_LINES_PKG';
474:
475: g_log_level NUMBER;
476: g_log_enabled BOOLEAN;
477:

Line 494: (p_location => 'XLA_AE_LINES_PKG.trace');

490: WHEN xla_exceptions_pkg.application_exception THEN
491: RAISE;
492: WHEN OTHERS THEN
493: xla_exceptions_pkg.raise_message
494: (p_location => 'XLA_AE_LINES_PKG.trace');
495: END trace;
496:
497: --=============================================================================
498: -- ******* Print Log File **********

Line 510: (p_location => 'xla_ae_lines_pkg.print_logfile');

506: WHEN xla_exceptions_pkg.application_exception THEN
507: RAISE;
508: WHEN OTHERS THEN
509: xla_exceptions_pkg.raise_message
510: (p_location => 'xla_ae_lines_pkg.print_logfile');
511: END print_logfile;
512: --
513: --====================================================================
514: --

Line 707: (p_location => 'xla_ae_lines_pkg.ValidateLinks');

703: WHEN xla_exceptions_pkg.application_exception THEN
704: RAISE;
705: WHEN OTHERS THEN
706: xla_exceptions_pkg.raise_message
707: (p_location => 'xla_ae_lines_pkg.ValidateLinks');
708: --
709: END ValidateLinks;
710: --
711: --

Line 969: (p_location => 'XLA_AE_LINES_PKG.SetDebitCreditAmounts');

965: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
966: RAISE;
967: WHEN OTHERS THEN
968: xla_exceptions_pkg.raise_message
969: (p_location => 'XLA_AE_LINES_PKG.SetDebitCreditAmounts');
970: --
971: END SetDebitCreditAmounts;
972: --
973: --====================================================================

Line 1047: (p_location => 'XLA_AE_LINES_PKG.InitLines');

1043: WHEN xla_exceptions_pkg.application_exception THEN
1044: RAISE;
1045: WHEN OTHERS THEN
1046: xla_exceptions_pkg.raise_message
1047: (p_location => 'XLA_AE_LINES_PKG.InitLines');
1048: --
1049: END InitLines;
1050: --
1051: --

Line 1101: (p_location => 'XLA_AE_LINES_PKG.SetExtractLine');

1097: g_ExtractLine := null;
1098: RAISE;
1099: WHEN OTHERS THEN
1100: xla_exceptions_pkg.raise_message
1101: (p_location => 'XLA_AE_LINES_PKG.SetExtractLine');
1102: --
1103: END SetExtractLine;
1104: --
1105: /*======================================================================+

Line 1542: (p_location => 'XLA_AE_LINES_PKG.SetNullLine');

1538: WHEN xla_exceptions_pkg.application_exception THEN
1539: RAISE;
1540: WHEN OTHERS THEN
1541: xla_exceptions_pkg.raise_message
1542: (p_location => 'XLA_AE_LINES_PKG.SetNullLine');
1543: --
1544: END SetNullLine;
1545: --
1546: /*======================================================================+

Line 1575: -- insert headers into xla_ae_lines_gt table

1571: g_rec_lines := g_null_lines;
1572:
1573: ELSIF g_LineNumber = C_BULK_LIMIT THEN
1574: --
1575: -- insert headers into xla_ae_lines_gt table
1576: --
1577: l_result := xla_ae_lines_pkg.InsertLines;
1578: g_LineNumber := 0;
1579: g_rec_lines := g_null_lines;

Line 1577: l_result := xla_ae_lines_pkg.InsertLines;

1573: ELSIF g_LineNumber = C_BULK_LIMIT THEN
1574: --
1575: -- insert headers into xla_ae_lines_gt table
1576: --
1577: l_result := xla_ae_lines_pkg.InsertLines;
1578: g_LineNumber := 0;
1579: g_rec_lines := g_null_lines;
1580:
1581: END IF;

Line 1607: (p_location => 'XLA_AE_LINES_PKG.SetNewLine');

1603: WHEN xla_exceptions_pkg.application_exception THEN
1604: RAISE;
1605: WHEN OTHERS THEN
1606: xla_exceptions_pkg.raise_message
1607: (p_location => 'XLA_AE_LINES_PKG.SetNewLine');
1608: --
1609: END SetNewLine;
1610: --
1611: --

Line 1693: (p_location => 'XLA_AE_LINES_PKG.SetAcctLineType');

1689: WHEN xla_exceptions_pkg.application_exception THEN
1690: RAISE;
1691: WHEN OTHERS THEN
1692: xla_exceptions_pkg.raise_message
1693: (p_location => 'XLA_AE_LINES_PKG.SetAcctLineType');
1694: --
1695: END SetAcctLineType;
1696:
1697: /*======================================================================+

Line 1772: (p_location => 'XLA_AE_LINES_PKG.SetAcctLineOption');

1768: WHEN xla_exceptions_pkg.application_exception THEN
1769: RAISE;
1770: WHEN OTHERS THEN
1771: xla_exceptions_pkg.raise_message
1772: (p_location => 'XLA_AE_LINES_PKG.SetAcctLineOption');
1773: --
1774: END SetAcctLineOption;
1775: --
1776: /*======================================================================+

Line 1816: (p_location => 'XLA_AE_LINES_PKG.SetLineDescription');

1812: WHEN xla_exceptions_pkg.application_exception THEN
1813: RAISE;
1814: WHEN OTHERS THEN
1815: xla_exceptions_pkg.raise_message
1816: (p_location => 'XLA_AE_LINES_PKG.SetLineDescription');
1817: --
1818: END SetLineDescription;
1819: --
1820: --

Line 2125: (p_location => 'XLA_AE_LINES_PKG.set_ccid');

2121: ,p_level => C_LEVEL_PROCEDURE
2122: ,p_module => l_log_module);
2123: END IF;
2124: xla_exceptions_pkg.raise_message
2125: (p_location => 'XLA_AE_LINES_PKG.set_ccid');
2126: END set_ccid;
2127:
2128: /*=========================================================================+
2129: | |

Line 2765: (p_location => 'XLA_AE_LINES_PKG.set_segment');

2761: ,p_level => C_LEVEL_PROCEDURE
2762: ,p_module => l_log_module);
2763: END IF;
2764: xla_exceptions_pkg.raise_message
2765: (p_location => 'XLA_AE_LINES_PKG.set_segment');
2766: END set_segment;
2767:
2768: --
2769: /*======================================================================+

Line 2815: (p_location => 'XLA_AE_LINES_PKG.ValidateCurrentLine');

2811: WHEN xla_exceptions_pkg.application_exception THEN
2812: RAISE;
2813: WHEN OTHERS THEN
2814: xla_exceptions_pkg.raise_message
2815: (p_location => 'XLA_AE_LINES_PKG.ValidateCurrentLine');
2816: --
2817: END ValidateCurrentLine;
2818: --
2819: /*======================================================================+

Line 2860: (p_location => 'XLA_AE_LINES_PKG.SetAcctClass');

2856: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
2857: RAISE;
2858: WHEN OTHERS THEN
2859: xla_exceptions_pkg.raise_message
2860: (p_location => 'XLA_AE_LINES_PKG.SetAcctClass');
2861: END SetAcctClass;
2862: --
2863:
2864: /*======================================================================+

Line 2964: (p_location => 'XLA_AE_LINES_PKG.SetAnalyticalCriteria');

2960: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
2961: RAISE;
2962: WHEN OTHERS THEN
2963: xla_exceptions_pkg.raise_message
2964: (p_location => 'XLA_AE_LINES_PKG.SetAnalyticalCriteria');
2965: --
2966: END SetAnalyticalCriteria;
2967:
2968:

Line 3005: (p_msg => '# temporary journal lines to insert into GT xla_ae_lines_gt = '||g_rec_lines.array_line_num.COUNT

3001: l_result :=TRUE;
3002:
3003: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
3004: trace
3005: (p_msg => '# temporary journal lines to insert into GT xla_ae_lines_gt = '||g_rec_lines.array_line_num.COUNT
3006: ,p_level => C_LEVEL_STATEMENT
3007: ,p_module => l_log_module);
3008: END IF;
3009:

Line 3044: (p_msg => 'SQL - Insert into xla_ae_lines_gt'

3040: END IF;
3041:
3042: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
3043: trace
3044: (p_msg => 'SQL - Insert into xla_ae_lines_gt'
3045: ,p_level => C_LEVEL_STATEMENT
3046: ,p_module => l_log_module);
3047: END IF;
3048:

Line 3052: INSERT INTO xla_ae_lines_gt

3048:
3049: ------------------------------------------------------------------------------------------------------
3050:
3051: FORALL Idx IN g_rec_lines.array_line_num.FIRST .. g_rec_lines.array_line_num.LAST SAVE EXCEPTIONS --7453943
3052: INSERT INTO xla_ae_lines_gt
3053: ( ae_header_id
3054: , temp_line_num
3055: , extract_line_num
3056: , event_id

Line 3726: (p_msg => '# temporary journal lines inserted into GT xla_ae_lines_gt = '||TO_CHAR(l_rowcount)

3722: l_result := ( l_rowcount> 0);
3723:
3724: IF (C_LEVEL_EVENT >= g_log_level) THEN
3725: trace
3726: (p_msg => '# temporary journal lines inserted into GT xla_ae_lines_gt = '||TO_CHAR(l_rowcount)
3727: ,p_level => C_LEVEL_EVENT
3728: ,p_module => l_log_module);
3729: END IF;
3730:

Line 3824: (p_location => 'XLA_AE_LINES_PKG.InsertLines');

3820: ,p_level => C_LEVEL_PROCEDURE
3821: ,p_module => l_log_module);
3822: END IF;
3823: xla_exceptions_pkg.raise_message
3824: (p_location => 'XLA_AE_LINES_PKG.InsertLines');
3825: END InsertLines;
3826: --
3827: /*======================================================================+
3828: | |

Line 3871: (p_location => 'XLA_AE_LINES_PKG.RefreshLines');

3867: WHEN xla_exceptions_pkg.application_exception THEN
3868: RAISE;
3869: WHEN OTHERS THEN
3870: xla_exceptions_pkg.raise_message
3871: (p_location => 'XLA_AE_LINES_PKG.RefreshLines');
3872: END RefreshLines;
3873: --
3874: --
3875: --====================================================================

Line 4097: (p_location => 'xla_ae_lines_pkg.ValidateRevLinks');

4093: WHEN xla_exceptions_pkg.application_exception THEN
4094: RAISE;
4095: WHEN OTHERS THEN
4096: xla_exceptions_pkg.raise_message
4097: (p_location => 'xla_ae_lines_pkg.ValidateRevLinks');
4098: --
4099: END ValidateRevLinks;
4100: --
4101: /*======================================================================+

Line 4242: -- selecting all the dummy lines from xla_ae_lines_gt that are due to

4238: --***************************************************************************************************************
4239: --***************************************************************************************************************
4240:
4241: --
4242: -- selecting all the dummy lines from xla_ae_lines_gt that are due to
4243: -- line level reversal option
4244: --
4245: SELECT event_id
4246: ,ledger_id

Line 4308: FROM xla_ae_lines_gt

4304: ,l_array_gl_date -- 5189664
4305: ,l_array_tax_line_ref -- 7159711
4306: ,l_array_tax_summary_line_ref -- 7159711
4307: ,l_array_tax_rec_nrec_dist_ref -- 7159711
4308: FROM xla_ae_lines_gt
4309: WHERE reversal_code = 'DUMMY_LR'
4310: ORDER by entity_id, event_number;
4311:
4312: IF (C_LEVEL_STATEMENT >= g_log_level) THEN

Line 4324: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)

4320: -- 4669308 Delete the MPA/Accrual Line Reversal (still in GT ables, not in distribution links yet)
4321: --=======================================================================================================
4322: --
4323: ---------------------------------------------------------------------------------------------------------
4324: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)
4325: ---------------------------------------------------------------------------------------------------------
4326: --
4327: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
4328: -- Modify for performance bug 5086984

Line 4330: SELECT /*+ Leading(HGT) cardinality(hgt 1) index(lgt XLA_AE_LINES_GT_U1) */

4326: --
4327: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
4328: -- Modify for performance bug 5086984
4329: FOR i IN 1..l_array_entity_id.count LOOP
4330: SELECT /*+ Leading(HGT) cardinality(hgt 1) index(lgt XLA_AE_LINES_GT_U1) */
4331: lgt.ledger_id
4332: ,lgt.event_id
4333: ,lgt.ref_ae_header_id
4334: ,lgt.temp_line_num

Line 4346: FROM xla_ae_lines_gt lgt

4342: ,l_array_mpa_acc_temp_line_num
4343: ,l_array_mpa_acc_ae_header_id
4344: ,l_array_mpa_acc_header_num
4345: ,l_array_mpa_acc_balance_type
4346: FROM xla_ae_lines_gt lgt
4347: ,xla_ae_headers_gt hgt
4348: WHERE l_array_ledger_id(i) = lgt.ledger_id
4349: AND l_array_rev_dist_type(i) = lgt.source_distribution_type
4350: AND nvl(l_array_rev_dist_id_num_1(i),-99) = nvl(lgt.source_distribution_id_num_1,-99)

Line 4373: FROM xla_ae_lines_gt

4369: AND hgt.event_number < l_array_event_number(i);
4370: /* 5412560 replaced
4371: AND NOT EXISTS ( -- the lines already reversed are not reversed again
4372: SELECT 1
4373: FROM xla_ae_lines_gt
4374: WHERE ledger_id = lgt.ledger_id
4375: AND ref_ae_header_id = lgt.ref_ae_header_id
4376: AND temp_line_num = lgt.temp_line_num * -1)
4377: AND NVL(lgt.header_num,0) > 0

Line 4404: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)

4400: end loop;
4401: END IF;
4402:
4403: ---------------------------------------------------------------------------------------------------------
4404: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)
4405: ---------------------------------------------------------------------------------------------------------
4406: FORALL j IN 1..l_array_mpa_acc_ae_header_id.count
4407: DELETE xla_ae_lines_gt
4408: WHERE ledger_id = l_array_mpa_acc_ledger_id(j)

Line 4407: DELETE xla_ae_lines_gt

4403: ---------------------------------------------------------------------------------------------------------
4404: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)
4405: ---------------------------------------------------------------------------------------------------------
4406: FORALL j IN 1..l_array_mpa_acc_ae_header_id.count
4407: DELETE xla_ae_lines_gt
4408: WHERE ledger_id = l_array_mpa_acc_ledger_id(j)
4409: AND ref_ae_header_id = l_array_mpa_acc_ref_ae_header(j)
4410: AND temp_line_num = l_array_mpa_acc_temp_line_num(j)
4411: AND ae_header_id = l_array_mpa_acc_ae_header_id(j)

Line 4431: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)

4427: END IF; -- xla_accounting_pkg.g_mpa_accrual_exists = 'Y'
4428: -------------------------------------------------------------------------------------------------------------------------
4429:
4430: --
4431: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
4432: --
4433: INSERT INTO xla_ae_lines_gt
4434: (ae_header_id
4435: ,temp_line_num

Line 4433: INSERT INTO xla_ae_lines_gt

4429:
4430: --
4431: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
4432: --
4433: INSERT INTO xla_ae_lines_gt
4434: (ae_header_id
4435: ,temp_line_num
4436: ,event_id
4437: ,ref_ae_header_id

Line 5422: xla_ae_lines_gt lgt1

5418: , lgt2.anc_id_98
5419: , lgt2.anc_id_99
5420: , lgt2.anc_id_100
5421: FROM
5422: xla_ae_lines_gt lgt1
5423: ,xla_ae_lines_gt lgt2
5424: ,xla_ae_headers_gt hgt
5425: WHERE lgt1.reversal_code = 'DUMMY_LR'
5426: AND lgt2.ledger_id = lgt1.ledger_id

Line 5423: ,xla_ae_lines_gt lgt2

5419: , lgt2.anc_id_99
5420: , lgt2.anc_id_100
5421: FROM
5422: xla_ae_lines_gt lgt1
5423: ,xla_ae_lines_gt lgt2
5424: ,xla_ae_headers_gt hgt
5425: WHERE lgt1.reversal_code = 'DUMMY_LR'
5426: AND lgt2.ledger_id = lgt1.ledger_id
5427: AND lgt2.source_distribution_type = lgt1.reverse_distribution_type

Line 5444: AND hgt.header_num = lgt2.header_num-- 4262811c Line Reversal (xla_ae_lines_gt_u1 error)

5440: AND hgt.balance_type_code = lgt2.balance_type_code
5441: AND hgt.entity_id = lgt1.entity_id
5442: -- lines for events with event number > current event number are not reversed.
5443: AND hgt.event_number < lgt1.event_number
5444: AND hgt.header_num = lgt2.header_num-- 4262811c Line Reversal (xla_ae_lines_gt_u1 error)
5445: AND hgt.ae_header_id = lgt2.ae_header_id
5446: )
5447: WHERE rn = 1
5448: );

Line 5453: (p_msg => 'Line Reversal - Reversal lines created from xla_ae_lines_gt = '||SQL%ROWCOUNT

5449:
5450:
5451: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
5452: trace
5453: (p_msg => 'Line Reversal - Reversal lines created from xla_ae_lines_gt = '||SQL%ROWCOUNT
5454: ,p_level => C_LEVEL_STATEMENT
5455: ,p_module => l_log_module);
5456: END IF;
5457:

Line 5472: xla_ae_lines_gt lgt

5468: g_incomplete_mpa_acc_LR.l_array_ae_header_id
5469: ,g_incomplete_mpa_acc_LR.l_array_ae_line_num
5470: ,g_incomplete_mpa_acc_LR.l_array_parent_ae_header
5471: FROM
5472: xla_ae_lines_gt lgt
5473: ,xla_ae_lines ael
5474: ,xla_ae_headers aeh
5475: ,xla_distribution_links xdl
5476: WHERE xdl.application_id = l_application_id

Line 5473: ,xla_ae_lines ael

5469: ,g_incomplete_mpa_acc_LR.l_array_ae_line_num
5470: ,g_incomplete_mpa_acc_LR.l_array_parent_ae_header
5471: FROM
5472: xla_ae_lines_gt lgt
5473: ,xla_ae_lines ael
5474: ,xla_ae_headers aeh
5475: ,xla_distribution_links xdl
5476: WHERE xdl.application_id = l_application_id
5477: AND xdl.source_distribution_type = lgt.reverse_distribution_type

Line 5517: -- Reverse the lines in xla_ae_lines table

5513: -------------------------------------------------------------------------------------------
5514:
5515: --
5516: ---------------------------------------------------------------------------------------------------------
5517: -- Reverse the lines in xla_ae_lines table
5518: --
5519: -- Some for 4669308:
5520: -- For MPA entries, only reverse what is necessary , ie create reversal for Complete MPA only.
5521: -- Do not create reversal for incomplete entry (since it will get deleted anyway).

Line 5526: INSERT INTO xla_ae_lines_gt

5522: -- Also, since the redundant lines will affect ROUNDING calculation.
5523: -- Need to create reversal in Draft mode also (so can be viewed).
5524: ---------------------------------------------------------------------------------------------------------
5525: --
5526: INSERT INTO xla_ae_lines_gt
5527: (ae_header_id
5528: ,temp_line_num
5529: ,event_id
5530: ,ref_ae_header_id

Line 5917: xla_ae_lines_gt lgt

5913: ,decode(ael.analytical_balance_flag, 'Y','P',
5914: 'P','Y',
5915: null) analytical_balance_flag -- Bug 7382288
5916: FROM
5917: xla_ae_lines_gt lgt
5918: ,xla_distribution_links xdl
5919: ,xla_ae_lines ael
5920: ,xla_ae_headers aeh
5921: ,fnd_currencies fcu

Line 5919: ,xla_ae_lines ael

5915: null) analytical_balance_flag -- Bug 7382288
5916: FROM
5917: xla_ae_lines_gt lgt
5918: ,xla_distribution_links xdl
5919: ,xla_ae_lines ael
5920: ,xla_ae_headers aeh
5921: ,fnd_currencies fcu
5922: ,xla_events evt
5923: WHERE lgt.reversal_code = 'DUMMY_LR'

Line 5970: (p_msg => 'Line Reversal - Reversal lines created from xla_ae_lines = '||SQL%ROWCOUNT

5966: );
5967:
5968: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
5969: trace
5970: (p_msg => 'Line Reversal - Reversal lines created from xla_ae_lines = '||SQL%ROWCOUNT
5971: ,p_level => C_LEVEL_STATEMENT
5972: ,p_module => l_log_module);
5973: END IF;
5974:

Line 6045: FROM xla_ae_lines_gt gt1, xla_ae_headers

6041:
6042:
6043: SELECT min(xla_ae_headers.accounting_date)
6044: INTO l_min_ref_event_date
6045: FROM xla_ae_lines_gt gt1, xla_ae_headers
6046: WHERE gt1.reversal_code = 'REVERSAL'
6047: AND gt1.ref_event_id = xla_ae_headers.event_id;
6048:
6049:

Line 6079: FROM xla_ae_lines_gt gt1, gl_ledgers gll

6075:
6076:
6077: FOR c_not_reversed_entries IN
6078: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
6079: FROM xla_ae_lines_gt gt1, gl_ledgers gll
6080: WHERE gt1.reversal_code = 'DUMMY_LR'
6081: AND gll.ledger_id = gt1.ledger_id
6082: AND gll.ledger_category_code <> 'PRIMARY'
6083: AND NOT EXISTS (SELECT 1

Line 6084: FROM xla_ae_lines_gt gt2

6080: WHERE gt1.reversal_code = 'DUMMY_LR'
6081: AND gll.ledger_id = gt1.ledger_id
6082: AND gll.ledger_category_code <> 'PRIMARY'
6083: AND NOT EXISTS (SELECT 1
6084: FROM xla_ae_lines_gt gt2
6085: WHERE gt2.reversal_code = 'REVERSAL'
6086: AND gt1.event_id = gt2.event_id
6087: AND gt1.ledger_id = gt2.ledger_id)
6088: AND EXISTS (SELECT 1

Line 6089: FROM xla_ae_lines_gt gt3

6085: WHERE gt2.reversal_code = 'REVERSAL'
6086: AND gt1.event_id = gt2.event_id
6087: AND gt1.ledger_id = gt2.ledger_id)
6088: AND EXISTS (SELECT 1
6089: FROM xla_ae_lines_gt gt3
6090: WHERE gt3.reversal_code = 'REVERSAL'
6091: AND gt1.event_id = gt3.event_id))
6092:
6093: LOOP

Line 6137: -- selecting all the dummy lines from xla_ae_lines_gt that are due to

6133: --***************************************************************************************************************
6134: --***************************************************************************************************************
6135:
6136: --
6137: -- selecting all the dummy lines from xla_ae_lines_gt that are due to
6138: -- transaction level reversal option
6139: --
6140: SELECT event_id
6141: ,ledger_id

Line 6181: FROM xla_ae_lines_gt

6177: ,l_array_gl_date -- 5189664
6178: ,l_array_tax_line_ref -- 7226263
6179: ,l_array_tax_summary_line_ref -- 7226263
6180: ,l_array_tax_rec_nrec_dist_ref -- 7226263
6181: FROM xla_ae_lines_gt
6182: WHERE reversal_code = 'DUMMY_TR'
6183: ORDER by entity_id, event_number;
6184:
6185: IF (C_LEVEL_STATEMENT >= g_log_level) THEN

Line 6197: -- 4669308 Delete the MPA/Accrual Transaction Reversal in xla_ae_lines_gt (not in distribution links yet)

6193: -- 4669308 Delete the MPA/Accrual Transaction Reversal (still in GT tables, not in distribution links yet)
6194: --=======================================================================================================
6195: --
6196: ---------------------------------------------------------------------------------------------------------
6197: -- 4669308 Delete the MPA/Accrual Transaction Reversal in xla_ae_lines_gt (not in distribution links yet)
6198: ---------------------------------------------------------------------------------------------------------
6199: --
6200: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
6201: FORALL i IN 1..l_array_entity_id.count

Line 6202: DELETE xla_ae_lines_gt lgt

6198: ---------------------------------------------------------------------------------------------------------
6199: --
6200: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
6201: FORALL i IN 1..l_array_entity_id.count
6202: DELETE xla_ae_lines_gt lgt
6203: WHERE l_array_ledger_id(i) = lgt.ledger_id
6204: AND lgt.reversal_code IS NULL -- the lines created from reversal are not reversed again
6205: AND NOT EXISTS ( -- the lines already reversed are not reversed again
6206: SELECT 1

Line 6207: FROM xla_ae_lines_gt

6203: WHERE l_array_ledger_id(i) = lgt.ledger_id
6204: AND lgt.reversal_code IS NULL -- the lines created from reversal are not reversed again
6205: AND NOT EXISTS ( -- the lines already reversed are not reversed again
6206: SELECT 1
6207: FROM xla_ae_lines_gt
6208: WHERE ledger_id = lgt.ledger_id
6209: AND ref_ae_header_id = lgt.ae_header_id -- 5499367 lgt.ref_ae_header_id
6210: AND temp_line_num = lgt.temp_line_num * -1
6211: )

Line 6241: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)

6237: ---------------------------------------------------------------------------------------------------------
6238:
6239:
6240: --
6241: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
6242: --
6243: FORALL i IN 1..l_array_event_id.count
6244: INSERT INTO xla_ae_lines_gt
6245: (ae_header_id

Line 6244: INSERT INTO xla_ae_lines_gt

6240: --
6241: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
6242: --
6243: FORALL i IN 1..l_array_event_id.count
6244: INSERT INTO xla_ae_lines_gt
6245: (ae_header_id
6246: ,temp_line_num
6247: ,event_id
6248: ,ref_ae_header_id

Line 6768: FROM xla_ae_lines_gt lgt

6764: , lgt.alloc_to_dist_id_num_2 alloc_to_dist_id_num_2
6765: , lgt.alloc_to_dist_id_num_3 alloc_to_dist_id_num_3
6766: , lgt.alloc_to_dist_id_num_4 alloc_to_dist_id_num_4
6767: , lgt.alloc_to_dist_id_num_5 alloc_to_dist_id_num_5
6768: FROM xla_ae_lines_gt lgt
6769: ,xla_ae_headers_gt hgt
6770: WHERE hgt.entity_id = l_array_entity_id(i)
6771: AND hgt.ledger_id = l_array_ledger_id(i)
6772: AND hgt.event_number < l_array_event_number(i)

Line 6781: FROM xla_ae_lines_gt

6777: AND lgt.reversal_code IS NULL
6778: -- lines that are reversed earlier are not reversed again
6779: AND NOT EXISTS (
6780: SELECT 1
6781: FROM xla_ae_lines_gt
6782: WHERE ledger_id = lgt.ledger_id
6783: AND ref_ae_header_id = lgt.ae_header_id -- 5499367 lgt.ref_ae_header_id
6784: AND temp_line_num = lgt.temp_line_num * -1
6785: )

Line 6791: (p_msg => 'Transaction Reversal - Reversal lines created from xla_ae_lines_gt = '||SQL%ROWCOUNT

6787: ;
6788:
6789: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
6790: trace
6791: (p_msg => 'Transaction Reversal - Reversal lines created from xla_ae_lines_gt = '||SQL%ROWCOUNT
6792: ,p_level => C_LEVEL_STATEMENT
6793: ,p_module => l_log_module);
6794: END IF;
6795:

Line 6811: xla_ae_lines_gt lgt

6807: g_incomplete_mpa_acc_TR.l_array_ae_header_id
6808: ,g_incomplete_mpa_acc_TR.l_array_ae_line_num
6809: ,g_incomplete_mpa_acc_TR.l_array_parent_ae_header
6810: FROM
6811: xla_ae_lines_gt lgt
6812: ,xla_ae_lines ael
6813: ,xla_ae_headers aeh
6814: ,xla_events xet -- 5262950
6815: WHERE aeh.application_id = l_application_id

Line 6812: ,xla_ae_lines ael

6808: ,g_incomplete_mpa_acc_TR.l_array_ae_line_num
6809: ,g_incomplete_mpa_acc_TR.l_array_parent_ae_header
6810: FROM
6811: xla_ae_lines_gt lgt
6812: ,xla_ae_lines ael
6813: ,xla_ae_headers aeh
6814: ,xla_events xet -- 5262950
6815: WHERE aeh.application_id = l_application_id
6816: AND lgt.reversal_code = 'DUMMY_TR'

Line 6860: -- reverse the lines in xla_ae_lines table

6856: --end bug#6933157 24-Apr-2008
6857:
6858: --
6859: ---------------------------------------------------------------------------------------------------------
6860: -- reverse the lines in xla_ae_lines table
6861: --
6862: -- Some for 4669308:
6863: -- For MPA entries, only reverse what is necessary , ie create reversal for Complete MPA only.
6864: -- Do not create reversal for incomplete entry (since it will get deleted anyway).

Line 6870: INSERT INTO xla_ae_lines_gt

6866: -- Need to create reversal in Draft mode also (so can be viewed).
6867: ---------------------------------------------------------------------------------------------------------
6868: --
6869: FORALL i IN 1..l_array_event_id.count
6870: INSERT INTO xla_ae_lines_gt
6871: (ae_header_id
6872: ,temp_line_num
6873: ,event_id
6874: ,ref_ae_header_id

Line 7150: xla_ae_lines ael

7146: , xdl.alloc_to_dist_id_num_3 alloc_to_dist_id_num_3
7147: , xdl.alloc_to_dist_id_num_4 alloc_to_dist_id_num_4
7148: , xdl.alloc_to_dist_id_num_5 alloc_to_dist_id_num_5
7149: FROM
7150: xla_ae_lines ael
7151: ,xla_ae_headers aeh
7152: ,xla_distribution_links xdl
7153: ,fnd_currencies fcu
7154: ,xla_events xe

Line 7176: FROM xla_ae_lines_gt

7172: AND application_id = xdl.application_id
7173: )
7174: AND NOT EXISTS (
7175: SELECT /*+ no_unnest */ 1
7176: FROM xla_ae_lines_gt
7177: WHERE ref_ae_header_id = xdl.ae_header_id
7178: AND temp_line_num = xdl.temp_line_num * -1
7179: AND ledger_id = l_array_ledger_id(i)
7180: )

Line 7297: (p_msg => 'Transaction Reversal - Reversal lines created from xla_ae_lines = '||SQL%ROWCOUNT

7293: ;
7294:
7295: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
7296: trace
7297: (p_msg => 'Transaction Reversal - Reversal lines created from xla_ae_lines = '||SQL%ROWCOUNT
7298: ,p_level => C_LEVEL_STATEMENT
7299: ,p_module => l_log_module);
7300: END IF;
7301:

Line 7310: FROM xla_ae_lines_gt gt1, xla_ae_headers

7306: IF l_upgrade_check = 1 THEN
7307:
7308: SELECT min(xla_ae_headers.accounting_date)
7309: INTO l_min_ref_event_date
7310: FROM xla_ae_lines_gt gt1, xla_ae_headers
7311: WHERE gt1.reversal_code = 'REVERSAL'
7312: AND gt1.ref_event_id = xla_ae_headers.event_id;
7313:
7314: l_error_count := 0;

Line 7327: FROM xla_ae_lines_gt gt1, gl_ledgers gll

7323:
7324:
7325: FOR c_not_reversed_entries IN
7326: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
7327: FROM xla_ae_lines_gt gt1, gl_ledgers gll
7328: WHERE gt1.reversal_code = 'DUMMY_TR'
7329: AND gll.ledger_id = gt1.ledger_id
7330: AND gll.ledger_category_code <> 'PRIMARY'
7331: AND NOT EXISTS (SELECT 1

Line 7332: FROM xla_ae_lines_gt gt2

7328: WHERE gt1.reversal_code = 'DUMMY_TR'
7329: AND gll.ledger_id = gt1.ledger_id
7330: AND gll.ledger_category_code <> 'PRIMARY'
7331: AND NOT EXISTS (SELECT 1
7332: FROM xla_ae_lines_gt gt2
7333: WHERE gt2.reversal_code = 'REVERSAL'
7334: AND gt1.event_id = gt2.event_id
7335: AND gt1.ledger_id = gt2.ledger_id)
7336: AND EXISTS (SELECT 1

Line 7337: FROM xla_ae_lines_gt gt3

7333: WHERE gt2.reversal_code = 'REVERSAL'
7334: AND gt1.event_id = gt2.event_id
7335: AND gt1.ledger_id = gt2.ledger_id)
7336: AND EXISTS (SELECT 1
7337: FROM xla_ae_lines_gt gt3
7338: WHERE gt3.reversal_code = 'REVERSAL'
7339: AND gt1.event_id = gt3.event_id))
7340:
7341: LOOP

Line 7382: FROM xla_ae_lines_gt lgt

7378: ,l_array_ledger_id
7379: ,l_array_balance_type_code
7380: ,l_array_entry_status_code
7381: ,l_array_header_num -- 4262811c missing mpa reversal lines
7382: FROM xla_ae_lines_gt lgt
7383: WHERE reversal_code = 'REVERSAL'
7384: AND NOT EXISTS
7385: (SELECT 1
7386: FROM xla_ae_headers_gt

Line 7391: -- also causing XLA_AE_LINES_U1 error

7387: WHERE event_id = lgt.event_id
7388: AND ledger_id = lgt.ledger_id
7389: -- AND nvl(header_num, -1) = nvl(lgt.header_num, -1) -- 4262811c missing mpa reversal lines
7390: -- 4669308 NVL(-1) give separate headers for MPA
7391: -- also causing XLA_AE_LINES_U1 error
7392: AND nvl(header_num, 0) = nvl(lgt.header_num, 0) -- 4669308 NVL(0) combine replacement and MPA to 1 header
7393: AND balance_type_code = lgt.balance_type_code)
7394: GROUP BY event_id
7395: ,ledger_id

Line 7489: FROM xla_ae_lines_gt gt1

7485:
7486:
7487: FOR c_not_reversed_entries IN
7488: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
7489: FROM xla_ae_lines_gt gt1
7490: WHERE gt1.reversal_code IN ('DUMMY_LR', 'DUMMY_TR')
7491: AND NOT EXISTS (SELECT 1
7492: FROM xla_ae_lines_gt gt2
7493: WHERE gt2.reversal_code = 'REVERSAL'

Line 7492: FROM xla_ae_lines_gt gt2

7488: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
7489: FROM xla_ae_lines_gt gt1
7490: WHERE gt1.reversal_code IN ('DUMMY_LR', 'DUMMY_TR')
7491: AND NOT EXISTS (SELECT 1
7492: FROM xla_ae_lines_gt gt2
7493: WHERE gt2.reversal_code = 'REVERSAL'
7494: AND gt1.event_id = gt2.event_id
7495: AND gt1.ledger_id = gt2.ledger_id))
7496:

Line 7541: (p_location => 'xla_ae_lines_pkg.AccountingReversal');

7537: WHEN xla_exceptions_pkg.application_exception THEN
7538: RAISE;
7539: WHEN OTHERS THEN
7540: xla_exceptions_pkg.raise_message
7541: (p_location => 'xla_ae_lines_pkg.AccountingReversal');
7542: END AccountingReversal;
7543: --
7544: /*======================================================================+
7545: | |

Line 7616: (p_location => 'XLA_AE_LINES_PKG.SetLineNum');

7612: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
7613: RAISE;
7614: WHEN OTHERS THEN
7615: xla_exceptions_pkg.raise_message
7616: (p_location => 'XLA_AE_LINES_PKG.SetLineNum');
7617: --
7618: END SetLineNum;
7619: --
7620: --

Line 7729: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');

7725: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
7726: RAISE;
7727: WHEN OTHERS THEN
7728: xla_exceptions_pkg.raise_message
7729: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');
7730: --
7731: END SetRevAccountingSource;
7732: --
7733: --

Line 7840: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');

7836: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
7837: RAISE;
7838: WHEN OTHERS THEN
7839: xla_exceptions_pkg.raise_message
7840: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');
7841: --
7842: END SetRevAccountingSource;
7843: --
7844: /*======================================================================+

Line 7932: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');

7928: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
7929: RAISE;
7930: WHEN OTHERS THEN
7931: xla_exceptions_pkg.raise_message
7932: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');
7933: END SetRevAccountingSource;
7934: --
7935: --
7936: /*======================================================================+

Line 8068: (p_location => 'XLA_AE_LINES_PKG.accounting_reversal');

8064: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
8065: RAISE;
8066: WHEN OTHERS THEN
8067: xla_exceptions_pkg.raise_message
8068: (p_location => 'XLA_AE_LINES_PKG.accounting_reversal');
8069: --
8070: END accounting_reversal;
8071: --
8072: */

Line 8800: ,p_rec_acct_attrs IN XLA_AE_LINES_PKG.t_rec_acct_attrs

8796: | |
8797: +======================================================================*/
8798: PROCEDURE SetAcctReversalAttrs
8799: (p_event_id IN NUMBER
8800: ,p_rec_acct_attrs IN XLA_AE_LINES_PKG.t_rec_acct_attrs
8801: ,p_calculate_acctd_flag IN VARCHAR2
8802: ,p_calculate_g_l_flag IN VARCHAR2) IS
8803:
8804: l_sys_distribution_type VARCHAR2(30);

Line 9271: xla_ae_lines_pkg.set_ccid(

9267:
9268: g_rec_lines.array_currency_mau(g_LineNumber) :=
9269: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9270:
9271: xla_ae_lines_pkg.set_ccid(
9272: p_code_combination_id => l_actual_upg_dr_ccid
9273: , p_value_type_code => 'S' --l_adr_value_type_code
9274: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9275: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 9348: xla_ae_lines_pkg.set_ccid(

9344:
9345: g_rec_lines.array_currency_mau(g_LineNumber) :=
9346: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9347:
9348: xla_ae_lines_pkg.set_ccid(
9349: p_code_combination_id => l_actual_upg_cr_ccid
9350: , p_value_type_code => 'S' --l_adr_value_type_code
9351: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9352: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 9439: xla_ae_lines_pkg.set_ccid(

9435:
9436: g_rec_lines.array_currency_mau(g_LineNumber) :=
9437: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9438:
9439: xla_ae_lines_pkg.set_ccid(
9440: p_code_combination_id => l_enc_upg_dr_ccid
9441: , p_value_type_code => 'S' --l_adr_value_type_code
9442: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9443: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 9517: xla_ae_lines_pkg.set_ccid(

9513:
9514: g_rec_lines.array_currency_mau(g_LineNumber) :=
9515: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9516:
9517: xla_ae_lines_pkg.set_ccid(
9518: p_code_combination_id => l_enc_upg_cr_ccid
9519: , p_value_type_code => 'S' --l_adr_value_type_code
9520: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9521: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 9670: FROM xla_ae_lines_gt xal

9666: trunc(fc1.derive_effective)), -1, 'OTHER', 'EMU'), 'OTHER' ) to_type
9667: ,decode( fc2.derive_type, 'EURO', 'EURO', 'EMU',
9668: decode( sign( trunc(nvl(xal.currency_conversion_date, xeg.transaction_date)) -
9669: trunc(fc2.derive_effective)), -1, 'OTHER', 'EMU'), 'OTHER' ) primary_type
9670: FROM xla_ae_lines_gt xal
9671: ,gl_ledgers gl
9672: ,fnd_currencies fc
9673: ,fnd_currencies fc1
9674: ,fnd_currencies fc2

Line 10010: UPDATE xla_ae_lines_gt xal

10006: */
10007:
10008: END IF;
10009: FORALL i in 1..l_array_conversion_type.COUNT
10010: UPDATE xla_ae_lines_gt xal
10011: SET currency_conversion_rate = l_array_new_rate(i)
10012: ,currency_conversion_type = l_array_new_type(i)
10013: ,currency_conversion_date = l_array_conversion_date(i)
10014: ,unrounded_accounted_cr = unrounded_entered_cr * l_array_new_rate(i)

Line 10061: UPDATE xla_ae_lines_gt xal

10057: END IF;
10058:
10059: /*
10060: FORALL i in 1..l_max_ledger_index
10061: UPDATE xla_ae_lines_gt xal
10062: SET (xal.unrounded_accounted_dr
10063: ,xal.unrounded_accounted_cr
10064: ,xal.currency_conversion_rate
10065: )

Line 10585: UPDATE xla_ae_lines_gt xal

10581: */
10582: /*
10583:
10584: FORALL i in 1..l_max_ledger_index
10585: UPDATE xla_ae_lines_gt xal
10586: SET (xal.unrounded_accounted_dr
10587: ,xal.unrounded_accounted_cr
10588: ,xal.currency_conversion_rate
10589: )

Line 10761: FROM XLA_AE_LINES_GT xal2

10757:
10758: CURSOR csr_gain_loss_amts IS
10759: SELECT ledger_id
10760: ,ae_header_id
10761: FROM XLA_AE_LINES_GT xal2
10762: WHERE nvl(xal2.gain_or_loss_flag, 'N') = 'Y'
10763: AND xal2.balance_type_code <> 'X'
10764: AND xal2.calculate_g_l_amts_flag = 'Y'
10765: AND xal2.reversal_code IS NULL

Line 10778: FROM XLA_AE_LINES_GT xal2

10774: ,ae_header_id
10775: ,balance_type_code
10776: ,gain_or_loss_ref
10777: ,event_id
10778: FROM XLA_AE_LINES_GT xal2
10779: WHERE nvl(xal2.gain_or_loss_flag, 'N') = 'N'
10780: AND xal2.balance_type_code <> 'X'
10781: AND xal2.reversal_code is NULL
10782: HAVING nvl(sum(xal2.unrounded_accounted_dr), 0) <> nvl(sum(xal2.unrounded_accounted_cr), 0) -- 5745199

Line 10823: UPDATE /*+ index(xal XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal -- 6658161

10819: EXIT;
10820: END IF;
10821:
10822: FORALL Idx IN 1 .. l_array_ae_header_id.COUNT
10823: UPDATE /*+ index(xal XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal -- 6658161
10824: SET (xal.unrounded_accounted_cr
10825: , xal.unrounded_entered_cr
10826: , xal.unrounded_accounted_dr
10827: , xal.unrounded_entered_dr

Line 10831: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ -- 6658161,6727907

10827: , xal.unrounded_entered_dr
10828: ,xal.currency_code
10829: ,xal.balance_type_code
10830: ) =
10831: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ -- 6658161,6727907
10832: case sign(nvl(sum(xal2.unrounded_accounted_dr), 0)
10833: - nvl(sum(xal2.unrounded_accounted_cr), 0))
10834: when -1 then null
10835: else nvl(sum(xal2.unrounded_accounted_dr), 0)

Line 10871: FROM xla_ae_lines_gt xal2

10867: then xal.balance_type_code
10868: else 'X'
10869: END
10870: END
10871: FROM xla_ae_lines_gt xal2
10872: WHERE xal2.ae_header_id = xal.ae_header_id
10873: AND xal2.balance_type_code = xal.balance_type_code
10874: AND xal2.gain_or_loss_ref = xal.gain_or_loss_ref
10875: AND xal2.ledger_id = xal.ledger_id

Line 10888: UPDATE xla_ae_lines_gt xal

10884: AND xal.ae_header_id = l_array_ae_header_id(Idx)
10885: AND xal.ledger_id = l_array_ledger_id(Idx);
10886:
10887: /* old code
10888: UPDATE xla_ae_lines_gt xal
10889: SET xal.unrounded_accounted_cr =
10890: CASE sign(l_res_array_accounted_amount(Idx))
10891: WHEN -1 THEN NULL
10892: ELSE l_res_array_accounted_amount(Idx)

Line 10935: UPDATE /*+ index(xal2 XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal

10931: END LOOP;
10932: CLOSE csr_gain_loss_amts;
10933:
10934: IF (g_num_bflow_prior_entries > 0) THEN
10935: UPDATE /*+ index(xal2 XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal
10936: SET xal.currency_code =
10937: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ max(currency_code)
10938: FROM xla_ae_lines_gt xal2
10939: WHERE xal2.ae_header_id = xal.ae_header_id

Line 10937: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ max(currency_code)

10933:
10934: IF (g_num_bflow_prior_entries > 0) THEN
10935: UPDATE /*+ index(xal2 XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal
10936: SET xal.currency_code =
10937: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ max(currency_code)
10938: FROM xla_ae_lines_gt xal2
10939: WHERE xal2.ae_header_id = xal.ae_header_id
10940: AND xal2.balance_type_code <> 'X'
10941: AND xal2.gain_or_loss_ref = xal.gain_or_loss_ref

Line 10938: FROM xla_ae_lines_gt xal2

10934: IF (g_num_bflow_prior_entries > 0) THEN
10935: UPDATE /*+ index(xal2 XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal
10936: SET xal.currency_code =
10937: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ max(currency_code)
10938: FROM xla_ae_lines_gt xal2
10939: WHERE xal2.ae_header_id = xal.ae_header_id
10940: AND xal2.balance_type_code <> 'X'
10941: AND xal2.gain_or_loss_ref = xal.gain_or_loss_ref
10942: AND xal2.ledger_id = xal.ledger_id

Line 10952: (select /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id

10948: AND xal.calculate_g_l_amts_flag = 'Y'
10949: AND xal.reversal_code is NULL
10950: and (xal.ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id)
10951: in
10952: (select /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id
10953: from xla_ae_lines_gt xal3
10954: where xal3.ae_header_id = xal.ae_header_id
10955: AND xal3.balance_type_code <> 'X'
10956: AND xal3.gain_or_loss_ref = xal.gain_or_loss_ref

Line 10953: from xla_ae_lines_gt xal3

10949: AND xal.reversal_code is NULL
10950: and (xal.ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id)
10951: in
10952: (select /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id
10953: from xla_ae_lines_gt xal3
10954: where xal3.ae_header_id = xal.ae_header_id
10955: AND xal3.balance_type_code <> 'X'
10956: AND xal3.gain_or_loss_ref = xal.gain_or_loss_ref
10957: AND xal3.ledger_id = xal.ledger_id

Line 10974: UPDATE xla_ae_lines_gt xal

10970: ,p_level => C_LEVEL_PROCEDURE
10971: ,p_module => l_log_module);
10972: END IF;
10973:
10974: UPDATE xla_ae_lines_gt xal
10975: --SET xal.temp_line_num = 0 -- It casues XLA_AE_LINES_GT_U1 violation when
10976: -- there are 2 extract lines and g/l is on
10977: SET balance_type_code = 'X'
10978: WHERE xal.gain_or_loss_flag = 'Y'

Line 10975: --SET xal.temp_line_num = 0 -- It casues XLA_AE_LINES_GT_U1 violation when

10971: ,p_module => l_log_module);
10972: END IF;
10973:
10974: UPDATE xla_ae_lines_gt xal
10975: --SET xal.temp_line_num = 0 -- It casues XLA_AE_LINES_GT_U1 violation when
10976: -- there are 2 extract lines and g/l is on
10977: SET balance_type_code = 'X'
10978: WHERE xal.gain_or_loss_flag = 'Y'
10979: AND nvl(xal.unrounded_accounted_cr, 0) = 0

Line 11093: (p_location => 'xla_ae_lines_pkg.Business_Flow_Validation');

11089: WHEN xla_exceptions_pkg.application_exception THEN
11090: RAISE;
11091: WHEN OTHERS THEN
11092: xla_exceptions_pkg.raise_message
11093: (p_location => 'xla_ae_lines_pkg.Business_Flow_Validation');
11094: --
11095: END Business_Flow_Validation;
11096:
11097:

Line 11200: FROM xla_ae_lines_gt xalg

11196: ,(xdl.temp_line_num) ref_temp_line_num
11197: ,(DECODE(xalg.currency_code,xal.currency_code,xah.accounting_entry_status_code,
11198: DECODE(xalg.bflow_applied_to_amount, NULL, 'X', xah.accounting_entry_status_code))) bflow_prior_entry_status_code
11199: ,(xah.entity_id) applied_to_entity_id
11200: FROM xla_ae_lines_gt xalg
11201: ,xla_transaction_entities xte
11202: ,xla_ae_headers xah
11203: ,xla_distribution_links xdl
11204: ,xla_ae_lines xal

Line 11204: ,xla_ae_lines xal

11200: FROM xla_ae_lines_gt xalg
11201: ,xla_transaction_entities xte
11202: ,xla_ae_headers xah
11203: ,xla_distribution_links xdl
11204: ,xla_ae_lines xal
11205: -- ,xla_ledger_relationships_v xlr
11206: -- ,xla_gl_ledgers_v xgl
11207: -- ,xla_ledger_options xlo
11208: WHERE xah.application_id = xdl.application_id

Line 11288: FROM xla_ae_lines_gt

11284: event_id,
11285: ledger_id,
11286: balance_type_code,
11287: temp_line_num
11288: FROM xla_ae_lines_gt
11289: WHERE reversal_code = C_DUMMY_PRIOR
11290: AND bflow_prior_entry_status_code IS NOT NULL AND bflow_prior_entry_status_code <> 'X'; -- 5132302 if applied to amt is null
11291: --AND (bflow_prior_entry_status_code IN ('F', DECODE(p_accounting_mode, 'D', 'D', 'F')));
11292:

Line 11309: FROM xla_ae_lines_gt xal,

11305: ,'N'
11306: ,gl.ledger_category_code
11307: ,glp.start_date
11308:
11309: FROM xla_ae_lines_gt xal,
11310: fnd_application_vl fav,
11311: gl_ledgers gl,
11312: gl_period_statuses glp
11313: WHERE ((reversal_code = C_DUMMY_PRIOR

Line 11432: -- Update DUMMY_BFPE rows based on upstream journal lines in XLA_AE_LINES

11428:
11429: IF (g_num_bflow_prior_entries > 0) THEN
11430:
11431: --
11432: -- Update DUMMY_BFPE rows based on upstream journal lines in XLA_AE_LINES
11433: --
11434:
11435: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
11436:

Line 11445: FOR l IN (SELECT * FROM xla_ae_lines_gt WHERE reversal_code = C_DUMMY_PRIOR) LOOP

11441: ,p_level => C_LEVEL_EVENT
11442: ,p_module => l_log_module);
11443: END LOOP;
11444:
11445: FOR l IN (SELECT * FROM xla_ae_lines_gt WHERE reversal_code = C_DUMMY_PRIOR) LOOP
11446: trace(p_msg => 'event_id='||l.event_id||
11447: ' ae_header_id='||l.ae_header_id
11448: ,p_level => C_LEVEL_STATEMENT
11449: ,p_module => l_log_module);

Line 11529: UPDATE xla_ae_lines_gt

11525: EXIT;
11526: END IF;
11527:
11528: FORALL i IN 1..l_array_row_id.LAST
11529: UPDATE xla_ae_lines_gt
11530: SET code_combination_id = l_array_ccid (i)
11531: ,description = l_array_description (i)
11532: ,temp_currency_code = l_array_currency_code (i) -- upstream currency code
11533: ,currency_conversion_rate = l_array_curr_conversion_rate (i)

Line 11557: UPDATE xla_ae_lines_gt xalg

11553: ----------------------------------------------------------------
11554:
11555: ----------------------------------------------------------------
11556: /* performance bug 5357406
11557: UPDATE xla_ae_lines_gt xalg
11558: SET (code_combination_id
11559: ,description
11560: ,temp_currency_code -- upstream currency code
11561: ,currency_conversion_rate

Line 11636: FROM xla_ae_lines xal3

11632: --,MIN(xah3.accounting_entry_status_code)
11633: ,MIN(DECODE(xalg.currency_code,xal3.currency_code,xah3.accounting_entry_status_code, -- 5132302
11634: DECODE(xalg.bflow_applied_to_amount, NULL, 'X', xah3.accounting_entry_status_code))) -- 5132302
11635: ,MIN(xah3.entity_id)
11636: FROM xla_ae_lines xal3
11637: , xla_ae_headers xah3
11638: , xla_distribution_links xdl3
11639: WHERE xah3.application_id = xdl3.application_id
11640: AND xah3.ae_header_id = xdl3.ae_header_id

Line 11675: , xla_ae_lines xal

11671: (SELECT MAX(xdl.ae_header_id)
11672: FROM xla_transaction_entities xte
11673: , xla_ae_headers xah
11674: , xla_distribution_links xdl
11675: , xla_ae_lines xal
11676: , xla_ledger_relationships_v xlr -- 4478604
11677: , xla_gl_ledgers_v xgl -- 4478604
11678: , xla_ledger_options xlo -- 5204178
11679: WHERE xgl.ledger_id = xalg.ledger_id -- 4478604

Line 11767: UPDATE /*+ index(xalg xla_ae_lines_gt_n4) */ xla_ae_lines_gt xalg -- 6990256

11763: END IF;
11764:
11765: IF (l_array_balance_type_code.COUNT > 0) THEN
11766: FORALL i IN 1..l_array_balance_type_code.COUNT
11767: UPDATE /*+ index(xalg xla_ae_lines_gt_n4) */ xla_ae_lines_gt xalg -- 6990256
11768: SET ref_ae_header_id = temp_ref_ae_header_id,
11769: currency_code = temp_currency_code,
11770: reversal_code = null, -- 5499367
11771: (unrounded_entered_cr -- 5132302

Line 11823: FROM xla_ae_lines xal

11819: NVL(xalg.bflow_applied_to_amount,xalg.unrounded_entered_dr)))
11820: ELSE xalg.unrounded_entered_dr END))
11821: )
11822:
11823: FROM xla_ae_lines xal
11824: WHERE xal.application_id = xalg.bflow_application_id
11825: AND xal.ae_header_id = xalg.temp_ref_ae_header_id
11826: AND xal.ae_line_num = xalg.ref_ae_line_num),
11827: entered_currency_mau = xla_accounting_cache_pkg.GetCurrencyMau(temp_currency_code),

Line 11945: SELECT /*+ Leading (xal1,xah1,xal2) index(xah1 XLA_AE_HEADERS_GT_U1) index(xal2 XLA_AE_LINES_GT_N2) no_expand */ -- 5666366

11941: -------------------------------------------------------------------------------------------------------------------------
11942: -- 4655713b Update MPA and Accrual Reversal lines with Prior Entry
11943: -------------------------------------------------------------------------------------------------------------------------
11944: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5666366
11945: SELECT /*+ Leading (xal1,xah1,xal2) index(xah1 XLA_AE_HEADERS_GT_U1) index(xal2 XLA_AE_LINES_GT_N2) no_expand */ -- 5666366
11946: xal2.segment1, xal2.segment2, xal2.segment3, xal2.segment4, xal2.segment5
11947: ,xal2.segment6, xal2.segment7, xal2.segment8, xal2.segment9, xal2.segment10
11948: ,xal2.segment11, xal2.segment12, xal2.segment13, xal2.segment14, xal2.segment15
11949: ,xal2.segment16, xal2.segment17, xal2.segment18, xal2.segment19, xal2.segment20

Line 12016: FROM xla_ae_lines_gt xal2 -- original downstream line

12012: ,l_array_mpa_temp_line_num
12013: ,l_array_mpa_ae_header_id
12014: ,l_array_mpa_header_num
12015: ,l_array_acc_rev_flag
12016: FROM xla_ae_lines_gt xal2 -- original downstream line
12017: ,xla_ae_headers_gt xah1 -- original downstream header
12018: ,xla_ae_lines_gt xal1 -- recognition lines
12019: ,xla_ae_lines xal3 -- upstream line
12020: WHERE xal2.source_distribution_type = xal1.source_distribution_type

Line 12018: ,xla_ae_lines_gt xal1 -- recognition lines

12014: ,l_array_mpa_header_num
12015: ,l_array_acc_rev_flag
12016: FROM xla_ae_lines_gt xal2 -- original downstream line
12017: ,xla_ae_headers_gt xah1 -- original downstream header
12018: ,xla_ae_lines_gt xal1 -- recognition lines
12019: ,xla_ae_lines xal3 -- upstream line
12020: WHERE xal2.source_distribution_type = xal1.source_distribution_type
12021: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)
12022: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal1.source_distribution_id_num_2,C_NUM)

Line 12019: ,xla_ae_lines xal3 -- upstream line

12015: ,l_array_acc_rev_flag
12016: FROM xla_ae_lines_gt xal2 -- original downstream line
12017: ,xla_ae_headers_gt xah1 -- original downstream header
12018: ,xla_ae_lines_gt xal1 -- recognition lines
12019: ,xla_ae_lines xal3 -- upstream line
12020: WHERE xal2.source_distribution_type = xal1.source_distribution_type
12021: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)
12022: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal1.source_distribution_id_num_2,C_NUM)
12023: AND NVL(xal2.source_distribution_id_num_3,C_NUM) = NVL(xal1.source_distribution_id_num_3,C_NUM)

Line 12078: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_MPA_PRIOR_ENTRY) LOOP

12074: ,p_level => C_LEVEL_STATEMENT
12075: ,p_module => l_log_module);
12076: END LOOP;
12077:
12078: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_MPA_PRIOR_ENTRY) LOOP
12079: trace
12080: (p_msg => 'ae_lines_gt PE dist ledger='||i.ledger_id||' ref_ae_header='||i.ref_ae_header_id||
12081: ' temp_line='||i.temp_line_num||' ae_header='||i.ae_header_id||' header_num='||i.header_num||
12082: ' bflow='||i.business_method_code||

Line 12098: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_MPA_PRIOR_ENTRY) LOOP

12094: ,p_level => C_LEVEL_STATEMENT
12095: ,p_module => l_log_module);
12096: END LOOP;
12097:
12098: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_MPA_PRIOR_ENTRY) LOOP
12099: trace
12100: (p_msg => ' seg s1='||i.segment1||' s2='||i.segment2|| ' s3='||i.segment3||' s4='||i.segment4||
12101: ' s5='||i.segment5||' s6='||i.segment6|| ' s7='||i.segment7||' s8='||i.segment8||
12102: ' s9='||i.segment9||' s10='||i.segment10|| ' s11='||i.segment11||' s12='||i.segment12||

Line 12119: UPDATE xla_ae_lines_gt xal

12115: -- Updates only the Accrual-Reversal or MPA-Accrual line which is a PRIOR_ENTRY.
12116: -- NOTE: for Accrual-Reversal, one line may be Prior Entry and the rest may not, so update only Prior Entry line.
12117: ---------------------------------------------------------------------------------------------------------------
12118: FORALL i in 1..l_array_mpa_ledger_id.COUNT
12119: UPDATE xla_ae_lines_gt xal
12120: SET segment1 = l_array_mpa_segment1(i)
12121: , segment2 = l_array_mpa_segment2(i)
12122: , segment3 = l_array_mpa_segment3(i)
12123: , segment4 = l_array_mpa_segment4(i)

Line 12194: UPDATE xla_ae_lines_gt xal

12190: --
12191: -- NOTE: some columns are set to NULL during Business_Flow_Validation
12192: ---------------------------------------------------------------------------------------------------------------
12193: FORALL i in 1..l_array_mpa_ledger_id.COUNT
12194: UPDATE xla_ae_lines_gt xal
12195: SET currency_code = DECODE(l_array_acc_rev_flag(i),'N',l_array_mpa_currency_code(i)
12196: ,currency_code)
12197: , currency_conversion_rate = DECODE(l_array_acc_rev_flag(i),'N',l_array_mpa_curr_conv_rate(i)
12198: ,currency_conversion_rate)

Line 12357: -- Bug 5339999 Delete the problematic lines from xla_ae_lines_gt.

12353:
12354:
12355:
12356: --
12357: -- Bug 5339999 Delete the problematic lines from xla_ae_lines_gt.
12358: --
12359: FORALL i IN 1..l_array_balance_type_code.COUNT
12360: DELETE FROM XLA_AE_LINES_GT
12361: WHERE ae_header_id = l_array_ae_header_id(i)

Line 12360: DELETE FROM XLA_AE_LINES_GT

12356: --
12357: -- Bug 5339999 Delete the problematic lines from xla_ae_lines_gt.
12358: --
12359: FORALL i IN 1..l_array_balance_type_code.COUNT
12360: DELETE FROM XLA_AE_LINES_GT
12361: WHERE ae_header_id = l_array_ae_header_id(i)
12362: AND event_id = l_array_event_id(i)
12363: AND ledger_id = l_array_ledger_id(i)
12364: AND 'Y' = l_array_bflow_historic (i);

Line 12400: UPDATE /*+ index(xalg xla_ae_lines_gt_n2) */ xla_ae_lines_gt xalg

12396: -- Update JE line for invalid entries
12397: -------------------------------------------------------------------------
12398:
12399: FORALL i IN 1..l_array_balance_type_code.COUNT
12400: UPDATE /*+ index(xalg xla_ae_lines_gt_n2) */ xla_ae_lines_gt xalg
12401: SET xalg.code_combination_status_code = C_INVALID
12402: , xalg.code_combination_id = -1
12403: WHERE xalg.balance_type_code = l_array_balance_type_code(i)
12404: AND xalg.ae_header_id = l_array_ae_header_id(i)

Line 12425: (p_location => 'xla_ae_lines_pkg.BusinessFlowPriorEntries');

12421: WHEN xla_exceptions_pkg.application_exception THEN
12422: RAISE;
12423: WHEN OTHERS THEN
12424: xla_exceptions_pkg.raise_message
12425: (p_location => 'xla_ae_lines_pkg.BusinessFlowPriorEntries');
12426: --
12427: END BusinessFlowPriorEntries;
12428:
12429: /*======================================================================+

Line 12474: FROM xla_ae_lines_gt l

12470: ,'N')
12471: ,'N')
12472: ,'N')
12473: ,'N') -- 5443083
12474: FROM xla_ae_lines_gt l
12475: ,xla_ae_headers_gt h
12476: ,xla_gl_ledgers_v xlr
12477: WHERE (reversal_code = C_DUMMY_SAME
12478: OR reversal_code = C_MPA_SAME_ENTRY) -- 4655713b

Line 12747: FROM xla_ae_lines_gt xal2

12743: , l_array_join_ref_ae_header_id
12744: , l_array_join_temp_line_num
12745: , l_array_join_ae_header_id
12746: , l_array_join_header_num
12747: FROM xla_ae_lines_gt xal2
12748: , xla_ae_lines_gt xal
12749: , gl_code_combinations gcc
12750: WHERE xal2.source_distribution_type = xal.source_distribution_type
12751: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal.source_distribution_id_num_1,C_NUM)

Line 12748: , xla_ae_lines_gt xal

12744: , l_array_join_temp_line_num
12745: , l_array_join_ae_header_id
12746: , l_array_join_header_num
12747: FROM xla_ae_lines_gt xal2
12748: , xla_ae_lines_gt xal
12749: , gl_code_combinations gcc
12750: WHERE xal2.source_distribution_type = xal.source_distribution_type
12751: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal.source_distribution_id_num_1,C_NUM)
12752: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal.source_distribution_id_num_2,C_NUM)

Line 12810: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_DUMMY_SAME) LOOP

12806: ,p_level => C_LEVEL_STATEMENT
12807: ,p_module => l_log_module);
12808: END LOOP;
12809:
12810: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_DUMMY_SAME) LOOP
12811: trace
12812: (p_msg => 'ae_lines_gt SE dist ledger='||i.ledger_id||' ref_ae_header='||i.ref_ae_header_id||
12813: ' temp_line='||i.temp_line_num||' ae_header='||i.ae_header_id||' header_num='||i.header_num||
12814: ' bflow='||i.business_method_code||

Line 12827: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_DUMMY_SAME) LOOP

12823: ,p_level => C_LEVEL_STATEMENT
12824: ,p_module => l_log_module);
12825: END LOOP;
12826:
12827: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_DUMMY_SAME) LOOP
12828: trace
12829: (p_msg => ' seg s1='||i.segment1||' s2='||i.segment2|| ' s3='||i.segment3||' s4='||i.segment4||
12830: ' s5='||i.segment5||' s6='||i.segment6|| ' s7='||i.segment7||' s8='||i.segment8||
12831: ' s9='||i.segment9||' s10='||i.segment10|| ' s11='||i.segment11||' s12='||i.segment12||

Line 12844: UPDATE xla_ae_lines_gt xal

12840:
12841: END IF;
12842:
12843: FORALL i IN 1..l_array_join_ledger_id.COUNT
12844: UPDATE xla_ae_lines_gt xal
12845: SET segment1 = l_array_same_segment1(i)
12846: , segment2 = l_array_same_segment2(i)
12847: , segment3 = l_array_same_segment3(i)
12848: , segment4 = l_array_same_segment4(i)

Line 12897: SELECT /*+ Leading (xal1,xah1,xal2) index(xah1 XLA_AE_HEADERS_GT_U1) index(xal2 XLA_AE_LINES_GT_N2) no_expand */ -- 7128871

12893: -------------------------------------------------------------------------------------------------------------------------
12894: -- 4655713b Updates MPA-Accrual (not MPA-Recognition) and Accrual Reversal lines with Same Entry
12895: -------------------------------------------------------------------------------------------------------------------------
12896: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 7128871
12897: SELECT /*+ Leading (xal1,xah1,xal2) index(xah1 XLA_AE_HEADERS_GT_U1) index(xal2 XLA_AE_LINES_GT_N2) no_expand */ -- 7128871
12898: xal2.segment1, xal2.segment2, xal2.segment3, xal2.segment4, xal2.segment5
12899: ,xal2.segment6, xal2.segment7, xal2.segment8, xal2.segment9, xal2.segment10
12900: ,xal2.segment11, xal2.segment12, xal2.segment13, xal2.segment14, xal2.segment15
12901: ,xal2.segment16, xal2.segment17, xal2.segment18, xal2.segment19, xal2.segment20

Line 12929: FROM xla_ae_lines_gt xal2 -- Original line

12925: ,l_array_mpa_ref_ae_header_id
12926: ,l_array_mpa_temp_line_num
12927: ,l_array_mpa_ae_header_id
12928: ,l_array_mpa_header_num
12929: FROM xla_ae_lines_gt xal2 -- Original line
12930: ,xla_ae_headers_gt xah1
12931: ,xla_ae_lines_gt xal1 -- MPA line
12932: WHERE xal2.source_distribution_type = xal1.source_distribution_type
12933: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)

Line 12931: ,xla_ae_lines_gt xal1 -- MPA line

12927: ,l_array_mpa_ae_header_id
12928: ,l_array_mpa_header_num
12929: FROM xla_ae_lines_gt xal2 -- Original line
12930: ,xla_ae_headers_gt xah1
12931: ,xla_ae_lines_gt xal1 -- MPA line
12932: WHERE xal2.source_distribution_type = xal1.source_distribution_type
12933: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)
12934: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal1.source_distribution_id_num_2,C_NUM)
12935: AND NVL(xal2.source_distribution_id_num_3,C_NUM) = NVL(xal1.source_distribution_id_num_3,C_NUM)

Line 12984: UPDATE xla_ae_lines_gt xal

12980: END LOOP;
12981: END IF;
12982:
12983: FORALL i in 1..l_array_mpa_ledger_id.COUNT
12984: UPDATE xla_ae_lines_gt xal
12985: SET segment1 = l_array_mpa_segment1(i)
12986: , segment2 = l_array_mpa_segment2(i)
12987: , segment3 = l_array_mpa_segment3(i)
12988: , segment4 = l_array_mpa_segment4(i)

Line 13031: UPDATE xla_ae_lines_gt xal

13027:
13028: /*-------------------------------------------------------------------------------------------------------------------
13029: -- Replaced for performance fix above
13030: ---------------------------------------------------------------------------------------------------------------------
13031: UPDATE xla_ae_lines_gt xal
13032: SET (segment1, segment2, segment3, segment4, segment5, segment6, segment7, segment8, segment9, segment10
13033: ,segment11, segment12, segment13, segment14, segment15, segment16, segment17, segment18, segment19, segment20
13034: ,segment21, segment22, segment23, segment24, segment25, segment26, segment27, segment28, segment29, segment30
13035: ,code_combination_id

Line 13135: FROM xla_ae_lines_gt xal2

13131: , CASE WHEN count(*) = 1
13132: THEN MIN(DECODE(xal.inherit_desc_flag, 'Y', xal2.description, xal.description)) ELSE NULL END
13133: , CASE WHEN count(*) = 1
13134: THEN NULL ELSE xal.reversal_code END
13135: FROM xla_ae_lines_gt xal2
13136: , gl_code_combinations gcc -- bug4384869
13137: WHERE xal2.source_distribution_type = xal.source_distribution_type
13138: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal.source_distribution_id_num_1,C_NUM)
13139: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal.source_distribution_id_num_2,C_NUM)

Line 13224: DELETE xla_ae_lines_gt

13220: ,p_level => C_LEVEL_STATEMENT
13221: );
13222: END IF;
13223:
13224: DELETE xla_ae_lines_gt
13225: WHERE ledger_id = l_array_ledger_id(i)
13226: AND ref_ae_header_id = l_array_ref_ae_header_id(i)
13227: AND temp_line_num = l_array_temp_line_num(i)
13228: AND ae_header_id = l_array_ae_header_id(i)

Line 13244: AND NOT EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1

13240: WHERE ledger_id = l_array_ledger_id(i)
13241: AND ae_header_id = l_array_ae_header_id(i)
13242: AND balance_type_code = l_array_balance_type_code(i)
13243: AND header_num = l_array_header_num(i)
13244: AND NOT EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1
13245: FROM xla_ae_lines_gt lgt
13246: WHERE lgt.ledger_id = hgt.ledger_id
13247: AND lgt.ae_header_id = hgt.ae_header_id
13248: AND lgt.header_num = hgt.header_num

Line 13245: FROM xla_ae_lines_gt lgt

13241: AND ae_header_id = l_array_ae_header_id(i)
13242: AND balance_type_code = l_array_balance_type_code(i)
13243: AND header_num = l_array_header_num(i)
13244: AND NOT EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1
13245: FROM xla_ae_lines_gt lgt
13246: WHERE lgt.ledger_id = hgt.ledger_id
13247: AND lgt.ae_header_id = hgt.ae_header_id
13248: AND lgt.header_num = hgt.header_num
13249: AND lgt.balance_type_code = hgt.balance_type_code);

Line 13274: UPDATE xla_ae_lines_gt

13270: --
13271: -- Update JE lines for those that encountered error
13272: --
13273: FORALL i IN 1..l_array_balance_type_code.COUNT
13274: UPDATE xla_ae_lines_gt
13275: SET description = DECODE(description, C_CHAR, NULL, description)
13276: , code_combination_id = DECODE(code_combination_id, C_NUM, -1, code_combination_id)
13277: , code_combination_status_code = C_INVALID -- 4655713
13278: , segment1 = DECODE(segment1, C_CHAR, NULL, segment1)

Line 13328: AND EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1 - 5443083

13324: AND event_id = l_array_event_id(i)
13325: AND ledger_id = l_array_ledger_id(i)
13326: AND header_num = l_array_header_num(i) -- 5443083
13327: AND balance_type_code = l_array_balance_type_code(i)
13328: AND EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1 - 5443083
13329: FROM xla_ae_lines_gt lgt
13330: WHERE lgt.ledger_id = hgt.ledger_id
13331: AND lgt.ae_header_id = hgt.ae_header_id
13332: AND lgt.header_num = hgt.header_num

Line 13329: FROM xla_ae_lines_gt lgt

13325: AND ledger_id = l_array_ledger_id(i)
13326: AND header_num = l_array_header_num(i) -- 5443083
13327: AND balance_type_code = l_array_balance_type_code(i)
13328: AND EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1 - 5443083
13329: FROM xla_ae_lines_gt lgt
13330: WHERE lgt.ledger_id = hgt.ledger_id
13331: AND lgt.ae_header_id = hgt.ae_header_id
13332: AND lgt.header_num = hgt.header_num
13333: AND lgt.balance_type_code = hgt.balance_type_code

Line 13356: (p_location => 'xla_ae_lines_pkg.BusinessFlowSameEntries');

13352: WHEN xla_exceptions_pkg.application_exception THEN
13353: RAISE;
13354: WHEN OTHERS THEN
13355: xla_exceptions_pkg.raise_message
13356: (p_location => 'xla_ae_lines_pkg.BusinessFlowSameEntries');
13357: --
13358: END BusinessFlowSameEntries;
13359:
13360: /*======================================================================+

Line 13544: (p_location => 'xla_ae_lines_pkg.ValidateBFlowLinks');

13540: WHEN xla_exceptions_pkg.application_exception THEN
13541: RAISE;
13542: WHEN OTHERS THEN
13543: xla_exceptions_pkg.raise_message
13544: (p_location => 'xla_ae_lines_pkg.ValidateBFlowLinks');
13545: --
13546: END ValidateBFlowLinks;
13547:
13548: /*======================================================================+

Line 14029: (p_location => 'xla_ae_lines_pkg.CopyLineInfo');

14025: WHEN xla_exceptions_pkg.application_exception THEN
14026: RAISE;
14027: WHEN OTHERS THEN
14028: xla_exceptions_pkg.raise_message
14029: (p_location => 'xla_ae_lines_pkg.CopyLineInfo');
14030: --
14031: END CopyLineInfo;
14032:
14033: /*======================================================================+

Line 14160: xla_ae_lines_pkg.set_ccid(

14156:
14157: -- Bug 4922099
14158: IF ((NVL(g_rec_lines.array_actual_upg_option(g_LineNumber), 'N') = 'Y') OR
14159: (NVL(g_rec_lines.array_enc_upg_option(g_LineNumber), 'N') = 'Y')) THEN
14160: xla_ae_lines_pkg.set_ccid(
14161: p_code_combination_id => l_ccid
14162: , p_value_type_code => 'S' --l_adr_value_type_code
14163: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
14164: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 14585: END xla_ae_lines_pkg;

14581: IF NOT g_log_enabled THEN
14582: g_log_level := C_LEVEL_LOG_DISABLED;
14583: END IF;
14584:
14585: END xla_ae_lines_pkg;