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.237.12020000.3 2012/08/25 23:40:48 vdamerla 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 261: | XALG_U1 for update xla_ae_lines_gt |

257: | 02-Jun-2009 VGOPISET 8505463 - Changes in AccountingReversal for |
258: | MPA Cancellation. |
259: | 20-sep-2009 ssawhney 8773083 Modified CalculateGainLossAmounts |
260: | and 8452052 and 8920369 completely. Added hint to pick |
261: | XALG_U1 for update xla_ae_lines_gt |
262: | in SameEntry/PriorEntry |
263: | 18-Mar-2010 ssawhney 9483834 incorrect alias in the hints in CalculateGainLossAmounts |
264: | 26-Mar-2010 krsankar 8810416 Modified the currency conversion |
265: | details in FUNCTION InsertLines for |

Line 285: | lines are deleted from xla_ae_lines_gt |

281: | ii) Change SIGN considered for Transaction Revesal |
282: | in Draft Mode as well. |
283: | 02-Feb-2011 VGOPISET 11066172 Changes in BusinessFlowSameEntries to |
284: | mark all the Headers as INVALID after all dummy |
285: | lines are deleted from xla_ae_lines_gt |
286: | 18-Oct-2011 Narayanan M.S. Bug 12379106 Changes in business flow cursor|
287: | in procedure BusinessFlowPriorEntries to |
288: | include event_number when deciding the line |
289: | rank. |

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

529: C_LEVEL_ERROR CONSTANT NUMBER := FND_LOG.LEVEL_ERROR;
530: C_LEVEL_UNEXPECTED CONSTANT NUMBER := FND_LOG.LEVEL_UNEXPECTED;
531:
532: C_LEVEL_LOG_DISABLED CONSTANT NUMBER := 99;
533: C_DEFAULT_MODULE CONSTANT VARCHAR2(240) := 'xla.plsql.XLA_AE_LINES_PKG';
534:
535: g_log_level NUMBER;
536: g_log_enabled BOOLEAN;
537:

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

550: WHEN xla_exceptions_pkg.application_exception THEN
551: RAISE;
552: WHEN OTHERS THEN
553: xla_exceptions_pkg.raise_message
554: (p_location => 'XLA_AE_LINES_PKG.trace');
555: END trace;
556:
557: --=============================================================================
558: -- ******* Print Log File **********

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

566: WHEN xla_exceptions_pkg.application_exception THEN
567: RAISE;
568: WHEN OTHERS THEN
569: xla_exceptions_pkg.raise_message
570: (p_location => 'xla_ae_lines_pkg.print_logfile');
571: END print_logfile;
572: --
573: --====================================================================
574: --

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

763: WHEN xla_exceptions_pkg.application_exception THEN
764: RAISE;
765: WHEN OTHERS THEN
766: xla_exceptions_pkg.raise_message
767: (p_location => 'xla_ae_lines_pkg.ValidateLinks');
768: --
769: END ValidateLinks;
770: --
771: --

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

1053: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
1054: RAISE;
1055: WHEN OTHERS THEN
1056: xla_exceptions_pkg.raise_message
1057: (p_location => 'XLA_AE_LINES_PKG.SetDebitCreditAmounts');
1058: --
1059: END SetDebitCreditAmounts;
1060: --
1061: --====================================================================

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

1131: WHEN xla_exceptions_pkg.application_exception THEN
1132: RAISE;
1133: WHEN OTHERS THEN
1134: xla_exceptions_pkg.raise_message
1135: (p_location => 'XLA_AE_LINES_PKG.InitLines');
1136: --
1137: END InitLines;
1138: --
1139: --

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

1185: g_ExtractLine := null;
1186: RAISE;
1187: WHEN OTHERS THEN
1188: xla_exceptions_pkg.raise_message
1189: (p_location => 'XLA_AE_LINES_PKG.SetExtractLine');
1190: --
1191: END SetExtractLine;
1192: --
1193: /*======================================================================+

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

1626: WHEN xla_exceptions_pkg.application_exception THEN
1627: RAISE;
1628: WHEN OTHERS THEN
1629: xla_exceptions_pkg.raise_message
1630: (p_location => 'XLA_AE_LINES_PKG.SetNullLine');
1631: --
1632: END SetNullLine;
1633: --
1634: /*======================================================================+

Line 1663: -- insert headers into xla_ae_lines_gt table

1659: g_rec_lines := g_null_lines;
1660:
1661: ELSIF g_LineNumber = C_BULK_LIMIT THEN
1662: --
1663: -- insert headers into xla_ae_lines_gt table
1664: --
1665: l_result := xla_ae_lines_pkg.InsertLines;
1666: g_LineNumber := 0;
1667: g_rec_lines := g_null_lines;

Line 1665: l_result := xla_ae_lines_pkg.InsertLines;

1661: ELSIF g_LineNumber = C_BULK_LIMIT THEN
1662: --
1663: -- insert headers into xla_ae_lines_gt table
1664: --
1665: l_result := xla_ae_lines_pkg.InsertLines;
1666: g_LineNumber := 0;
1667: g_rec_lines := g_null_lines;
1668:
1669: END IF;

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

1691: WHEN xla_exceptions_pkg.application_exception THEN
1692: RAISE;
1693: WHEN OTHERS THEN
1694: xla_exceptions_pkg.raise_message
1695: (p_location => 'XLA_AE_LINES_PKG.SetNewLine');
1696: --
1697: END SetNewLine;
1698: --
1699: --

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

1777: WHEN xla_exceptions_pkg.application_exception THEN
1778: RAISE;
1779: WHEN OTHERS THEN
1780: xla_exceptions_pkg.raise_message
1781: (p_location => 'XLA_AE_LINES_PKG.SetAcctLineType');
1782: --
1783: END SetAcctLineType;
1784:
1785: /*======================================================================+

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

1856: WHEN xla_exceptions_pkg.application_exception THEN
1857: RAISE;
1858: WHEN OTHERS THEN
1859: xla_exceptions_pkg.raise_message
1860: (p_location => 'XLA_AE_LINES_PKG.SetAcctLineOption');
1861: --
1862: END SetAcctLineOption;
1863: --
1864: /*======================================================================+

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

1900: WHEN xla_exceptions_pkg.application_exception THEN
1901: RAISE;
1902: WHEN OTHERS THEN
1903: xla_exceptions_pkg.raise_message
1904: (p_location => 'XLA_AE_LINES_PKG.SetLineDescription');
1905: --
1906: END SetLineDescription;
1907: --
1908: --

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

2209: ,p_level => C_LEVEL_PROCEDURE
2210: ,p_module => l_log_module);
2211: END IF;
2212: xla_exceptions_pkg.raise_message
2213: (p_location => 'XLA_AE_LINES_PKG.set_ccid');
2214: END set_ccid;
2215:
2216: /*=========================================================================+
2217: | |

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

2849: ,p_level => C_LEVEL_PROCEDURE
2850: ,p_module => l_log_module);
2851: END IF;
2852: xla_exceptions_pkg.raise_message
2853: (p_location => 'XLA_AE_LINES_PKG.set_segment');
2854: END set_segment;
2855:
2856: --
2857: /*======================================================================+

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

2899: WHEN xla_exceptions_pkg.application_exception THEN
2900: RAISE;
2901: WHEN OTHERS THEN
2902: xla_exceptions_pkg.raise_message
2903: (p_location => 'XLA_AE_LINES_PKG.ValidateCurrentLine');
2904: --
2905: END ValidateCurrentLine;
2906: --
2907: /*======================================================================+

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

2944: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
2945: RAISE;
2946: WHEN OTHERS THEN
2947: xla_exceptions_pkg.raise_message
2948: (p_location => 'XLA_AE_LINES_PKG.SetAcctClass');
2949: END SetAcctClass;
2950: --
2951:
2952: /*======================================================================+

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

3048: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
3049: RAISE;
3050: WHEN OTHERS THEN
3051: xla_exceptions_pkg.raise_message
3052: (p_location => 'XLA_AE_LINES_PKG.SetAnalyticalCriteria');
3053: --
3054: END SetAnalyticalCriteria;
3055:
3056:

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

3089: l_result :=TRUE;
3090:
3091: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
3092: trace
3093: (p_msg => '# temporary journal lines to insert into GT xla_ae_lines_gt = '||g_rec_lines.array_line_num.COUNT
3094: ,p_level => C_LEVEL_STATEMENT
3095: ,p_module => l_log_module);
3096: END IF;
3097:

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

3128: END IF;
3129:
3130: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
3131: trace
3132: (p_msg => 'SQL - Insert into xla_ae_lines_gt'
3133: ,p_level => C_LEVEL_STATEMENT
3134: ,p_module => l_log_module);
3135: END IF;
3136:

Line 3140: INSERT INTO xla_ae_lines_gt

3136:
3137: ------------------------------------------------------------------------------------------------------
3138:
3139: FORALL Idx IN g_rec_lines.array_line_num.FIRST .. g_rec_lines.array_line_num.LAST SAVE EXCEPTIONS --7453943
3140: INSERT INTO xla_ae_lines_gt
3141: ( ae_header_id
3142: , temp_line_num
3143: , extract_line_num
3144: , event_id

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

3819: l_result := ( l_rowcount> 0);
3820:
3821: IF (C_LEVEL_EVENT >= g_log_level) THEN
3822: trace
3823: (p_msg => '# temporary journal lines inserted into GT xla_ae_lines_gt = '||TO_CHAR(l_rowcount)
3824: ,p_level => C_LEVEL_EVENT
3825: ,p_module => l_log_module);
3826: END IF;
3827:

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

3917: ,p_level => C_LEVEL_PROCEDURE
3918: ,p_module => l_log_module);
3919: END IF;
3920: xla_exceptions_pkg.raise_message
3921: (p_location => 'XLA_AE_LINES_PKG.InsertLines');
3922: END InsertLines;
3923: --
3924: /*======================================================================+
3925: | |

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

3964: WHEN xla_exceptions_pkg.application_exception THEN
3965: RAISE;
3966: WHEN OTHERS THEN
3967: xla_exceptions_pkg.raise_message
3968: (p_location => 'XLA_AE_LINES_PKG.RefreshLines');
3969: END RefreshLines;
3970: --
3971: --
3972: --====================================================================

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

4190: WHEN xla_exceptions_pkg.application_exception THEN
4191: RAISE;
4192: WHEN OTHERS THEN
4193: xla_exceptions_pkg.raise_message
4194: (p_location => 'xla_ae_lines_pkg.ValidateRevLinks');
4195: --
4196: END ValidateRevLinks;
4197: --
4198: /*======================================================================+

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

4336: --***************************************************************************************************************
4337: --***************************************************************************************************************
4338:
4339: --
4340: -- selecting all the dummy lines from xla_ae_lines_gt that are due to
4341: -- line level reversal option
4342: --
4343: SELECT event_id
4344: ,ledger_id

Line 4406: FROM xla_ae_lines_gt

4402: ,l_array_gl_date -- 5189664
4403: ,l_array_tax_line_ref -- 7159711
4404: ,l_array_tax_summary_line_ref -- 7159711
4405: ,l_array_tax_rec_nrec_dist_ref -- 7159711
4406: FROM xla_ae_lines_gt
4407: WHERE reversal_code = 'DUMMY_LR'
4408: ORDER by entity_id, event_number;
4409:
4410: IF (C_LEVEL_STATEMENT >= g_log_level) THEN

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

4418: -- 4669308 Delete the MPA/Accrual Line Reversal (still in GT ables, not in distribution links yet)
4419: --=======================================================================================================
4420: --
4421: ---------------------------------------------------------------------------------------------------------
4422: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)
4423: ---------------------------------------------------------------------------------------------------------
4424: --
4425: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
4426: -- Modify for performance bug 5086984

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

4424: --
4425: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
4426: -- Modify for performance bug 5086984
4427: FOR i IN 1..l_array_entity_id.count LOOP
4428: SELECT /*+ Leading(HGT) cardinality(hgt 1) index(lgt XLA_AE_LINES_GT_U1) */
4429: lgt.ledger_id
4430: ,lgt.event_id
4431: ,lgt.ref_ae_header_id
4432: ,lgt.temp_line_num

Line 4444: FROM xla_ae_lines_gt lgt

4440: ,l_array_mpa_acc_temp_line_num
4441: ,l_array_mpa_acc_ae_header_id
4442: ,l_array_mpa_acc_header_num
4443: ,l_array_mpa_acc_balance_type
4444: FROM xla_ae_lines_gt lgt
4445: ,xla_ae_headers_gt hgt
4446: WHERE l_array_ledger_id(i) = lgt.ledger_id
4447: AND l_array_rev_dist_type(i) = lgt.source_distribution_type
4448: AND nvl(l_array_rev_dist_id_num_1(i),-99) = nvl(lgt.source_distribution_id_num_1,-99)

Line 4471: FROM xla_ae_lines_gt

4467: AND hgt.event_number < l_array_event_number(i);
4468: /* 5412560 replaced
4469: AND NOT EXISTS ( -- the lines already reversed are not reversed again
4470: SELECT 1
4471: FROM xla_ae_lines_gt
4472: WHERE ledger_id = lgt.ledger_id
4473: AND ref_ae_header_id = lgt.ref_ae_header_id
4474: AND temp_line_num = lgt.temp_line_num * -1)
4475: AND NVL(lgt.header_num,0) > 0

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

4498: end loop;
4499: END IF;
4500:
4501: ---------------------------------------------------------------------------------------------------------
4502: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)
4503: ---------------------------------------------------------------------------------------------------------
4504: FORALL j IN 1..l_array_mpa_acc_ae_header_id.count
4505: DELETE xla_ae_lines_gt
4506: WHERE ledger_id = l_array_mpa_acc_ledger_id(j)

Line 4505: DELETE xla_ae_lines_gt

4501: ---------------------------------------------------------------------------------------------------------
4502: -- 4669308 Delete the MPA/Accrual Line Reversal in xla_ae_lines_gt (not in distribution links yet)
4503: ---------------------------------------------------------------------------------------------------------
4504: FORALL j IN 1..l_array_mpa_acc_ae_header_id.count
4505: DELETE xla_ae_lines_gt
4506: WHERE ledger_id = l_array_mpa_acc_ledger_id(j)
4507: AND ref_ae_header_id = l_array_mpa_acc_ref_ae_header(j)
4508: AND temp_line_num = l_array_mpa_acc_temp_line_num(j)
4509: AND ae_header_id = l_array_mpa_acc_ae_header_id(j)

Line 4533: NOTE: Changes have been done only for Cancellation from XLA_AE_LINES and not LINES_GT as the

4529: IS REVERSED ON THE CANCELLATION DATE.
4530: FUTURE PERIODS FINAL ACCOUNTED DATA WOULD BE REVERSED WITH THE RESPECTIVE
4531: FUTURE ACCOUNTING DATES.
4532:
4533: NOTE: Changes have been done only for Cancellation from XLA_AE_LINES and not LINES_GT as the
4534: MPA/Accrual Reversal data is deleted from above when Original and cancellation Event
4535: are accounted in the same Run.
4536: */
4537: --

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

4534: MPA/Accrual Reversal data is deleted from above when Original and cancellation Event
4535: are accounted in the same Run.
4536: */
4537: --
4538: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
4539: --
4540: INSERT INTO xla_ae_lines_gt
4541: (ae_header_id
4542: ,temp_line_num

Line 4540: INSERT INTO xla_ae_lines_gt

4536: */
4537: --
4538: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
4539: --
4540: INSERT INTO xla_ae_lines_gt
4541: (ae_header_id
4542: ,temp_line_num
4543: ,event_id
4544: ,ref_ae_header_id

Line 5532: xla_ae_lines_gt lgt1

5528: , lgt2.anc_id_98
5529: , lgt2.anc_id_99
5530: , lgt2.anc_id_100
5531: FROM
5532: xla_ae_lines_gt lgt1
5533: ,xla_ae_lines_gt lgt2
5534: ,xla_ae_headers_gt hgt
5535: WHERE lgt1.reversal_code = 'DUMMY_LR'
5536: AND lgt2.ledger_id = lgt1.ledger_id

Line 5533: ,xla_ae_lines_gt lgt2

5529: , lgt2.anc_id_99
5530: , lgt2.anc_id_100
5531: FROM
5532: xla_ae_lines_gt lgt1
5533: ,xla_ae_lines_gt lgt2
5534: ,xla_ae_headers_gt hgt
5535: WHERE lgt1.reversal_code = 'DUMMY_LR'
5536: AND lgt2.ledger_id = lgt1.ledger_id
5537: AND lgt2.source_distribution_type = lgt1.reverse_distribution_type

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

5550: AND hgt.balance_type_code = lgt2.balance_type_code
5551: AND hgt.entity_id = lgt1.entity_id
5552: -- lines for events with event number > current event number are not reversed.
5553: AND hgt.event_number < lgt1.event_number
5554: AND hgt.header_num = lgt2.header_num-- 4262811c Line Reversal (xla_ae_lines_gt_u1 error)
5555: AND hgt.ae_header_id = lgt2.ae_header_id
5556: )
5557: WHERE rn = 1
5558: );

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

5559:
5560:
5561: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
5562: trace
5563: (p_msg => 'Line Reversal - Reversal lines created from xla_ae_lines_gt = '||SQL%ROWCOUNT
5564: ,p_level => C_LEVEL_STATEMENT
5565: ,p_module => l_log_module);
5566: END IF;
5567:

Line 5582: xla_ae_lines_gt lgt

5578: g_incomplete_mpa_acc_LR.l_array_ae_header_id
5579: ,g_incomplete_mpa_acc_LR.l_array_ae_line_num
5580: ,g_incomplete_mpa_acc_LR.l_array_parent_ae_header
5581: FROM
5582: xla_ae_lines_gt lgt
5583: ,xla_ae_lines ael
5584: ,xla_ae_headers aeh
5585: ,xla_distribution_links xdl
5586: WHERE xdl.application_id = l_application_id

Line 5583: ,xla_ae_lines ael

5579: ,g_incomplete_mpa_acc_LR.l_array_ae_line_num
5580: ,g_incomplete_mpa_acc_LR.l_array_parent_ae_header
5581: FROM
5582: xla_ae_lines_gt lgt
5583: ,xla_ae_lines ael
5584: ,xla_ae_headers aeh
5585: ,xla_distribution_links xdl
5586: WHERE xdl.application_id = l_application_id
5587: AND xdl.source_distribution_type = lgt.reverse_distribution_type

Line 5627: -- Reverse the lines in xla_ae_lines table

5623: -------------------------------------------------------------------------------------------
5624:
5625: --
5626: ---------------------------------------------------------------------------------------------------------
5627: -- Reverse the lines in xla_ae_lines table
5628: --
5629: -- Some for 4669308:
5630: -- For MPA entries, only reverse what is necessary , ie create reversal for Complete MPA only.
5631: -- Do not create reversal for incomplete entry (since it will get deleted anyway).

Line 5636: INSERT INTO xla_ae_lines_gt

5632: -- Also, since the redundant lines will affect ROUNDING calculation.
5633: -- Need to create reversal in Draft mode also (so can be viewed).
5634: ---------------------------------------------------------------------------------------------------------
5635: --
5636: INSERT INTO xla_ae_lines_gt
5637: (ae_header_id
5638: ,temp_line_num
5639: ,event_id
5640: ,ref_ae_header_id

Line 6049: xla_ae_lines_gt lgt

6045: 'P','P',
6046: null) analytical_balance_flag -- Bug 7382288
6047: ,nvl2(ael.analytical_balance_flag, 'DUMMY_ANC_'||ael.ae_header_id||ael.ae_line_num,null) ANC_ID_1 --Bug 8691573
6048: FROM
6049: xla_ae_lines_gt lgt
6050: ,xla_distribution_links xdl
6051: ,xla_ae_lines ael
6052: ,xla_ae_headers aeh
6053: ,fnd_currencies fcu

Line 6051: ,xla_ae_lines ael

6047: ,nvl2(ael.analytical_balance_flag, 'DUMMY_ANC_'||ael.ae_header_id||ael.ae_line_num,null) ANC_ID_1 --Bug 8691573
6048: FROM
6049: xla_ae_lines_gt lgt
6050: ,xla_distribution_links xdl
6051: ,xla_ae_lines ael
6052: ,xla_ae_headers aeh
6053: ,fnd_currencies fcu
6054: ,xla_events evt
6055: WHERE lgt.reversal_code = 'DUMMY_LR'

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

6098: );
6099:
6100: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
6101: trace
6102: (p_msg => 'Line Reversal - Reversal lines created from xla_ae_lines = '||SQL%ROWCOUNT
6103: ,p_level => C_LEVEL_STATEMENT
6104: ,p_module => l_log_module);
6105: END IF;
6106:

Line 6177: FROM xla_ae_lines_gt gt1, xla_ae_headers

6173:
6174:
6175: SELECT min(xla_ae_headers.accounting_date)
6176: INTO l_min_ref_event_date
6177: FROM xla_ae_lines_gt gt1, xla_ae_headers
6178: WHERE gt1.reversal_code = 'REVERSAL'
6179: AND gt1.ref_event_id = xla_ae_headers.event_id;
6180:
6181:

Line 6211: FROM xla_ae_lines_gt gt1, gl_ledgers gll

6207:
6208:
6209: FOR c_not_reversed_entries IN
6210: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
6211: FROM xla_ae_lines_gt gt1, gl_ledgers gll
6212: WHERE gt1.reversal_code = 'DUMMY_LR'
6213: AND gll.ledger_id = gt1.ledger_id
6214: AND gll.ledger_category_code <> 'PRIMARY'
6215: AND NOT EXISTS (SELECT 1

Line 6216: FROM xla_ae_lines_gt gt2

6212: WHERE gt1.reversal_code = 'DUMMY_LR'
6213: AND gll.ledger_id = gt1.ledger_id
6214: AND gll.ledger_category_code <> 'PRIMARY'
6215: AND NOT EXISTS (SELECT 1
6216: FROM xla_ae_lines_gt gt2
6217: WHERE gt2.reversal_code = 'REVERSAL'
6218: AND gt1.event_id = gt2.event_id
6219: AND gt1.ledger_id = gt2.ledger_id)
6220: AND EXISTS (SELECT 1

Line 6221: FROM xla_ae_lines_gt gt3

6217: WHERE gt2.reversal_code = 'REVERSAL'
6218: AND gt1.event_id = gt2.event_id
6219: AND gt1.ledger_id = gt2.ledger_id)
6220: AND EXISTS (SELECT 1
6221: FROM xla_ae_lines_gt gt3
6222: WHERE gt3.reversal_code = 'REVERSAL'
6223: AND gt1.event_id = gt3.event_id))
6224:
6225: LOOP

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

6265: --***************************************************************************************************************
6266: --***************************************************************************************************************
6267:
6268: --
6269: -- selecting all the dummy lines from xla_ae_lines_gt that are due to
6270: -- transaction level reversal option
6271: --
6272: SELECT event_id
6273: ,ledger_id

Line 6313: FROM xla_ae_lines_gt

6309: ,l_array_gl_date -- 5189664
6310: ,l_array_tax_line_ref -- 7226263
6311: ,l_array_tax_summary_line_ref -- 7226263
6312: ,l_array_tax_rec_nrec_dist_ref -- 7226263
6313: FROM xla_ae_lines_gt
6314: WHERE reversal_code = 'DUMMY_TR'
6315: ORDER by entity_id, event_number;
6316:
6317: IF (C_LEVEL_STATEMENT >= g_log_level) THEN

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

6325: -- 4669308 Delete the MPA/Accrual Transaction Reversal (still in GT tables, not in distribution links yet)
6326: --=======================================================================================================
6327: --
6328: ---------------------------------------------------------------------------------------------------------
6329: -- 4669308 Delete the MPA/Accrual Transaction Reversal in xla_ae_lines_gt (not in distribution links yet)
6330: ---------------------------------------------------------------------------------------------------------
6331: --
6332: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
6333: FORALL i IN 1..l_array_entity_id.count

Line 6334: DELETE xla_ae_lines_gt lgt

6330: ---------------------------------------------------------------------------------------------------------
6331: --
6332: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5412560
6333: FORALL i IN 1..l_array_entity_id.count
6334: DELETE xla_ae_lines_gt lgt
6335: WHERE l_array_ledger_id(i) = lgt.ledger_id
6336: AND lgt.reversal_code IS NULL -- the lines created from reversal are not reversed again
6337: AND NOT EXISTS ( -- the lines already reversed are not reversed again
6338: SELECT 1

Line 6339: FROM xla_ae_lines_gt

6335: WHERE l_array_ledger_id(i) = lgt.ledger_id
6336: AND lgt.reversal_code IS NULL -- the lines created from reversal are not reversed again
6337: AND NOT EXISTS ( -- the lines already reversed are not reversed again
6338: SELECT 1
6339: FROM xla_ae_lines_gt
6340: WHERE ledger_id = lgt.ledger_id
6341: AND ref_ae_header_id = lgt.ae_header_id -- 5499367 lgt.ref_ae_header_id
6342: AND temp_line_num = lgt.temp_line_num * -1
6343: )

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

6369: ---------------------------------------------------------------------------------------------------------
6370:
6371:
6372: --
6373: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
6374: --
6375: FORALL i IN 1..l_array_event_id.count
6376: INSERT INTO xla_ae_lines_gt
6377: (ae_header_id

Line 6376: INSERT INTO xla_ae_lines_gt

6372: --
6373: -- reverse the lines in xla_ae_lines_gt table (not in distribution links yet)
6374: --
6375: FORALL i IN 1..l_array_event_id.count
6376: INSERT INTO xla_ae_lines_gt
6377: (ae_header_id
6378: ,temp_line_num
6379: ,event_id
6380: ,ref_ae_header_id

Line 7107: FROM xla_ae_lines_gt lgt

7103: , lgt.anc_id_98
7104: , lgt.anc_id_99
7105: , lgt.anc_id_100
7106:
7107: FROM xla_ae_lines_gt lgt
7108: ,xla_ae_headers_gt hgt
7109: WHERE hgt.entity_id = l_array_entity_id(i)
7110: AND hgt.ledger_id = l_array_ledger_id(i)
7111: AND hgt.event_number < l_array_event_number(i)

Line 7120: FROM xla_ae_lines_gt

7116: AND lgt.reversal_code IS NULL
7117: -- lines that are reversed earlier are not reversed again
7118: AND NOT EXISTS (
7119: SELECT 1
7120: FROM xla_ae_lines_gt
7121: WHERE ledger_id = lgt.ledger_id
7122: AND ref_ae_header_id = lgt.ae_header_id -- 5499367 lgt.ref_ae_header_id
7123: AND temp_line_num = lgt.temp_line_num * -1
7124: )

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

7126: ;
7127:
7128: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
7129: trace
7130: (p_msg => 'Transaction Reversal - Reversal lines created from xla_ae_lines_gt = '||SQL%ROWCOUNT
7131: ,p_level => C_LEVEL_STATEMENT
7132: ,p_module => l_log_module);
7133: END IF;
7134:

Line 7150: xla_ae_lines_gt lgt

7146: g_incomplete_mpa_acc_TR.l_array_ae_header_id
7147: ,g_incomplete_mpa_acc_TR.l_array_ae_line_num
7148: ,g_incomplete_mpa_acc_TR.l_array_parent_ae_header
7149: FROM
7150: xla_ae_lines_gt lgt
7151: ,xla_ae_lines ael
7152: ,xla_ae_headers aeh
7153: ,xla_events xet -- 5262950
7154: WHERE aeh.application_id = l_application_id

Line 7151: ,xla_ae_lines ael

7147: ,g_incomplete_mpa_acc_TR.l_array_ae_line_num
7148: ,g_incomplete_mpa_acc_TR.l_array_parent_ae_header
7149: FROM
7150: xla_ae_lines_gt lgt
7151: ,xla_ae_lines ael
7152: ,xla_ae_headers aeh
7153: ,xla_events xet -- 5262950
7154: WHERE aeh.application_id = l_application_id
7155: AND lgt.reversal_code = 'DUMMY_TR'

Line 7199: -- reverse the lines in xla_ae_lines table

7195: --end bug#6933157 24-Apr-2008
7196:
7197: --
7198: ---------------------------------------------------------------------------------------------------------
7199: -- reverse the lines in xla_ae_lines table
7200: --
7201: -- Some for 4669308:
7202: -- For MPA entries, only reverse what is necessary , ie create reversal for Complete MPA only.
7203: -- Do not create reversal for incomplete entry (since it will get deleted anyway).

Line 7209: INSERT INTO xla_ae_lines_gt

7205: -- Need to create reversal in Draft mode also (so can be viewed).
7206: ---------------------------------------------------------------------------------------------------------
7207: --
7208: FORALL i IN 1..l_array_event_id.count
7209: INSERT INTO xla_ae_lines_gt
7210: (ae_header_id
7211: ,temp_line_num
7212: ,event_id
7213: ,ref_ae_header_id

Line 7516: xla_ae_lines ael

7512: null) analytical_balance_flag --8417496
7513: ,nvl2(ael.analytical_balance_flag,'DUMMY_ANC_'||ael.ae_header_id||ael.ae_line_num,null) ANC_ID_1 --Bug 8691573
7514:
7515: FROM
7516: xla_ae_lines ael
7517: ,xla_ae_headers aeh
7518: ,xla_distribution_links xdl
7519: ,fnd_currencies fcu
7520: ,xla_events xe

Line 7543: FROM xla_ae_lines_gt

7539: AND application_id = xdl.application_id
7540: )
7541: AND NOT EXISTS (
7542: SELECT /*+ no_unnest */ 1
7543: FROM xla_ae_lines_gt
7544: WHERE ref_ae_header_id = xdl.ae_header_id
7545: AND temp_line_num = xdl.temp_line_num * -1
7546: AND ledger_id = l_array_ledger_id(i)
7547: )

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

7664: ;
7665:
7666: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
7667: trace
7668: (p_msg => 'Transaction Reversal - Reversal lines created from xla_ae_lines = '||SQL%ROWCOUNT
7669: ,p_level => C_LEVEL_STATEMENT
7670: ,p_module => l_log_module);
7671: END IF;
7672:

Line 7673: -- 8919497 : update DUMMY value into anc_id_1 column in xla_ae_lines_gt to avoid merging of lines which has supporting reference details.

7669: ,p_level => C_LEVEL_STATEMENT
7670: ,p_module => l_log_module);
7671: END IF;
7672:
7673: -- 8919497 : update DUMMY value into anc_id_1 column in xla_ae_lines_gt to avoid merging of lines which has supporting reference details.
7674: update xla_ae_lines_gt gt
7675: set anc_id_1 = (select 'DUMMY_ANC_'||xac.ae_header_id||xac.ae_line_num
7676: from xla_ae_line_acs xac
7677: where gt.ref_ae_header_id= xac.ae_header_id

Line 7674: update xla_ae_lines_gt gt

7670: ,p_module => l_log_module);
7671: END IF;
7672:
7673: -- 8919497 : update DUMMY value into anc_id_1 column in xla_ae_lines_gt to avoid merging of lines which has supporting reference details.
7674: update xla_ae_lines_gt gt
7675: set anc_id_1 = (select 'DUMMY_ANC_'||xac.ae_header_id||xac.ae_line_num
7676: from xla_ae_line_acs xac
7677: where gt.ref_ae_header_id= xac.ae_header_id
7678: and gt.ref_ae_line_num=xac.ae_line_num

Line 7688: (p_msg => 'Supporting Reference - Lines updated in xla_ae_lines_gt = '||SQL%ROWCOUNT

7684: and anc_id_1 is null; --bug 9668528
7685:
7686: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
7687: trace
7688: (p_msg => 'Supporting Reference - Lines updated in xla_ae_lines_gt = '||SQL%ROWCOUNT
7689: ,p_level => C_LEVEL_STATEMENT
7690: ,p_module => l_log_module);
7691: END IF;
7692:

Line 7699: FROM xla_ae_lines_gt gt1, xla_ae_headers

7695: IF l_upgrade_check = 1 THEN
7696:
7697: SELECT min(xla_ae_headers.accounting_date)
7698: INTO l_min_ref_event_date
7699: FROM xla_ae_lines_gt gt1, xla_ae_headers
7700: WHERE gt1.reversal_code = 'REVERSAL'
7701: AND gt1.ref_event_id = xla_ae_headers.event_id;
7702:
7703: l_error_count := 0;

Line 7716: FROM xla_ae_lines_gt gt1, gl_ledgers gll

7712:
7713:
7714: FOR c_not_reversed_entries IN
7715: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
7716: FROM xla_ae_lines_gt gt1, gl_ledgers gll
7717: WHERE gt1.reversal_code = 'DUMMY_TR'
7718: AND gll.ledger_id = gt1.ledger_id
7719: AND gll.ledger_category_code <> 'PRIMARY'
7720: AND NOT EXISTS (SELECT 1

Line 7721: FROM xla_ae_lines_gt gt2

7717: WHERE gt1.reversal_code = 'DUMMY_TR'
7718: AND gll.ledger_id = gt1.ledger_id
7719: AND gll.ledger_category_code <> 'PRIMARY'
7720: AND NOT EXISTS (SELECT 1
7721: FROM xla_ae_lines_gt gt2
7722: WHERE gt2.reversal_code = 'REVERSAL'
7723: AND gt1.event_id = gt2.event_id
7724: AND gt1.ledger_id = gt2.ledger_id)
7725: AND EXISTS (SELECT 1

Line 7726: FROM xla_ae_lines_gt gt3

7722: WHERE gt2.reversal_code = 'REVERSAL'
7723: AND gt1.event_id = gt2.event_id
7724: AND gt1.ledger_id = gt2.ledger_id)
7725: AND EXISTS (SELECT 1
7726: FROM xla_ae_lines_gt gt3
7727: WHERE gt3.reversal_code = 'REVERSAL'
7728: AND gt1.event_id = gt3.event_id))
7729:
7730: LOOP

Line 7773: FROM xla_ae_lines_gt lgt

7769: ,l_array_balance_type_code
7770: ,l_array_entry_status_code
7771: ,l_array_header_num -- 4262811c missing mpa reversal lines
7772: ,l_array_accounting_date -- added for bug8505463
7773: FROM xla_ae_lines_gt lgt
7774: WHERE reversal_code = 'REVERSAL'
7775: AND NOT EXISTS
7776: (SELECT 1
7777: FROM xla_ae_headers_gt

Line 7782: -- also causing XLA_AE_LINES_U1 error

7778: WHERE event_id = lgt.event_id
7779: AND ledger_id = lgt.ledger_id
7780: -- AND nvl(header_num, -1) = nvl(lgt.header_num, -1) -- 4262811c missing mpa reversal lines
7781: -- 4669308 NVL(-1) give separate headers for MPA
7782: -- also causing XLA_AE_LINES_U1 error
7783: AND nvl(header_num, 0) = nvl(lgt.header_num, 0) -- 4669308 NVL(0) combine replacement and MPA to 1 header
7784: AND balance_type_code = lgt.balance_type_code
7785: AND accounting_date = lgt.accounting_date ) -- added for bug8505463
7786: GROUP BY event_id

Line 7893: FROM xla_ae_lines_gt gt1

7889:
7890:
7891: FOR c_not_reversed_entries IN
7892: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
7893: FROM xla_ae_lines_gt gt1
7894: WHERE gt1.reversal_code IN ('DUMMY_LR', 'DUMMY_TR')
7895: AND NOT EXISTS (SELECT 1
7896: FROM xla_ae_lines_gt gt2
7897: WHERE gt2.reversal_code = 'REVERSAL'

Line 7896: FROM xla_ae_lines_gt gt2

7892: (SELECT DISTINCT gt1.event_id, gt1.ledger_id
7893: FROM xla_ae_lines_gt gt1
7894: WHERE gt1.reversal_code IN ('DUMMY_LR', 'DUMMY_TR')
7895: AND NOT EXISTS (SELECT 1
7896: FROM xla_ae_lines_gt gt2
7897: WHERE gt2.reversal_code = 'REVERSAL'
7898: AND gt1.event_id = gt2.event_id
7899: AND gt1.ledger_id = gt2.ledger_id))
7900:

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

7955: WHEN xla_exceptions_pkg.application_exception THEN
7956: RAISE;
7957: WHEN OTHERS THEN
7958: xla_exceptions_pkg.raise_message
7959: (p_location => 'xla_ae_lines_pkg.AccountingReversal');
7960: END AccountingReversal;
7961: --
7962: /*======================================================================+
7963: | |

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

8030: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
8031: RAISE;
8032: WHEN OTHERS THEN
8033: xla_exceptions_pkg.raise_message
8034: (p_location => 'XLA_AE_LINES_PKG.SetLineNum');
8035: --
8036: END SetLineNum;
8037: --
8038: --

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

8143: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
8144: RAISE;
8145: WHEN OTHERS THEN
8146: xla_exceptions_pkg.raise_message
8147: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');
8148: --
8149: END SetRevAccountingSource;
8150: --
8151: --

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

8254: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
8255: RAISE;
8256: WHEN OTHERS THEN
8257: xla_exceptions_pkg.raise_message
8258: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');
8259: --
8260: END SetRevAccountingSource;
8261: --
8262: /*======================================================================+

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

8346: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
8347: RAISE;
8348: WHEN OTHERS THEN
8349: xla_exceptions_pkg.raise_message
8350: (p_location => 'XLA_AE_LINES_PKG.SetRevAccountingSource');
8351: END SetRevAccountingSource;
8352: --
8353: --
8354: /*======================================================================+

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

8482: XLA_AE_JOURNAL_ENTRY_PKG.g_global_status := XLA_AE_JOURNAL_ENTRY_PKG.C_INVALID;
8483: RAISE;
8484: WHEN OTHERS THEN
8485: xla_exceptions_pkg.raise_message
8486: (p_location => 'XLA_AE_LINES_PKG.accounting_reversal');
8487: --
8488: END accounting_reversal;
8489: --
8490: */

Line 9231: ,p_rec_acct_attrs IN XLA_AE_LINES_PKG.t_rec_acct_attrs

9227: | |
9228: +======================================================================*/
9229: PROCEDURE SetAcctReversalAttrs
9230: (p_event_id IN NUMBER
9231: ,p_rec_acct_attrs IN XLA_AE_LINES_PKG.t_rec_acct_attrs
9232: ,p_calculate_acctd_flag IN VARCHAR2
9233: ,p_calculate_g_l_flag IN VARCHAR2) IS
9234:
9235: l_sys_distribution_type VARCHAR2(30);

Line 9702: xla_ae_lines_pkg.set_ccid(

9698:
9699: g_rec_lines.array_currency_mau(g_LineNumber) :=
9700: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9701:
9702: xla_ae_lines_pkg.set_ccid(
9703: p_code_combination_id => l_actual_upg_dr_ccid
9704: , p_value_type_code => 'S' --l_adr_value_type_code
9705: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9706: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 9779: xla_ae_lines_pkg.set_ccid(

9775:
9776: g_rec_lines.array_currency_mau(g_LineNumber) :=
9777: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9778:
9779: xla_ae_lines_pkg.set_ccid(
9780: p_code_combination_id => l_actual_upg_cr_ccid
9781: , p_value_type_code => 'S' --l_adr_value_type_code
9782: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9783: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 9870: xla_ae_lines_pkg.set_ccid(

9866:
9867: g_rec_lines.array_currency_mau(g_LineNumber) :=
9868: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9869:
9870: xla_ae_lines_pkg.set_ccid(
9871: p_code_combination_id => l_enc_upg_dr_ccid
9872: , p_value_type_code => 'S' --l_adr_value_type_code
9873: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9874: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 9948: xla_ae_lines_pkg.set_ccid(

9944:
9945: g_rec_lines.array_currency_mau(g_LineNumber) :=
9946: xla_accounting_cache_pkg.GetCurrencyMau(g_rec_lines.array_currency_code(g_LineNumber));
9947:
9948: xla_ae_lines_pkg.set_ccid(
9949: p_code_combination_id => l_enc_upg_cr_ccid
9950: , p_value_type_code => 'S' --l_adr_value_type_code
9951: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
9952: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 10101: FROM xla_ae_lines_gt xal

10097: trunc(fc1.derive_effective)), -1, 'OTHER', 'EMU'), 'OTHER' ) to_type
10098: ,decode( fc2.derive_type, 'EURO', 'EURO', 'EMU',
10099: decode( sign( trunc(nvl(xal.currency_conversion_date, xeg.transaction_date)) -
10100: trunc(fc2.derive_effective)), -1, 'OTHER', 'EMU'), 'OTHER' ) primary_type
10101: FROM xla_ae_lines_gt xal
10102: ,gl_ledgers gl
10103: ,fnd_currencies fc
10104: ,fnd_currencies fc1
10105: ,fnd_currencies fc2

Line 10448: UPDATE xla_ae_lines_gt xal

10444: */
10445:
10446: END IF;
10447: FORALL i in 1..l_array_conversion_type.COUNT
10448: UPDATE xla_ae_lines_gt xal
10449: SET currency_conversion_rate = l_array_new_rate(i)
10450: ,currency_conversion_type = l_array_new_type(i)
10451: ,currency_conversion_date = DECODE(xal.currency_code , 'STAT',xal.accounting_date,l_array_conversion_date(i)) -- added for bug13018249
10452: ,unrounded_accounted_cr = unrounded_entered_cr * l_array_new_rate(i)

Line 10499: UPDATE xla_ae_lines_gt xal

10495: END IF;
10496:
10497: /*
10498: FORALL i in 1..l_max_ledger_index
10499: UPDATE xla_ae_lines_gt xal
10500: SET (xal.unrounded_accounted_dr
10501: ,xal.unrounded_accounted_cr
10502: ,xal.currency_conversion_rate
10503: )

Line 11023: UPDATE xla_ae_lines_gt xal

11019: */
11020: /*
11021:
11022: FORALL i in 1..l_max_ledger_index
11023: UPDATE xla_ae_lines_gt xal
11024: SET (xal.unrounded_accounted_dr
11025: ,xal.unrounded_accounted_cr
11026: ,xal.currency_conversion_rate
11027: )

Line 11215: FROM xla_ae_lines_gt xal ,

11211: (SELECT
11212: /*+ NO_MERGE LEADING(gl) USE_HASH(xal) */
11213: xal.ae_header_id ,
11214: xal.ledger_id
11215: FROM xla_ae_lines_gt xal ,
11216: gl_ledgers gl
11217: WHERE xal.reversal_code IS NULL
11218: AND xal.balance_type_code <> 'X'
11219: AND xal.ledger_id = gl.ledger_id

Line 11237: XLA_AE_LINES_GT xal2

11233: THEN 1
11234: ELSE 0
11235: END) > 0 )
11236: ) iv,
11237: XLA_AE_LINES_GT xal2
11238: WHERE NVL(xal2.gain_or_loss_flag, 'N') = 'N'
11239: AND xal2.balance_type_code <> 'X'
11240: AND (xal2.reversal_code IS NULL
11241: OR xal2.reversal_code =C_DUMMY_SAME )

Line 11297: UPDATE /*+ index(xal XLA_AE_LINES_GT_N4)*/ xla_ae_lines_gt xal --9483834 incorrect alias in the hint.

11293: EXIT;
11294: END IF;
11295:
11296: FORALL Idx IN 1 .. l_array_ae_header_id.COUNT
11297: UPDATE /*+ index(xal XLA_AE_LINES_GT_N4)*/ xla_ae_lines_gt xal --9483834 incorrect alias in the hint.
11298: SET xal.unrounded_accounted_cr =
11299: CASE sign(l_res_array_accounted_amount(Idx))
11300: WHEN -1 THEN NULL
11301: ELSE l_res_array_accounted_amount(Idx)

Line 11345: UPDATE /*+ index(xal XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal --9483834 incorrect alias in the hint.

11341: END LOOP;
11342: CLOSE csr_gain_loss_amts;
11343:
11344: IF (g_num_bflow_prior_entries > 0) THEN
11345: UPDATE /*+ index(xal XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal --9483834 incorrect alias in the hint.
11346: SET xal.currency_code =
11347: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ max(currency_code)
11348: FROM xla_ae_lines_gt xal2
11349: WHERE xal2.ae_header_id = xal.ae_header_id

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

11343:
11344: IF (g_num_bflow_prior_entries > 0) THEN
11345: UPDATE /*+ index(xal XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal --9483834 incorrect alias in the hint.
11346: SET xal.currency_code =
11347: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ max(currency_code)
11348: FROM xla_ae_lines_gt xal2
11349: WHERE xal2.ae_header_id = xal.ae_header_id
11350: AND xal2.balance_type_code <> 'X'
11351: AND xal2.currency_code <> 'STAT' -- added for 13018249

Line 11348: FROM xla_ae_lines_gt xal2

11344: IF (g_num_bflow_prior_entries > 0) THEN
11345: UPDATE /*+ index(xal XLA_AE_LINES_GT_N3)*/ xla_ae_lines_gt xal --9483834 incorrect alias in the hint.
11346: SET xal.currency_code =
11347: (SELECT /*+ index(xal2 XLA_AE_LINES_GT_N4)*/ max(currency_code)
11348: FROM xla_ae_lines_gt xal2
11349: WHERE xal2.ae_header_id = xal.ae_header_id
11350: AND xal2.balance_type_code <> 'X'
11351: AND xal2.currency_code <> 'STAT' -- added for 13018249
11352: AND xal2.gain_or_loss_ref = xal.gain_or_loss_ref

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

11360: AND xal.currency_code <> 'STAT' -- added for 13018249
11361: AND xal.reversal_code is NULL
11362: and (xal.ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id)
11363: in
11364: (select /*+ index(xal3 XLA_AE_LINES_GT_N4)*/ ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id
11365: --9483834 incorrect alias in the hint.
11366: from xla_ae_lines_gt xal3
11367: where xal3.ae_header_id = xal.ae_header_id
11368: AND xal3.balance_type_code <> 'X'

Line 11366: from xla_ae_lines_gt xal3

11362: and (xal.ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id)
11363: in
11364: (select /*+ index(xal3 XLA_AE_LINES_GT_N4)*/ ae_header_id, balance_type_code, gain_or_loss_ref, ledger_id, event_id
11365: --9483834 incorrect alias in the hint.
11366: from xla_ae_lines_gt xal3
11367: where xal3.ae_header_id = xal.ae_header_id
11368: AND xal3.balance_type_code <> 'X'
11369: AND xal3.currency_code <> 'STAT' -- added for 13018249
11370: AND xal3.gain_or_loss_ref = xal.gain_or_loss_ref

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

11486: WHEN xla_exceptions_pkg.application_exception THEN
11487: RAISE;
11488: WHEN OTHERS THEN
11489: xla_exceptions_pkg.raise_message
11490: (p_location => 'xla_ae_lines_pkg.Business_Flow_Validation');
11491: --
11492: END Business_Flow_Validation;
11493:
11494:

Line 11620: FROM xla_ae_lines_gt xalg

11616: ELSE xal.currency_conversion_rate END
11617: )
11618: )
11619: ) DERIVED_EXCH_RATE
11620: FROM xla_ae_lines_gt xalg
11621: ,xla_transaction_entities xte
11622: ,xla_ae_headers xah
11623: ,xla_distribution_links xdl
11624: ,xla_ae_lines xal

Line 11624: ,xla_ae_lines xal

11620: FROM xla_ae_lines_gt xalg
11621: ,xla_transaction_entities xte
11622: ,xla_ae_headers xah
11623: ,xla_distribution_links xdl
11624: ,xla_ae_lines xal
11625: --Added for bug 12379106
11626: ,xla_events xe
11627: -- ,xla_ledger_relationships_v xlr
11628: -- ,xla_gl_ledgers_v xgl

Line 11716: FROM xla_ae_lines_gt

11712: event_id,
11713: ledger_id,
11714: balance_type_code,
11715: temp_line_num
11716: FROM xla_ae_lines_gt
11717: WHERE reversal_code = C_DUMMY_PRIOR
11718: AND bflow_prior_entry_status_code IS NOT NULL AND bflow_prior_entry_status_code <> 'X'; -- 5132302 if applied to amt is null
11719: --AND (bflow_prior_entry_status_code IN ('F', DECODE(p_accounting_mode, 'D', 'D', 'F')));
11720:

Line 11739: FROM xla_ae_lines_gt xal

11735: ,gl.ledger_category_code
11736: ,glp.start_date
11737: ,xte.entity_id xte_entity_id
11738: ,xte.entity_code
11739: FROM xla_ae_lines_gt xal
11740: ,fnd_application_vl fav
11741: ,gl_ledgers gl
11742: ,gl_period_statuses glp
11743: ,xla_transaction_entities_upg xte

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

11872:
11873: IF (g_num_bflow_prior_entries > 0) THEN
11874:
11875: --
11876: -- Update DUMMY_BFPE rows based on upstream journal lines in XLA_AE_LINES
11877: --
11878:
11879: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
11880:

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

11885: ,p_level => C_LEVEL_EVENT
11886: ,p_module => l_log_module);
11887: END LOOP;
11888:
11889: FOR l IN (SELECT * FROM xla_ae_lines_gt WHERE reversal_code = C_DUMMY_PRIOR) LOOP
11890: trace(p_msg => 'event_id='||l.event_id||
11891: ' ae_header_id='||l.ae_header_id
11892: ,p_level => C_LEVEL_STATEMENT
11893: ,p_module => l_log_module);

Line 11974: UPDATE xla_ae_lines_gt

11970: EXIT;
11971: END IF;
11972:
11973: FORALL i IN 1..l_array_row_id.LAST
11974: UPDATE xla_ae_lines_gt
11975: SET code_combination_id = l_array_ccid (i)
11976: ,description = l_array_description (i)
11977: ,temp_currency_code = l_array_currency_code (i) -- upstream currency code
11978: ,currency_conversion_rate = l_array_curr_conversion_rate (i)

Line 12003: UPDATE xla_ae_lines_gt xalg

11999: ----------------------------------------------------------------
12000:
12001: ----------------------------------------------------------------
12002: /* performance bug 5357406
12003: UPDATE xla_ae_lines_gt xalg
12004: SET (code_combination_id
12005: ,description
12006: ,temp_currency_code -- upstream currency code
12007: ,currency_conversion_rate

Line 12082: FROM xla_ae_lines xal3

12078: --,MIN(xah3.accounting_entry_status_code)
12079: ,MIN(DECODE(xalg.currency_code,xal3.currency_code,xah3.accounting_entry_status_code, -- 5132302
12080: DECODE(xalg.bflow_applied_to_amount, NULL, 'X', xah3.accounting_entry_status_code))) -- 5132302
12081: ,MIN(xah3.entity_id)
12082: FROM xla_ae_lines xal3
12083: , xla_ae_headers xah3
12084: , xla_distribution_links xdl3
12085: WHERE xah3.application_id = xdl3.application_id
12086: AND xah3.ae_header_id = xdl3.ae_header_id

Line 12121: , xla_ae_lines xal

12117: (SELECT MAX(xdl.ae_header_id)
12118: FROM xla_transaction_entities xte
12119: , xla_ae_headers xah
12120: , xla_distribution_links xdl
12121: , xla_ae_lines xal
12122: , xla_ledger_relationships_v xlr -- 4478604
12123: , xla_gl_ledgers_v xgl -- 4478604
12124: , xla_ledger_options xlo -- 5204178
12125: WHERE xgl.ledger_id = xalg.ledger_id -- 4478604

Line 12213: UPDATE /*+ index(xalg xla_ae_lines_gt_n2) */ xla_ae_lines_gt xalg -- 6990256

12209: END IF;
12210:
12211: IF (l_array_balance_type_code.COUNT > 0) THEN
12212: FORALL i IN 1..l_array_balance_type_code.COUNT
12213: UPDATE /*+ index(xalg xla_ae_lines_gt_n2) */ xla_ae_lines_gt xalg -- 6990256
12214: SET ref_ae_header_id = temp_ref_ae_header_id,
12215: currency_code = temp_currency_code,
12216: reversal_code = null, -- 5499367
12217: (unrounded_entered_cr -- 5132302

Line 12279: FROM xla_ae_lines xal

12275: --ELSE xalg.unrounded_entered_dr END))
12276: ELSE xalg.unrounded_entered_dr * nvl(xalg.DERIVED_EXCH_RATE,1) END))
12277: )
12278:
12279: FROM xla_ae_lines xal
12280: WHERE xal.application_id = xalg.bflow_application_id
12281: AND xal.ae_header_id = xalg.temp_ref_ae_header_id
12282: AND xal.ae_line_num = xalg.ref_ae_line_num),
12283: entered_currency_mau = xla_accounting_cache_pkg.GetCurrencyMau(temp_currency_code),

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

12397: -------------------------------------------------------------------------------------------------------------------------
12398: -- 4655713b Update MPA and Accrual Reversal lines with Prior Entry
12399: -------------------------------------------------------------------------------------------------------------------------
12400: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 5666366
12401: SELECT /*+ Leading (xal1,xah1,xal2) index(xah1 XLA_AE_HEADERS_GT_U1) index(xal2 XLA_AE_LINES_GT_N2) no_expand */ -- 5666366
12402: xal2.segment1, xal2.segment2, xal2.segment3, xal2.segment4, xal2.segment5
12403: ,xal2.segment6, xal2.segment7, xal2.segment8, xal2.segment9, xal2.segment10
12404: ,xal2.segment11, xal2.segment12, xal2.segment13, xal2.segment14, xal2.segment15
12405: ,xal2.segment16, xal2.segment17, xal2.segment18, xal2.segment19, xal2.segment20

Line 12472: FROM xla_ae_lines_gt xal2 -- original downstream line

12468: ,l_array_mpa_temp_line_num
12469: ,l_array_mpa_ae_header_id
12470: ,l_array_mpa_header_num
12471: ,l_array_acc_rev_flag
12472: FROM xla_ae_lines_gt xal2 -- original downstream line
12473: ,xla_ae_headers_gt xah1 -- original downstream header
12474: ,xla_ae_lines_gt xal1 -- recognition lines
12475: ,xla_ae_lines xal3 -- upstream line
12476: WHERE xal2.source_distribution_type = xal1.source_distribution_type

Line 12474: ,xla_ae_lines_gt xal1 -- recognition lines

12470: ,l_array_mpa_header_num
12471: ,l_array_acc_rev_flag
12472: FROM xla_ae_lines_gt xal2 -- original downstream line
12473: ,xla_ae_headers_gt xah1 -- original downstream header
12474: ,xla_ae_lines_gt xal1 -- recognition lines
12475: ,xla_ae_lines xal3 -- upstream line
12476: WHERE xal2.source_distribution_type = xal1.source_distribution_type
12477: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)
12478: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal1.source_distribution_id_num_2,C_NUM)

Line 12475: ,xla_ae_lines xal3 -- upstream line

12471: ,l_array_acc_rev_flag
12472: FROM xla_ae_lines_gt xal2 -- original downstream line
12473: ,xla_ae_headers_gt xah1 -- original downstream header
12474: ,xla_ae_lines_gt xal1 -- recognition lines
12475: ,xla_ae_lines xal3 -- upstream line
12476: WHERE xal2.source_distribution_type = xal1.source_distribution_type
12477: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)
12478: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal1.source_distribution_id_num_2,C_NUM)
12479: AND NVL(xal2.source_distribution_id_num_3,C_NUM) = NVL(xal1.source_distribution_id_num_3,C_NUM)

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

12530: ,p_level => C_LEVEL_STATEMENT
12531: ,p_module => l_log_module);
12532: END LOOP;
12533:
12534: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_MPA_PRIOR_ENTRY) LOOP
12535: trace
12536: (p_msg => 'ae_lines_gt PE dist ledger='||i.ledger_id||' ref_ae_header='||i.ref_ae_header_id||
12537: ' temp_line='||i.temp_line_num||' ae_header='||i.ae_header_id||' header_num='||i.header_num||
12538: ' bflow='||i.business_method_code||

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

12550: ,p_level => C_LEVEL_STATEMENT
12551: ,p_module => l_log_module);
12552: END LOOP;
12553:
12554: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_MPA_PRIOR_ENTRY) LOOP
12555: trace
12556: (p_msg => ' seg s1='||i.segment1||' s2='||i.segment2|| ' s3='||i.segment3||' s4='||i.segment4||
12557: ' s5='||i.segment5||' s6='||i.segment6|| ' s7='||i.segment7||' s8='||i.segment8||
12558: ' s9='||i.segment9||' s10='||i.segment10|| ' s11='||i.segment11||' s12='||i.segment12||

Line 12576: UPDATE /*+ INDEX(xal, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt xal

12572: -- NOTE: for Accrual-Reversal, one line may be Prior Entry and the rest may not, so update only Prior Entry line.
12573: ---------------------------------------------------------------------------------------------------------------
12574: FORALL i in 1..l_array_mpa_ledger_id.COUNT
12575: -- added hint for 8920369
12576: UPDATE /*+ INDEX(xal, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt xal
12577: SET segment1 = l_array_mpa_segment1(i)
12578: , segment2 = l_array_mpa_segment2(i)
12579: , segment3 = l_array_mpa_segment3(i)
12580: , segment4 = l_array_mpa_segment4(i)

Line 12651: UPDATE xla_ae_lines_gt xal

12647: --
12648: -- NOTE: some columns are set to NULL during Business_Flow_Validation
12649: ---------------------------------------------------------------------------------------------------------------
12650: FORALL i in 1..l_array_mpa_ledger_id.COUNT
12651: UPDATE xla_ae_lines_gt xal
12652: SET currency_code = DECODE(l_array_acc_rev_flag(i),'N',l_array_mpa_currency_code(i)
12653: ,currency_code)
12654: , currency_conversion_rate = DECODE(l_array_acc_rev_flag(i),'N',l_array_mpa_curr_conv_rate(i)
12655: ,currency_conversion_rate)

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

12874:
12875:
12876:
12877: --
12878: -- Bug 5339999 Delete the problematic lines from xla_ae_lines_gt.
12879: --
12880: FORALL i IN 1..l_array_balance_type_code.COUNT
12881: DELETE FROM XLA_AE_LINES_GT
12882: WHERE ae_header_id = l_array_ae_header_id(i)

Line 12881: DELETE FROM XLA_AE_LINES_GT

12877: --
12878: -- Bug 5339999 Delete the problematic lines from xla_ae_lines_gt.
12879: --
12880: FORALL i IN 1..l_array_balance_type_code.COUNT
12881: DELETE FROM XLA_AE_LINES_GT
12882: WHERE ae_header_id = l_array_ae_header_id(i)
12883: AND event_id = l_array_event_id(i)
12884: AND ledger_id = l_array_ledger_id(i)
12885: AND 'Y' = l_array_bflow_historic (i);

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

12918: -- Update JE line for invalid entries
12919: -------------------------------------------------------------------------
12920:
12921: FORALL i IN 1..l_array_balance_type_code.COUNT
12922: UPDATE /*+ index(xalg xla_ae_lines_gt_n2) */ xla_ae_lines_gt xalg
12923: SET xalg.code_combination_status_code = C_INVALID
12924: , xalg.code_combination_id = -1
12925: WHERE xalg.balance_type_code = l_array_balance_type_code(i)
12926: AND xalg.ae_header_id = l_array_ae_header_id(i)

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

12943: WHEN xla_exceptions_pkg.application_exception THEN
12944: RAISE;
12945: WHEN OTHERS THEN
12946: xla_exceptions_pkg.raise_message
12947: (p_location => 'xla_ae_lines_pkg.BusinessFlowPriorEntries');
12948: --
12949: END BusinessFlowPriorEntries;
12950:
12951: /*======================================================================+

Line 12996: FROM xla_ae_lines_gt l

12992: ,'N')
12993: ,'N')
12994: ,'N')
12995: ,'N') -- 5443083
12996: FROM xla_ae_lines_gt l
12997: ,xla_ae_headers_gt h
12998: ,xla_gl_ledgers_v xlr
12999: WHERE (reversal_code = C_DUMMY_SAME
13000: OR reversal_code = C_MPA_SAME_ENTRY) -- 4655713b

Line 13015: FROM xla_ae_lines_gt l

13011: , l.event_id
13012: , l.ledger_id
13013: , l.balance_type_code
13014: , l.header_num
13015: FROM xla_ae_lines_gt l
13016: WHERE (reversal_code = C_DUMMY_SAME
13017: OR reversal_code = C_MPA_SAME_ENTRY)
13018: ORDER BY l.ae_header_id;
13019:

Line 13282: FROM xla_ae_lines_gt xal2

13278: , l_array_join_ref_ae_header_id
13279: , l_array_join_temp_line_num
13280: , l_array_join_ae_header_id
13281: , l_array_join_header_num
13282: FROM xla_ae_lines_gt xal2
13283: , xla_ae_lines_gt xal
13284: , gl_code_combinations gcc
13285: WHERE xal2.source_distribution_type = xal.source_distribution_type
13286: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal.source_distribution_id_num_1,C_NUM)

Line 13283: , xla_ae_lines_gt xal

13279: , l_array_join_temp_line_num
13280: , l_array_join_ae_header_id
13281: , l_array_join_header_num
13282: FROM xla_ae_lines_gt xal2
13283: , xla_ae_lines_gt xal
13284: , gl_code_combinations gcc
13285: WHERE xal2.source_distribution_type = xal.source_distribution_type
13286: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal.source_distribution_id_num_1,C_NUM)
13287: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal.source_distribution_id_num_2,C_NUM)

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

13341: ,p_level => C_LEVEL_STATEMENT
13342: ,p_module => l_log_module);
13343: END LOOP;
13344:
13345: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_DUMMY_SAME) LOOP
13346: trace
13347: (p_msg => 'ae_lines_gt SE dist ledger='||i.ledger_id||' ref_ae_header='||i.ref_ae_header_id||
13348: ' temp_line='||i.temp_line_num||' ae_header='||i.ae_header_id||' header_num='||i.header_num||
13349: ' bflow='||i.business_method_code||

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

13358: ,p_level => C_LEVEL_STATEMENT
13359: ,p_module => l_log_module);
13360: END LOOP;
13361:
13362: FOR i IN (select * from xla_ae_Lines_gt where reversal_code=C_DUMMY_SAME) LOOP
13363: trace
13364: (p_msg => ' seg s1='||i.segment1||' s2='||i.segment2|| ' s3='||i.segment3||' s4='||i.segment4||
13365: ' s5='||i.segment5||' s6='||i.segment6|| ' s7='||i.segment7||' s8='||i.segment8||
13366: ' s9='||i.segment9||' s10='||i.segment10|| ' s11='||i.segment11||' s12='||i.segment12||

Line 13379: UPDATE /*+ INDEX(xal, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt xal

13375:
13376: END IF;
13377:
13378: FORALL i IN 1..l_array_join_ledger_id.COUNT
13379: UPDATE /*+ INDEX(xal, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt xal
13380: -- added hint for 8920369
13381: SET segment1 = l_array_same_segment1(i)
13382: , segment2 = l_array_same_segment2(i)
13383: , segment3 = l_array_same_segment3(i)

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

13429: -------------------------------------------------------------------------------------------------------------------------
13430: -- 4655713b Updates MPA-Accrual (not MPA-Recognition) and Accrual Reversal lines with Same Entry
13431: -------------------------------------------------------------------------------------------------------------------------
13432: IF xla_accounting_pkg.g_mpa_accrual_exists = 'Y' THEN -- 7128871
13433: SELECT /*+ Leading (xal1,xah1,xal2) index(xah1 XLA_AE_HEADERS_GT_U1) index(xal2 XLA_AE_LINES_GT_N2) no_expand */ -- 7128871
13434: xal2.segment1, xal2.segment2, xal2.segment3, xal2.segment4, xal2.segment5
13435: ,xal2.segment6, xal2.segment7, xal2.segment8, xal2.segment9, xal2.segment10
13436: ,xal2.segment11, xal2.segment12, xal2.segment13, xal2.segment14, xal2.segment15
13437: ,xal2.segment16, xal2.segment17, xal2.segment18, xal2.segment19, xal2.segment20

Line 13465: FROM xla_ae_lines_gt xal2 -- Original line

13461: ,l_array_mpa_ref_ae_header_id
13462: ,l_array_mpa_temp_line_num
13463: ,l_array_mpa_ae_header_id
13464: ,l_array_mpa_header_num
13465: FROM xla_ae_lines_gt xal2 -- Original line
13466: ,xla_ae_headers_gt xah1
13467: ,xla_ae_lines_gt xal1 -- MPA line
13468: WHERE xal2.source_distribution_type = xal1.source_distribution_type
13469: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)

Line 13467: ,xla_ae_lines_gt xal1 -- MPA line

13463: ,l_array_mpa_ae_header_id
13464: ,l_array_mpa_header_num
13465: FROM xla_ae_lines_gt xal2 -- Original line
13466: ,xla_ae_headers_gt xah1
13467: ,xla_ae_lines_gt xal1 -- MPA line
13468: WHERE xal2.source_distribution_type = xal1.source_distribution_type
13469: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal1.source_distribution_id_num_1,C_NUM)
13470: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal1.source_distribution_id_num_2,C_NUM)
13471: AND NVL(xal2.source_distribution_id_num_3,C_NUM) = NVL(xal1.source_distribution_id_num_3,C_NUM)

Line 13521: UPDATE /*+ INDEX(xal, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt xal

13517: END IF;
13518:
13519: FORALL i in 1..l_array_mpa_ledger_id.COUNT
13520: -- added hint for 8920369
13521: UPDATE /*+ INDEX(xal, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt xal
13522: SET segment1 = l_array_mpa_segment1(i)
13523: , segment2 = l_array_mpa_segment2(i)
13524: , segment3 = l_array_mpa_segment3(i)
13525: , segment4 = l_array_mpa_segment4(i)

Line 13568: UPDATE xla_ae_lines_gt xal

13564:
13565: /*-------------------------------------------------------------------------------------------------------------------
13566: -- Replaced for performance fix above
13567: ---------------------------------------------------------------------------------------------------------------------
13568: UPDATE xla_ae_lines_gt xal
13569: SET (segment1, segment2, segment3, segment4, segment5, segment6, segment7, segment8, segment9, segment10
13570: ,segment11, segment12, segment13, segment14, segment15, segment16, segment17, segment18, segment19, segment20
13571: ,segment21, segment22, segment23, segment24, segment25, segment26, segment27, segment28, segment29, segment30
13572: ,code_combination_id

Line 13672: FROM xla_ae_lines_gt xal2

13668: , CASE WHEN count(*) = 1
13669: THEN MIN(DECODE(xal.inherit_desc_flag, 'Y', xal2.description, xal.description)) ELSE NULL END
13670: , CASE WHEN count(*) = 1
13671: THEN NULL ELSE xal.reversal_code END
13672: FROM xla_ae_lines_gt xal2
13673: , gl_code_combinations gcc -- bug4384869
13674: WHERE xal2.source_distribution_type = xal.source_distribution_type
13675: AND NVL(xal2.source_distribution_id_num_1,C_NUM) = NVL(xal.source_distribution_id_num_1,C_NUM)
13676: AND NVL(xal2.source_distribution_id_num_2,C_NUM) = NVL(xal.source_distribution_id_num_2,C_NUM)

Line 13761: DELETE xla_ae_lines_gt

13757: ,p_level => C_LEVEL_STATEMENT
13758: );
13759: END IF;
13760:
13761: DELETE xla_ae_lines_gt
13762: WHERE ledger_id = l_array_ledger_id(i)
13763: AND ref_ae_header_id = l_array_ref_ae_header_id(i)
13764: AND temp_line_num = l_array_temp_line_num(i)
13765: AND ae_header_id = l_array_ae_header_id(i)

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

13777: WHERE ledger_id = l_array_ledger_id(i)
13778: AND ae_header_id = l_array_ae_header_id(i)
13779: AND balance_type_code = l_array_balance_type_code(i)
13780: AND header_num = l_array_header_num(i)
13781: AND NOT EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1
13782: FROM xla_ae_lines_gt lgt
13783: WHERE lgt.ledger_id = hgt.ledger_id
13784: AND lgt.ae_header_id = hgt.ae_header_id
13785: AND lgt.header_num = hgt.header_num

Line 13782: FROM xla_ae_lines_gt lgt

13778: AND ae_header_id = l_array_ae_header_id(i)
13779: AND balance_type_code = l_array_balance_type_code(i)
13780: AND header_num = l_array_header_num(i)
13781: AND NOT EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1
13782: FROM xla_ae_lines_gt lgt
13783: WHERE lgt.ledger_id = hgt.ledger_id
13784: AND lgt.ae_header_id = hgt.ae_header_id
13785: AND lgt.header_num = hgt.header_num
13786: AND lgt.balance_type_code = hgt.balance_type_code);

Line 13811: UPDATE /*+ INDEX(xla_ae_lines_gt, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt

13807: --
13808: -- Update JE lines for those that encountered error
13809: --
13810: FORALL i IN 1..l_array_balance_type_code.COUNT
13811: UPDATE /*+ INDEX(xla_ae_lines_gt, XLA_AE_LINES_GT_U1)*/ xla_ae_lines_gt
13812: SET description = DECODE(description, C_CHAR, NULL, description)
13813: , code_combination_id = DECODE(code_combination_id, C_NUM, -1, code_combination_id)
13814: , code_combination_status_code = C_INVALID -- 4655713
13815: , segment1 = DECODE(segment1, C_CHAR, NULL, segment1)

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

13885: AND event_id = l_array_event_id(i)
13886: AND ledger_id = l_array_ledger_id(i)
13887: AND header_num = l_array_header_num(i) -- 5443083
13888: AND balance_type_code = l_array_balance_type_code(i)
13889: AND EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1 - 5443083
13890: FROM xla_ae_lines_gt lgt
13891: WHERE lgt.ledger_id = hgt.ledger_id
13892: AND lgt.ae_header_id = hgt.ae_header_id
13893: AND lgt.header_num = hgt.header_num

Line 13890: FROM xla_ae_lines_gt lgt

13886: AND ledger_id = l_array_ledger_id(i)
13887: AND header_num = l_array_header_num(i) -- 5443083
13888: AND balance_type_code = l_array_balance_type_code(i)
13889: AND EXISTS (SELECT /*+ index(lgt XLA_AE_LINES_GT_N2) */ 1 - 5443083
13890: FROM xla_ae_lines_gt lgt
13891: WHERE lgt.ledger_id = hgt.ledger_id
13892: AND lgt.ae_header_id = hgt.ae_header_id
13893: AND lgt.header_num = hgt.header_num
13894: AND lgt.balance_type_code = hgt.balance_type_code

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

13928: WHEN xla_exceptions_pkg.application_exception THEN
13929: RAISE;
13930: WHEN OTHERS THEN
13931: xla_exceptions_pkg.raise_message
13932: (p_location => 'xla_ae_lines_pkg.BusinessFlowSameEntries');
13933: --
13934: END BusinessFlowSameEntries;
13935:
13936: /*======================================================================+

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

14116: WHEN xla_exceptions_pkg.application_exception THEN
14117: RAISE;
14118: WHEN OTHERS THEN
14119: xla_exceptions_pkg.raise_message
14120: (p_location => 'xla_ae_lines_pkg.ValidateBFlowLinks');
14121: --
14122: END ValidateBFlowLinks;
14123:
14124: /*======================================================================+

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

14607: WHEN xla_exceptions_pkg.application_exception THEN
14608: RAISE;
14609: WHEN OTHERS THEN
14610: xla_exceptions_pkg.raise_message
14611: (p_location => 'xla_ae_lines_pkg.CopyLineInfo');
14612: --
14613: END CopyLineInfo;
14614:
14615: /*======================================================================+

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

15491: WHEN xla_exceptions_pkg.application_exception THEN
15492: RAISE;
15493: WHEN OTHERS THEN
15494: xla_exceptions_pkg.raise_message
15495: (p_location => 'xla_ae_lines_pkg.CopyLineInfo(OverLoaded)');
15496: --
15497: END CopyLineInfo;
15498:
15499:

Line 15705: xla_ae_lines_pkg.set_ccid(

15701:
15702: -- Bug 4922099
15703: IF ((NVL(g_rec_lines.array_actual_upg_option(g_LineNumber), 'N') = 'Y') OR
15704: (NVL(g_rec_lines.array_enc_upg_option(g_LineNumber), 'N') = 'Y')) THEN
15705: xla_ae_lines_pkg.set_ccid(
15706: p_code_combination_id => l_ccid
15707: , p_value_type_code => 'S' --l_adr_value_type_code
15708: , p_transaction_coa_id => NULL --l_adr_transaction_coa_id
15709: , p_accounting_coa_id => NULL --l_adr_accounting_coa_id

Line 16516: (p_location => 'xla_ae_lines_pkg.InsertMPARecogLineInfo');

16512: WHEN xla_exceptions_pkg.application_exception THEN
16513: RAISE;
16514: WHEN OTHERS THEN
16515: xla_exceptions_pkg.raise_message
16516: (p_location => 'xla_ae_lines_pkg.InsertMPARecogLineInfo');
16517: --
16518: END InsertMPARecogLineInfo;
16519:
16520: /*======================================================================+

Line 16540: XLA_AE_LINES_PKG.g_mpa_recog_lines := NULL ;

16536: ,p_level => C_LEVEL_PROCEDURE
16537: ,p_module => l_log_module);
16538: END IF;
16539:
16540: XLA_AE_LINES_PKG.g_mpa_recog_lines := NULL ;
16541:
16542: IF (C_LEVEL_PROCEDURE >= g_log_level) THEN
16543: trace
16544: (p_msg => 'End of SetNullMPALineInfo'

Line 16554: (p_location => 'xla_ae_lines_pkg.SetNullMPALineInfo');

16550: WHEN xla_exceptions_pkg.application_exception THEN
16551: RAISE;
16552: WHEN OTHERS THEN
16553: xla_exceptions_pkg.raise_message
16554: (p_location => 'xla_ae_lines_pkg.SetNullMPALineInfo');
16555: --
16556: END SetNullMPALineInfo;
16557:
16558: /*======================================================================+

Line 16592: (p_location => 'xla_ae_lines_pkg.SetNullMpaTrxAcctCopyInfo');

16588: WHEN xla_exceptions_pkg.application_exception THEN
16589: RAISE;
16590: WHEN OTHERS THEN
16591: xla_exceptions_pkg.raise_message
16592: (p_location => 'xla_ae_lines_pkg.SetNullMpaTrxAcctCopyInfo');
16593: --
16594: END SetNullMpaTrxAcctCopyInfo;
16595:
16596: /*======================================================================+

Line 16685: (p_location => 'xla_ae_lines_pkg.InsertMpaTrxAcctCopyInfo');

16681: WHEN xla_exceptions_pkg.application_exception THEN
16682: RAISE;
16683: WHEN OTHERS THEN
16684: xla_exceptions_pkg.raise_message
16685: (p_location => 'xla_ae_lines_pkg.InsertMpaTrxAcctCopyInfo');
16686: --
16687: END InsertMpaTrxAcctCopyInfo;
16688:
16689: /*======================================================================+

Line 16765: (p_location => 'xla_ae_lines_pkg.CopyMpaTrxAcctCopyInfo');

16761: WHEN xla_exceptions_pkg.application_exception THEN
16762: RAISE;
16763: WHEN OTHERS THEN
16764: xla_exceptions_pkg.raise_message
16765: (p_location => 'xla_ae_lines_pkg.CopyMpaTrxAcctCopyInfo');
16766: --
16767: END CopyMpaTrxAcctCopyInfo;
16768:
16769: --=============================================================================

Line 16821: END xla_ae_lines_pkg;

16817: IF NOT g_log_enabled THEN
16818: g_log_level := C_LEVEL_LOG_DISABLED;
16819: END IF;
16820:
16821: END xla_ae_lines_pkg;